diff options
Diffstat (limited to 'fpdfsdk')
-rw-r--r-- | fpdfsdk/cpdfsdk_formfillenvironment.cpp | 22 | ||||
-rw-r--r-- | fpdfsdk/cpdfsdk_formfillenvironment.h | 20 | ||||
-rw-r--r-- | fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp | 13 |
3 files changed, 28 insertions, 27 deletions
diff --git a/fpdfsdk/cpdfsdk_formfillenvironment.cpp b/fpdfsdk/cpdfsdk_formfillenvironment.cpp index cb5509681a..8c5025ed88 100644 --- a/fpdfsdk/cpdfsdk_formfillenvironment.cpp +++ b/fpdfsdk/cpdfsdk_formfillenvironment.cpp @@ -233,7 +233,7 @@ CPDFSDK_FormFillEnvironment::GetInteractiveFormFiller() { return m_pFormFiller.get(); } -void CPDFSDK_FormFillEnvironment::Invalidate(FPDF_PAGE page, +void CPDFSDK_FormFillEnvironment::Invalidate(UnderlyingPageType* page, const FX_RECT& rect) { if (m_pInfo && m_pInfo->FFI_Invalidate) { m_pInfo->FFI_Invalidate(m_pInfo, page, rect.left, rect.top, rect.right, @@ -242,7 +242,7 @@ void CPDFSDK_FormFillEnvironment::Invalidate(FPDF_PAGE page, } void CPDFSDK_FormFillEnvironment::OutputSelectedRect( - FPDF_PAGE page, + UnderlyingPageType* page, const CFX_FloatRect& rect) { if (m_pInfo && m_pInfo->FFI_OutputSelectedRect) { m_pInfo->FFI_OutputSelectedRect(m_pInfo, page, rect.left, rect.top, @@ -301,14 +301,15 @@ bool CPDFSDK_FormFillEnvironment::IsALTKeyDown(uint32_t nFlag) const { return (nFlag & FWL_EVENTFLAG_AltKey) != 0; } -FPDF_PAGE CPDFSDK_FormFillEnvironment::GetPage(FPDF_DOCUMENT document, +FPDF_PAGE CPDFSDK_FormFillEnvironment::GetPage(UnderlyingDocumentType* document, int nPageIndex) { if (m_pInfo && m_pInfo->FFI_GetPage) return m_pInfo->FFI_GetPage(m_pInfo, document, nPageIndex); return nullptr; } -FPDF_PAGE CPDFSDK_FormFillEnvironment::GetCurrentPage(FPDF_DOCUMENT document) { +FPDF_PAGE CPDFSDK_FormFillEnvironment::GetCurrentPage( + UnderlyingDocumentType* document) { if (m_pInfo && m_pInfo->FFI_GetCurrentPage) return m_pInfo->FFI_GetCurrentPage(m_pInfo, document); return nullptr; @@ -343,7 +344,7 @@ void CPDFSDK_FormFillEnvironment::DoGoToAction(int nPageIndex, } #ifdef PDF_ENABLE_XFA -void CPDFSDK_FormFillEnvironment::DisplayCaret(FPDF_PAGE page, +void CPDFSDK_FormFillEnvironment::DisplayCaret(CPDFXFA_Page* page, FPDF_BOOL bVisible, double left, double top, @@ -355,13 +356,14 @@ void CPDFSDK_FormFillEnvironment::DisplayCaret(FPDF_PAGE page, } } -int CPDFSDK_FormFillEnvironment::GetCurrentPageIndex(FPDF_DOCUMENT document) { +int CPDFSDK_FormFillEnvironment::GetCurrentPageIndex( + CPDFXFA_Context* document) { if (!m_pInfo || !m_pInfo->FFI_GetCurrentPageIndex) return -1; return m_pInfo->FFI_GetCurrentPageIndex(m_pInfo, document); } -void CPDFSDK_FormFillEnvironment::SetCurrentPage(FPDF_DOCUMENT document, +void CPDFSDK_FormFillEnvironment::SetCurrentPage(CPDFXFA_Context* document, int iCurPage) { if (m_pInfo && m_pInfo->FFI_SetCurrentPage) m_pInfo->FFI_SetCurrentPage(m_pInfo, document, iCurPage); @@ -385,7 +387,7 @@ CFX_WideString CPDFSDK_FormFillEnvironment::GetPlatform() { nActualLen / sizeof(uint16_t)); } -void CPDFSDK_FormFillEnvironment::GotoURL(FPDF_DOCUMENT document, +void CPDFSDK_FormFillEnvironment::GotoURL(CPDFXFA_Context* document, const CFX_WideStringC& wsURL) { if (!m_pInfo || !m_pInfo->FFI_GotoURL) return; @@ -396,7 +398,7 @@ void CPDFSDK_FormFillEnvironment::GotoURL(FPDF_DOCUMENT document, bsTo.ReleaseBuffer(); } -void CPDFSDK_FormFillEnvironment::GetPageViewRect(FPDF_PAGE page, +void CPDFSDK_FormFillEnvironment::GetPageViewRect(CPDFXFA_Page* page, FS_RECTF& dstRect) { if (!m_pInfo || !m_pInfo->FFI_GetPageViewRect) return; @@ -413,7 +415,7 @@ void CPDFSDK_FormFillEnvironment::GetPageViewRect(FPDF_PAGE page, dstRect.right = static_cast<float>(right); } -bool CPDFSDK_FormFillEnvironment::PopupMenu(FPDF_PAGE page, +bool CPDFSDK_FormFillEnvironment::PopupMenu(CPDFXFA_Page* page, FPDF_WIDGET hWidget, int menuFlag, CFX_PointF pt) { diff --git a/fpdfsdk/cpdfsdk_formfillenvironment.h b/fpdfsdk/cpdfsdk_formfillenvironment.h index 0462426e0f..91141e57c6 100644 --- a/fpdfsdk/cpdfsdk_formfillenvironment.h +++ b/fpdfsdk/cpdfsdk_formfillenvironment.h @@ -79,8 +79,8 @@ class CPDFSDK_FormFillEnvironment void ProcJavascriptFun(); bool ProcOpenAction(); - void Invalidate(FPDF_PAGE page, const FX_RECT& rect); - void OutputSelectedRect(FPDF_PAGE page, const CFX_FloatRect& rect); + void Invalidate(UnderlyingPageType* page, const FX_RECT& rect); + void OutputSelectedRect(UnderlyingPageType* page, const CFX_FloatRect& rect); void SetCursor(int nCursorType); int SetTimer(int uElapse, TimerCallback lpTimerFunc); @@ -92,8 +92,8 @@ class CPDFSDK_FormFillEnvironment bool IsCTRLKeyDown(uint32_t nFlag) const; bool IsALTKeyDown(uint32_t nFlag) const; - FPDF_PAGE GetPage(FPDF_DOCUMENT document, int nPageIndex); - FPDF_PAGE GetCurrentPage(FPDF_DOCUMENT document); + FPDF_PAGE GetPage(UnderlyingDocumentType* document, int nPageIndex); + FPDF_PAGE GetCurrentPage(UnderlyingDocumentType* document); void ExecuteNamedAction(const char* namedAction); void OnSetFieldInputFocus(FPDF_WIDESTRING focusText, @@ -119,22 +119,22 @@ class CPDFSDK_FormFillEnvironment int GetPageViewCount() const { return m_PageMap.size(); } - void DisplayCaret(FPDF_PAGE page, + void DisplayCaret(CPDFXFA_Page* page, FPDF_BOOL bVisible, double left, double top, double right, double bottom); - int GetCurrentPageIndex(FPDF_DOCUMENT document); - void SetCurrentPage(FPDF_DOCUMENT document, int iCurPage); + int GetCurrentPageIndex(CPDFXFA_Context* document); + void SetCurrentPage(CPDFXFA_Context* document, int iCurPage); // TODO(dsinclair): This should probably change to PDFium? CFX_WideString FFI_GetAppName() const { return CFX_WideString(L"Acrobat"); } CFX_WideString GetPlatform(); - void GotoURL(FPDF_DOCUMENT document, const CFX_WideStringC& wsURL); - void GetPageViewRect(FPDF_PAGE page, FS_RECTF& dstRect); - bool PopupMenu(FPDF_PAGE page, + void GotoURL(CPDFXFA_Context* document, const CFX_WideStringC& wsURL); + void GetPageViewRect(CPDFXFA_Page* page, FS_RECTF& dstRect); + bool PopupMenu(CPDFXFA_Page* page, FPDF_WIDGET hWidget, int menuFlag, CFX_PointF pt); diff --git a/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp b/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp index 4695c64ce1..28badc4144 100644 --- a/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp +++ b/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp @@ -66,7 +66,7 @@ void CPDFXFA_DocEnvironment::InvalidateRect(CXFA_FFPageView* pPageView, if (!pFormFillEnv) return; - pFormFillEnv->Invalidate(static_cast<FPDF_PAGE>(pPage.Get()), + pFormFillEnv->Invalidate(pPage.Get(), CFX_FloatRect::FromCFXRectF(rt).ToFxRect()); } @@ -98,9 +98,8 @@ void CPDFXFA_DocEnvironment::DisplayCaret(CXFA_FFWidget* hWidget, return; CFX_FloatRect rcCaret = CFX_FloatRect::FromCFXRectF(*pRtAnchor); - pFormFillEnv->DisplayCaret(static_cast<FPDF_PAGE>(pPage.Get()), bVisible, - rcCaret.left, rcCaret.top, rcCaret.right, - rcCaret.bottom); + pFormFillEnv->DisplayCaret(pPage.Get(), bVisible, rcCaret.left, rcCaret.top, + rcCaret.right, rcCaret.bottom); } bool CPDFXFA_DocEnvironment::GetPopupPos(CXFA_FFWidget* hWidget, @@ -344,7 +343,7 @@ int32_t CPDFXFA_DocEnvironment::GetCurrentPage(CXFA_FFDoc* hDoc) { if (!pFormFillEnv) return -1; - return pFormFillEnv->GetCurrentPageIndex(this); + return pFormFillEnv->GetCurrentPageIndex(m_pContext.Get()); } void CPDFXFA_DocEnvironment::SetCurrentPage(CXFA_FFDoc* hDoc, @@ -358,7 +357,7 @@ void CPDFXFA_DocEnvironment::SetCurrentPage(CXFA_FFDoc* hDoc, CPDFSDK_FormFillEnvironment* pFormFillEnv = m_pContext->GetFormFillEnv(); if (!pFormFillEnv) return; - pFormFillEnv->SetCurrentPage(this, iCurPage); + pFormFillEnv->SetCurrentPage(m_pContext.Get(), iCurPage); } bool CPDFXFA_DocEnvironment::IsCalculationsEnabled(CXFA_FFDoc* hDoc) { @@ -518,7 +517,7 @@ void CPDFXFA_DocEnvironment::GotoURL(CXFA_FFDoc* hDoc, return; CFX_WideStringC str(bsURL.c_str()); - pFormFillEnv->GotoURL(this, str); + pFormFillEnv->GotoURL(m_pContext.Get(), str); } bool CPDFXFA_DocEnvironment::IsValidationsEnabled(CXFA_FFDoc* hDoc) { |