Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(62)

Unified Diff: fpdfsdk/src/fpdfsave.cpp

Issue 333753002: Enable security removal in FPDF_Doc_Save (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « fpdfsdk/include/fpdfsave.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/src/fpdfsave.cpp
diff --git a/fpdfsdk/src/fpdfsave.cpp b/fpdfsdk/src/fpdfsave.cpp
index 0c7acc8c47dc019b6ab68e04489b1734a7a88d92..6637c784fe17e9e3945a7fef9d51ed45fcadaf8d 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;
« no previous file with comments | « fpdfsdk/include/fpdfsave.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698