Remove bSimpleFileSpec argument from ExportToFDF()
All callers pass it as false.
Change-Id: Ib388e74fab9d01007e57c5303b35667840d8d63f
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/80933
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
diff --git a/core/fpdfdoc/cpdf_interactiveform.cpp b/core/fpdfdoc/cpdf_interactiveform.cpp
index 6d23bfb..ce0cdac 100644
--- a/core/fpdfdoc/cpdf_interactiveform.cpp
+++ b/core/fpdfdoc/cpdf_interactiveform.cpp
@@ -938,39 +938,30 @@
}
std::unique_ptr<CFDF_Document> CPDF_InteractiveForm::ExportToFDF(
- const WideString& pdf_path,
- bool bSimpleFileSpec) const {
+ const WideString& pdf_path) const {
std::vector<CPDF_FormField*> fields;
CFieldTree::Node* pRoot = m_pFieldTree->GetRoot();
const size_t nCount = pRoot->CountFields();
for (size_t i = 0; i < nCount; ++i)
fields.push_back(pRoot->GetFieldAtIndex(i));
- return ExportToFDF(pdf_path, fields, true, bSimpleFileSpec);
+ return ExportToFDF(pdf_path, fields, true);
}
std::unique_ptr<CFDF_Document> CPDF_InteractiveForm::ExportToFDF(
const WideString& pdf_path,
const std::vector<CPDF_FormField*>& fields,
- bool bIncludeOrExclude,
- bool bSimpleFileSpec) const {
+ bool bIncludeOrExclude) const {
std::unique_ptr<CFDF_Document> pDoc = CFDF_Document::CreateNewDoc();
if (!pDoc)
return nullptr;
CPDF_Dictionary* pMainDict = pDoc->GetRoot()->GetDictFor("FDF");
if (!pdf_path.IsEmpty()) {
- if (bSimpleFileSpec) {
- WideString wsFilePath = CPDF_FileSpec::EncodeFileName(pdf_path);
- pMainDict->SetNewFor<CPDF_String>(pdfium::stream::kF,
- wsFilePath.ToDefANSI(), false);
- pMainDict->SetNewFor<CPDF_String>("UF", wsFilePath);
- } else {
- auto pNewDict = pDoc->New<CPDF_Dictionary>();
- pNewDict->SetNewFor<CPDF_Name>("Type", "Filespec");
- CPDF_FileSpec filespec(pNewDict.Get());
- filespec.SetFileName(pdf_path);
- pMainDict->SetFor("F", pNewDict);
- }
+ auto pNewDict = pDoc->New<CPDF_Dictionary>();
+ pNewDict->SetNewFor<CPDF_Name>("Type", "Filespec");
+ CPDF_FileSpec filespec(pNewDict.Get());
+ filespec.SetFileName(pdf_path);
+ pMainDict->SetFor("F", pNewDict);
}
CPDF_Array* pFields = pMainDict->SetNewFor<CPDF_Array>("Fields");
diff --git a/core/fpdfdoc/cpdf_interactiveform.h b/core/fpdfdoc/cpdf_interactiveform.h
index 1d69ce4..9bac8aa 100644
--- a/core/fpdfdoc/cpdf_interactiveform.h
+++ b/core/fpdfdoc/cpdf_interactiveform.h
@@ -75,14 +75,11 @@
bool CheckRequiredFields(const std::vector<CPDF_FormField*>* fields,
bool bIncludeOrExclude) const;
- std::unique_ptr<CFDF_Document> ExportToFDF(const WideString& pdf_path,
- bool bSimpleFileSpec) const;
-
+ std::unique_ptr<CFDF_Document> ExportToFDF(const WideString& pdf_path) const;
std::unique_ptr<CFDF_Document> ExportToFDF(
const WideString& pdf_path,
const std::vector<CPDF_FormField*>& fields,
- bool bIncludeOrExclude,
- bool bSimpleFileSpec) const;
+ bool bIncludeOrExclude) const;
void ResetForm();
diff --git a/fpdfsdk/cpdfsdk_interactiveform.cpp b/fpdfsdk/cpdfsdk_interactiveform.cpp
index 3ed3a7d..8a4bcea 100644
--- a/fpdfsdk/cpdfsdk_interactiveform.cpp
+++ b/fpdfsdk/cpdfsdk_interactiveform.cpp
@@ -458,7 +458,7 @@
const std::vector<CPDF_FormField*>& fields,
bool bIncludeOrExclude) {
std::unique_ptr<CFDF_Document> pFDF = m_pInteractiveForm->ExportToFDF(
- m_pFormFillEnv->GetFilePath(), fields, bIncludeOrExclude, false);
+ m_pFormFillEnv->GetFilePath(), fields, bIncludeOrExclude);
return pFDF ? pFDF->WriteToString() : ByteString();
}
@@ -468,7 +468,7 @@
return false;
std::unique_ptr<CFDF_Document> pFDFDoc =
- m_pInteractiveForm->ExportToFDF(m_pFormFillEnv->GetFilePath(), false);
+ m_pInteractiveForm->ExportToFDF(m_pFormFillEnv->GetFilePath());
if (!pFDFDoc)
return false;
@@ -484,7 +484,7 @@
ByteString CPDFSDK_InteractiveForm::ExportFormToFDFTextBuf() {
std::unique_ptr<CFDF_Document> pFDF =
- m_pInteractiveForm->ExportToFDF(m_pFormFillEnv->GetFilePath(), false);
+ m_pInteractiveForm->ExportToFDF(m_pFormFillEnv->GetFilePath());
return pFDF ? pFDF->WriteToString() : ByteString();
}