summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/fpdfsave.cpp
diff options
context:
space:
mode:
authorBo Xu <bo_xu@foxitsoftware.com>2014-06-12 13:40:04 -0700
committerBo Xu <bo_xu@foxitsoftware.com>2014-06-12 13:40:04 -0700
commita5572c3715624b38ac861c87236185f98fa9083b (patch)
treee1a081264c67430c2aabc33681fc51c07e3b9cbc /fpdfsdk/src/fpdfsave.cpp
parent3084c79dce15a41c056d4e5c634e09010e7323e0 (diff)
downloadpdfium-a5572c3715624b38ac861c87236185f98fa9083b.tar.xz
Enable security removal in FPDF_Doc_Save
R=jam@chromium.org Review URL: https://codereview.chromium.org/333753002
Diffstat (limited to 'fpdfsdk/src/fpdfsave.cpp')
-rw-r--r--fpdfsdk/src/fpdfsave.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/fpdfsdk/src/fpdfsave.cpp b/fpdfsdk/src/fpdfsave.cpp
index 0c7acc8c47..6637c784fe 100644
--- a/fpdfsdk/src/fpdfsave.cpp
+++ b/fpdfsdk/src/fpdfsave.cpp
@@ -60,7 +60,7 @@ FPDF_BOOL _FPDF_Doc_Save(FPDF_DOCUMENT document,FPDF_FILEWRITE * pFileWrite,FPDF
if (!pDoc)
return 0;
- if ( flags < 1 || flags > 2 )
+ if ( flags < FPDF_INCREMENTAL || flags > FPDF_REMOVE_SECURITY )
{
flags = 0;
}
@@ -68,6 +68,11 @@ FPDF_BOOL _FPDF_Doc_Save(FPDF_DOCUMENT document,FPDF_FILEWRITE * pFileWrite,FPDF
CPDF_Creator FileMaker(pDoc);
if(bSetVersion)
FileMaker.SetFileVersion(fileVerion);
+ if(flags == FPDF_REMOVE_SECURITY)
+ {
+ flags = 0;
+ FileMaker.RemoveSecurity();
+ }
CFX_IFileWrite* pStreamWrite = NULL;
FX_BOOL bRet;
pStreamWrite = new CFX_IFileWrite;