summaryrefslogtreecommitdiff
path: root/fpdfsdk/cpdfsdk_interform.cpp
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-10-12 11:56:23 -0700
committerCommit bot <commit-bot@chromium.org>2016-10-12 11:56:23 -0700
commit7cbe68e34257b460bfa3baf0ea68fd6d50e1bc77 (patch)
treecc439488801d7a3e72a56ecd88df600e12b8a948 /fpdfsdk/cpdfsdk_interform.cpp
parent7cc6a32693a07210e036a8d7131232231ec0fdb3 (diff)
downloadpdfium-7cbe68e34257b460bfa3baf0ea68fd6d50e1bc77.tar.xz
Merge CPDFSDK_Document into CPDFSDK_FormFillEnvironment
This CL merges the CPDFSDK_Document and CPDFSDK_FormFillEnvironment classes as they always existed and always pointed at each other. Review-Url: https://codereview.chromium.org/2410893002
Diffstat (limited to 'fpdfsdk/cpdfsdk_interform.cpp')
-rw-r--r--fpdfsdk/cpdfsdk_interform.cpp25
1 files changed, 11 insertions, 14 deletions
diff --git a/fpdfsdk/cpdfsdk_interform.cpp b/fpdfsdk/cpdfsdk_interform.cpp
index 005079dda9..81836f7923 100644
--- a/fpdfsdk/cpdfsdk_interform.cpp
+++ b/fpdfsdk/cpdfsdk_interform.cpp
@@ -22,7 +22,6 @@
#include "core/fxge/cfx_renderdevice.h"
#include "fpdfsdk/cba_annotiterator.h"
#include "fpdfsdk/cpdfsdk_annot.h"
-#include "fpdfsdk/cpdfsdk_document.h"
#include "fpdfsdk/cpdfsdk_formfillenvironment.h"
#include "fpdfsdk/cpdfsdk_pageview.h"
#include "fpdfsdk/cpdfsdk_widget.h"
@@ -48,8 +47,7 @@
CPDFSDK_InterForm::CPDFSDK_InterForm(CPDFSDK_FormFillEnvironment* pFormFillEnv)
: m_pFormFillEnv(pFormFillEnv),
- m_pInterForm(new CPDF_InterForm(
- m_pFormFillEnv->GetSDKDocument()->GetPDFDocument())),
+ m_pInterForm(new CPDF_InterForm(m_pFormFillEnv->GetPDFDocument())),
#ifdef PDF_ENABLE_XFA
m_bXfaCalculate(TRUE),
m_bXfaValidationsEnabled(TRUE),
@@ -99,19 +97,19 @@ CPDFSDK_Widget* CPDFSDK_InterForm::GetWidget(CPDF_FormControl* pControl,
return nullptr;
CPDF_Dictionary* pControlDict = pControl->GetWidget();
- CPDF_Document* pDocument = m_pFormFillEnv->GetSDKDocument()->GetPDFDocument();
+ CPDF_Document* pDocument = m_pFormFillEnv->GetPDFDocument();
CPDFSDK_PageView* pPage = nullptr;
if (CPDF_Dictionary* pPageDict = pControlDict->GetDictFor("P")) {
int nPageIndex = pDocument->GetPageIndex(pPageDict->GetObjNum());
if (nPageIndex >= 0)
- pPage = m_pFormFillEnv->GetSDKDocument()->GetPageView(nPageIndex);
+ pPage = m_pFormFillEnv->GetPageView(nPageIndex);
}
if (!pPage) {
int nPageIndex = GetPageIndexByAnnotDict(pDocument, pControlDict);
if (nPageIndex >= 0)
- pPage = m_pFormFillEnv->GetSDKDocument()->GetPageView(nPageIndex);
+ pPage = m_pFormFillEnv->GetPageView(nPageIndex);
}
if (!pPage)
@@ -336,8 +334,7 @@ void CPDFSDK_InterForm::UpdateField(CPDF_FormField* pFormField) {
if (CPDFSDK_Widget* pWidget = GetWidget(pFormCtrl, false)) {
UnderlyingPageType* pPage = pWidget->GetUnderlyingPage();
- CPDFSDK_PageView* pPageView =
- m_pFormFillEnv->GetSDKDocument()->GetPageView(pPage, false);
+ CPDFSDK_PageView* pPageView = m_pFormFillEnv->GetPageView(pPage, false);
FX_RECT rcBBox = m_pFormFillEnv->GetInteractiveFormFiller()->GetViewBBox(
pPageView, pWidget);
@@ -513,9 +510,9 @@ FX_BOOL CPDFSDK_InterForm::ExportFieldsToFDFTextBuf(
const std::vector<CPDF_FormField*>& fields,
bool bIncludeOrExclude,
CFX_ByteTextBuf& textBuf) {
- std::unique_ptr<CFDF_Document> pFDF(m_pInterForm->ExportToFDF(
- m_pFormFillEnv->GetSDKDocument()->GetPath().AsStringC(), fields,
- bIncludeOrExclude, false));
+ std::unique_ptr<CFDF_Document> pFDF(
+ m_pInterForm->ExportToFDF(m_pFormFillEnv->JS_docGetFilePath().AsStringC(),
+ fields, bIncludeOrExclude, false));
return pFDF ? pFDF->WriteBuf(textBuf) : FALSE;
}
@@ -529,10 +526,10 @@ FX_BOOL CPDFSDK_InterForm::SubmitForm(const CFX_WideString& sDestination,
if (sDestination.IsEmpty())
return FALSE;
- if (!m_pFormFillEnv || !m_pFormFillEnv->GetSDKDocument() || !m_pInterForm)
+ if (!m_pFormFillEnv || !m_pInterForm)
return FALSE;
- CFX_WideString wsPDFFilePath = m_pFormFillEnv->GetSDKDocument()->GetPath();
+ CFX_WideString wsPDFFilePath = m_pFormFillEnv->JS_docGetFilePath();
CFDF_Document* pFDFDoc =
m_pInterForm->ExportToFDF(wsPDFFilePath.AsStringC(), false);
if (!pFDFDoc)
@@ -560,7 +557,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_pFormFillEnv->GetSDKDocument()->GetPath().AsStringC(), false);
+ m_pFormFillEnv->JS_docGetFilePath().AsStringC(), false);
if (!pFDF)
return FALSE;