diff options
Diffstat (limited to 'core/fpdfapi')
-rw-r--r-- | core/fpdfapi/edit/cpdf_creator.cpp | 13 | ||||
-rw-r--r-- | core/fpdfapi/edit/cpdf_creator.h | 6 |
2 files changed, 8 insertions, 11 deletions
diff --git a/core/fpdfapi/edit/cpdf_creator.cpp b/core/fpdfapi/edit/cpdf_creator.cpp index 32dd28456e..d3cf5b85b7 100644 --- a/core/fpdfapi/edit/cpdf_creator.cpp +++ b/core/fpdfapi/edit/cpdf_creator.cpp @@ -56,7 +56,8 @@ int32_t OutputIndex(CFX_FileBufferArchive* pFile, FX_FILESIZE offset) { } // namespace -CPDF_Creator::CPDF_Creator(CPDF_Document* pDoc) +CPDF_Creator::CPDF_Creator(CPDF_Document* pDoc, + const CFX_RetainPtr<IFX_WriteStream>& pFile) : m_pDocument(pDoc), m_pParser(pDoc->GetParser()), m_bSecurityChanged(false), @@ -73,7 +74,9 @@ CPDF_Creator::CPDF_Creator(CPDF_Document* pDoc) m_CurObjNum(0), m_XrefStart(0), m_pIDArray(nullptr), - m_FileVersion(0) {} + m_FileVersion(0) { + m_File.AttachFile(pFile); +} CPDF_Creator::~CPDF_Creator() { Clear(); @@ -911,12 +914,6 @@ void CPDF_Creator::Clear() { m_pIDArray.reset(); } -bool CPDF_Creator::Create(const CFX_RetainPtr<IFX_WriteStream>& pFile, - uint32_t flags) { - m_File.AttachFile(pFile); - return Create(flags); -} - bool CPDF_Creator::Create(uint32_t flags) { m_dwFlags = flags; m_iStage = 0; diff --git a/core/fpdfapi/edit/cpdf_creator.h b/core/fpdfapi/edit/cpdf_creator.h index 9a15021c25..e263c6cc1d 100644 --- a/core/fpdfapi/edit/cpdf_creator.h +++ b/core/fpdfapi/edit/cpdf_creator.h @@ -29,11 +29,12 @@ class CPDF_XRefStream; class CPDF_Creator { public: - explicit CPDF_Creator(CPDF_Document* pDoc); + explicit CPDF_Creator(CPDF_Document* pDoc, + const CFX_RetainPtr<IFX_WriteStream>& pFile); ~CPDF_Creator(); void RemoveSecurity(); - bool Create(const CFX_RetainPtr<IFX_WriteStream>& pFile, uint32_t flags = 0); + bool Create(uint32_t flags = 0); int32_t Continue(); bool SetFileVersion(int32_t fileVersion = 17); @@ -60,7 +61,6 @@ class CPDF_Creator { bool IsIncremental() const { return !!(m_dwFlags & FPDFCREATE_INCREMENTAL); } private: - bool Create(uint32_t flags); void Clear(); void InitOldObjNumOffsets(); |