summaryrefslogtreecommitdiff
path: root/fpdfsdk
diff options
context:
space:
mode:
authorthestig <thestig@chromium.org>2016-09-28 14:14:26 -0700
committerCommit bot <commit-bot@chromium.org>2016-09-28 14:14:26 -0700
commit7c292e0f67e0f0bf4062e0b2adf244e17d7dacb5 (patch)
treedeb84d05a8eb6d4f194f608ebbb004842b57623b /fpdfsdk
parent8c41b1bf9fb7dd525f3a6b81d38f61d83500894d (diff)
downloadpdfium-7c292e0f67e0f0bf4062e0b2adf244e17d7dacb5.tar.xz
Remove dead code from CPDF_InterForm.
Remove default arguments. Review-Url: https://codereview.chromium.org/2380753003
Diffstat (limited to 'fpdfsdk')
-rw-r--r--fpdfsdk/cpdfsdk_interform.cpp8
-rw-r--r--fpdfsdk/cpdfsdk_pageview.cpp7
-rw-r--r--fpdfsdk/javascript/Document.cpp7
3 files changed, 13 insertions, 9 deletions
diff --git a/fpdfsdk/cpdfsdk_interform.cpp b/fpdfsdk/cpdfsdk_interform.cpp
index ce6206a3f7..01889d5947 100644
--- a/fpdfsdk/cpdfsdk_interform.cpp
+++ b/fpdfsdk/cpdfsdk_interform.cpp
@@ -8,6 +8,7 @@
#include <algorithm>
#include <memory>
+#include <vector>
#include "core/fpdfapi/fpdf_page/include/cpdf_page.h"
#include "core/fpdfapi/fpdf_parser/include/cfdf_document.h"
@@ -524,7 +525,7 @@ FX_BOOL CPDFSDK_InterForm::ExportFieldsToFDFTextBuf(
bool bIncludeOrExclude,
CFX_ByteTextBuf& textBuf) {
std::unique_ptr<CFDF_Document> pFDF(m_pInterForm->ExportToFDF(
- m_pDocument->GetPath().AsStringC(), fields, bIncludeOrExclude));
+ m_pDocument->GetPath().AsStringC(), fields, bIncludeOrExclude, false));
return pFDF ? pFDF->WriteBuf(textBuf) : FALSE;
}
@@ -543,7 +544,8 @@ FX_BOOL CPDFSDK_InterForm::SubmitForm(const CFX_WideString& sDestination,
CPDFSDK_Environment* pEnv = m_pDocument->GetEnv();
CFX_WideString wsPDFFilePath = m_pDocument->GetPath();
- CFDF_Document* pFDFDoc = m_pInterForm->ExportToFDF(wsPDFFilePath.AsStringC());
+ CFDF_Document* pFDFDoc =
+ m_pInterForm->ExportToFDF(wsPDFFilePath.AsStringC(), false);
if (!pFDFDoc)
return FALSE;
@@ -569,7 +571,7 @@ FX_BOOL CPDFSDK_InterForm::SubmitForm(const CFX_WideString& sDestination,
FX_BOOL CPDFSDK_InterForm::ExportFormToFDFTextBuf(CFX_ByteTextBuf& textBuf) {
CFDF_Document* pFDF =
- m_pInterForm->ExportToFDF(m_pDocument->GetPath().AsStringC());
+ m_pInterForm->ExportToFDF(m_pDocument->GetPath().AsStringC(), false);
if (!pFDF)
return FALSE;
diff --git a/fpdfsdk/cpdfsdk_pageview.cpp b/fpdfsdk/cpdfsdk_pageview.cpp
index 900ea48670..f546e385e6 100644
--- a/fpdfsdk/cpdfsdk_pageview.cpp
+++ b/fpdfsdk/cpdfsdk_pageview.cpp
@@ -6,6 +6,9 @@
#include "fpdfsdk/include/cpdfsdk_pageview.h"
+#include <memory>
+#include <vector>
+
#include "core/fpdfapi/fpdf_parser/include/cpdf_document.h"
#include "core/fpdfapi/fpdf_render/include/cpdf_renderoptions.h"
#include "core/fpdfdoc/include/cpdf_annotlist.h"
@@ -488,9 +491,9 @@ void CPDFSDK_PageView::LoadFXAnnots() {
CPDF_Page* pPage = GetPDFPage();
ASSERT(pPage);
- FX_BOOL bUpdateAP = CPDF_InterForm::IsUpdateAPEnabled();
+ bool bUpdateAP = CPDF_InterForm::IsUpdateAPEnabled();
// Disable the default AP construction.
- CPDF_InterForm::SetUpdateAP(FALSE);
+ CPDF_InterForm::SetUpdateAP(false);
m_pAnnotList.reset(new CPDF_AnnotList(pPage));
CPDF_InterForm::SetUpdateAP(bUpdateAP);
diff --git a/fpdfsdk/javascript/Document.cpp b/fpdfsdk/javascript/Document.cpp
index ea225f095d..b7b03b2174 100644
--- a/fpdfsdk/javascript/Document.cpp
+++ b/fpdfsdk/javascript/Document.cpp
@@ -6,6 +6,7 @@
#include "fpdfsdk/javascript/Document.h"
+#include <utility>
#include <vector>
#include "core/fpdfapi/fpdf_font/include/cpdf_font.h"
@@ -174,7 +175,7 @@ FX_BOOL Document::numFields(IJS_Context* cc,
}
CPDFSDK_InterForm* pInterForm = m_pDocument->GetInterForm();
CPDF_InterForm* pPDFForm = pInterForm->GetInterForm();
- vp << (int)pPDFForm->CountFields();
+ vp << static_cast<int>(pPDFForm->CountFields(CFX_WideString()));
return TRUE;
}
@@ -337,7 +338,7 @@ FX_BOOL Document::getNthFieldName(IJS_Context* cc,
}
CPDFSDK_InterForm* pInterForm = m_pDocument->GetInterForm();
CPDF_InterForm* pPDFForm = pInterForm->GetInterForm();
- CPDF_FormField* pField = pPDFForm->GetField(nIndex);
+ CPDF_FormField* pField = pPDFForm->GetField(nIndex, CFX_WideString());
if (!pField)
return FALSE;
@@ -616,7 +617,6 @@ FX_BOOL Document::submitForm(IJS_Context* cc,
const std::vector<CJS_Value>& params,
CJS_Value& vRet,
CFX_WideString& sError) {
-
int nSize = params.size();
if (nSize < 1) {
sError = JSGetStringFromID(IDS_STRING_JSPARAMERROR);
@@ -1234,7 +1234,6 @@ FX_BOOL Document::addIcon(IJS_Context* cc,
const std::vector<CJS_Value>& params,
CJS_Value& vRet,
CFX_WideString& sError) {
-
if (params.size() != 2) {
sError = JSGetStringFromID(IDS_STRING_JSPARAMERROR);
return FALSE;