summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/fpdfsave.cpp
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2015-08-14 22:16:22 -0700
committerLei Zhang <thestig@chromium.org>2015-08-14 22:16:22 -0700
commit2b1a2d528469cda4e9f3e36d3c7a649e0d476480 (patch)
tree91eea8ae70b87c632a06fba52ea06c0842e30878 /fpdfsdk/src/fpdfsave.cpp
parent62b2e912dc2a508972fbf01b25f7449c39ff1543 (diff)
downloadpdfium-2b1a2d528469cda4e9f3e36d3c7a649e0d476480.tar.xz
Merge to XFA: Use override in more classes in fpdfsdk/
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1287193005 . (cherry picked from commit 0f6b51c0fdd14f5762bf3c7412ac59c825443cc3) Review URL: https://codereview.chromium.org/1288393004 .
Diffstat (limited to 'fpdfsdk/src/fpdfsave.cpp')
-rw-r--r--fpdfsdk/src/fpdfsave.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/fpdfsdk/src/fpdfsave.cpp b/fpdfsdk/src/fpdfsave.cpp
index f56cc442f0..7a666bceb8 100644
--- a/fpdfsdk/src/fpdfsave.cpp
+++ b/fpdfsdk/src/fpdfsave.cpp
@@ -22,10 +22,12 @@ class CFX_IFileWrite final : public IFX_StreamWrite {
public:
CFX_IFileWrite();
FX_BOOL Init(FPDF_FILEWRITE* pFileWriteStruct);
- virtual FX_BOOL WriteBlock(const void* pData, size_t size) override;
- virtual void Release() override {}
+ FX_BOOL WriteBlock(const void* pData, size_t size) override;
+ void Release() override;
protected:
+ ~CFX_IFileWrite() override {}
+
FPDF_FILEWRITE* m_pFileWriteStruct;
};
@@ -49,6 +51,10 @@ FX_BOOL CFX_IFileWrite::WriteBlock(const void* pData, size_t size) {
return TRUE;
}
+void CFX_IFileWrite::Release() {
+ delete this;
+}
+
#define XFA_DATASETS 0
#define XFA_FORMS 1
@@ -311,7 +317,6 @@ FPDF_BOOL _FPDF_Doc_Save(FPDF_DOCUMENT document,
bRet = FileMaker.Create(pStreamWrite, flags);
_SendPostSaveToXFADoc(pDoc);
- // pDoc->_ClearChangeMark();
for (int i = 0; i < fileList.GetSize(); i++) {
IFX_FileStream* pFile = (IFX_FileStream*)fileList.GetAt(i);
@@ -319,7 +324,7 @@ FPDF_BOOL _FPDF_Doc_Save(FPDF_DOCUMENT document,
}
fileList.RemoveAll();
- delete pStreamWrite;
+ pStreamWrite->Release();
return bRet;
}