From 55dd8546ebc365b3778b40ba9d82879f581503e1 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Tue, 24 Nov 2015 13:31:52 -0800 Subject: Add "Underlying types" to master. Change some master code to line up better with XFA, so that the XFA changes are additive when possible, rather than replacements. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1468253005 . --- fpdfsdk/src/javascript/Document.cpp | 4 ++-- fpdfsdk/src/javascript/Field.cpp | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) (limited to 'fpdfsdk/src/javascript') diff --git a/fpdfsdk/src/javascript/Document.cpp b/fpdfsdk/src/javascript/Document.cpp index 9e352a1ab6..1fa88f9b12 100644 --- a/fpdfsdk/src/javascript/Document.cpp +++ b/fpdfsdk/src/javascript/Document.cpp @@ -536,7 +536,7 @@ FX_BOOL Document::removeField(IJS_Context* cc, CFX_RectArray aRefresh; aRefresh.Add(rcAnnot); - CPDF_Page* pPage = pWidget->GetPDFPage(); + UnderlyingPageType* pPage = pWidget->GetUnderlyingPage(); ASSERT(pPage); CPDFSDK_PageView* pPageView = m_pDocument->GetPageView(pPage); @@ -1019,7 +1019,7 @@ FX_BOOL Document::subject(IJS_Context* cc, FX_BOOL Document::title(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { - if (m_pDocument == NULL || m_pDocument->GetPDFDocument() == NULL) + if (!m_pDocument || !m_pDocument->GetUnderlyingDocument()) return FALSE; CPDF_Dictionary* pDictionary = m_pDocument->GetPDFDocument()->GetInfo(); diff --git a/fpdfsdk/src/javascript/Field.cpp b/fpdfsdk/src/javascript/Field.cpp index 39d67d00dc..39e15e9868 100644 --- a/fpdfsdk/src/javascript/Field.cpp +++ b/fpdfsdk/src/javascript/Field.cpp @@ -3397,9 +3397,8 @@ FX_BOOL Field::setFocus(IJS_Context* cc, pWidget = pInterForm->GetWidget(pFormField->GetControl(0)); } else { CPDFDoc_Environment* pEnv = m_pDocument->GetEnv(); - ASSERT(pEnv); - CPDF_Page* pPage = - (CPDF_Page*)pEnv->FFI_GetCurrentPage(m_pDocument->GetDocument()); + UnderlyingPageType* pPage = UnderlyingFromFPDFPage( + pEnv->FFI_GetCurrentPage(m_pDocument->GetUnderlyingDocument())); if (!pPage) return FALSE; if (CPDFSDK_PageView* pCurPageView = m_pDocument->GetPageView(pPage)) { -- cgit v1.2.3