Index: fpdfsdk/fpdfdoc_unittest.cpp |
diff --git a/fpdfsdk/fpdfdoc_unittest.cpp b/fpdfsdk/fpdfdoc_unittest.cpp |
index 896c7d0c72f71165b0ab1dcf40dcb5938bc1093e..a555e961f3889f9378644cbf43b1b8fb5d3dfa2e 100644 |
--- a/fpdfsdk/fpdfdoc_unittest.cpp |
+++ b/fpdfsdk/fpdfdoc_unittest.cpp |
@@ -10,6 +10,7 @@ |
#include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" |
#include "core/fpdfapi/fpdf_parser/include/cpdf_name.h" |
#include "core/fpdfapi/fpdf_parser/include/cpdf_number.h" |
+#include "core/fpdfapi/fpdf_parser/include/cpdf_parser.h" |
#include "core/fpdfapi/fpdf_parser/include/cpdf_reference.h" |
#include "core/fpdfapi/fpdf_parser/include/cpdf_string.h" |
#include "core/fpdfapi/include/cpdf_modulemgr.h" |
@@ -23,7 +24,7 @@ |
class CPDF_TestDocument : public CPDF_Document { |
public: |
- CPDF_TestDocument() : CPDF_Document(nullptr) {} |
+ CPDF_TestDocument() : CPDF_Document(std::unique_ptr<CPDF_Parser>()) {} |
void SetRoot(CPDF_Dictionary* root) { m_pRootDict = root; } |
CPDF_IndirectObjectHolder* GetHolder() { return this; } |
@@ -33,7 +34,8 @@ class CPDF_TestDocument : public CPDF_Document { |
class CPDF_TestXFADocument : public CPDFXFA_Document { |
public: |
CPDF_TestXFADocument() |
- : CPDFXFA_Document(new CPDF_TestDocument(), CPDFXFA_App::GetInstance()) {} |
+ : CPDFXFA_Document(WrapUnique(new CPDF_TestDocument()), |
+ CPDFXFA_App::GetInstance()) {} |
void SetRoot(CPDF_Dictionary* root) { |
reinterpret_cast<CPDF_TestDocument*>(GetPDFDoc())->SetRoot(root); |