diff options
Diffstat (limited to 'core/fpdfapi/fpdf_parser/include')
-rw-r--r-- | core/fpdfapi/fpdf_parser/include/cpdf_document.h | 6 | ||||
-rw-r--r-- | core/fpdfapi/fpdf_parser/include/cpdf_parser.h | 11 |
2 files changed, 7 insertions, 10 deletions
diff --git a/core/fpdfapi/fpdf_parser/include/cpdf_document.h b/core/fpdfapi/fpdf_parser/include/cpdf_document.h index 31988d8c9d..f3322425ed 100644 --- a/core/fpdfapi/fpdf_parser/include/cpdf_document.h +++ b/core/fpdfapi/fpdf_parser/include/cpdf_document.h @@ -40,10 +40,10 @@ class JBig2_DocumentContext; class CPDF_Document : public CPDF_IndirectObjectHolder { public: - explicit CPDF_Document(CPDF_Parser* pParser); + explicit CPDF_Document(std::unique_ptr<CPDF_Parser> pParser); ~CPDF_Document() override; - CPDF_Parser* GetParser() const { return m_pParser; } + CPDF_Parser* GetParser() const { return m_pParser.get(); } CPDF_Dictionary* GetRoot() const { return m_pRootDict; } CPDF_Dictionary* GetInfo() const { return m_pInfoDict; } @@ -128,7 +128,7 @@ class CPDF_Document : public CPDF_IndirectObjectHolder { FX_BOOL CheckOCGVisible(CPDF_Dictionary* pOCG, FX_BOOL bPrinting); CPDF_Object* ParseIndirectObject(uint32_t objnum) override; - CPDF_Parser* m_pParser; + std::unique_ptr<CPDF_Parser> m_pParser; CPDF_Dictionary* m_pRootDict; CPDF_Dictionary* m_pInfoDict; CFX_ByteString m_ID1; diff --git a/core/fpdfapi/fpdf_parser/include/cpdf_parser.h b/core/fpdfapi/fpdf_parser/include/cpdf_parser.h index a69f0fe38e..d6a5d5703b 100644 --- a/core/fpdfapi/fpdf_parser/include/cpdf_parser.h +++ b/core/fpdfapi/fpdf_parser/include/cpdf_parser.h @@ -37,17 +37,14 @@ class CPDF_Parser { CPDF_Parser(); ~CPDF_Parser(); - Error StartParse(IFX_FileRead* pFile, - std::unique_ptr<CPDF_Document> pDocument); - - Error StartLinearizedParse(IFX_FileRead* pFile, - std::unique_ptr<CPDF_Document> pDocument); + Error StartParse(IFX_FileRead* pFile, CPDF_Document* pDocument); + Error StartLinearizedParse(IFX_FileRead* pFile, CPDF_Document* pDocument); void SetPassword(const FX_CHAR* password) { m_Password = password; } CFX_ByteString GetPassword() { return m_Password; } CPDF_Dictionary* GetTrailer() const { return m_pTrailer; } FX_FILESIZE GetLastXRefOffset() const { return m_LastXRefOffset; } - CPDF_Document* GetDocument() const { return m_pDocument.get(); } + CPDF_Document* GetDocument() const { return m_pDocument; } uint32_t GetPermissions() const; uint32_t GetRootObjNum(); @@ -120,7 +117,7 @@ class CPDF_Parser { // the objects. bool VerifyCrossRefV4(); - std::unique_ptr<CPDF_Document> m_pDocument; + CPDF_Document* m_pDocument; // not owned std::unique_ptr<CPDF_SyntaxParser> m_pSyntax; bool m_bOwnFileRead; int m_FileVersion; |