From cf3816187f6cbee5569a5924dc1ce1074ffcad7a Mon Sep 17 00:00:00 2001 From: dsinclair Date: Tue, 11 Oct 2016 14:11:16 -0700 Subject: Remove remaining CPDFSDK_Document references Review-Url: https://codereview.chromium.org/2399213002 --- fpdfsdk/cpdfsdk_widgethandler.cpp | 3 +-- fpdfsdk/cpdfsdk_xfawidgethandler.cpp | 3 +-- fpdfsdk/formfiller/cffl_formfiller.cpp | 7 +++---- fpdfsdk/formfiller/cffl_interactiveformfiller.cpp | 10 ++++------ fpdfsdk/javascript/Document.cpp | 4 ---- 5 files changed, 9 insertions(+), 18 deletions(-) diff --git a/fpdfsdk/cpdfsdk_widgethandler.cpp b/fpdfsdk/cpdfsdk_widgethandler.cpp index 1621181fc7..e294c4f204 100644 --- a/fpdfsdk/cpdfsdk_widgethandler.cpp +++ b/fpdfsdk/cpdfsdk_widgethandler.cpp @@ -54,8 +54,7 @@ FX_BOOL CPDFSDK_WidgetHandler::CanAnswer(CPDFSDK_Annot* pAnnot) { CPDFSDK_Annot* CPDFSDK_WidgetHandler::NewAnnot(CPDF_Annot* pAnnot, CPDFSDK_PageView* pPage) { - CPDFSDK_Document* pSDKDoc = m_pEnv->GetSDKDocument(); - CPDFSDK_InterForm* pInterForm = pSDKDoc->GetInterForm(); + CPDFSDK_InterForm* pInterForm = m_pEnv->GetSDKDocument()->GetInterForm(); CPDF_FormControl* pCtrl = CPDFSDK_Widget::GetFormControl( pInterForm->GetInterForm(), pAnnot->GetAnnotDict()); if (!pCtrl) diff --git a/fpdfsdk/cpdfsdk_xfawidgethandler.cpp b/fpdfsdk/cpdfsdk_xfawidgethandler.cpp index b936bc4c66..8551445ef1 100644 --- a/fpdfsdk/cpdfsdk_xfawidgethandler.cpp +++ b/fpdfsdk/cpdfsdk_xfawidgethandler.cpp @@ -39,8 +39,7 @@ CPDFSDK_Annot* CPDFSDK_XFAWidgetHandler::NewAnnot(CPDF_Annot* pAnnot, CPDFSDK_Annot* CPDFSDK_XFAWidgetHandler::NewAnnot(CXFA_FFWidget* pAnnot, CPDFSDK_PageView* pPage) { - CPDFSDK_Document* pSDKDoc = m_pEnv->GetSDKDocument(); - CPDFSDK_InterForm* pInterForm = pSDKDoc->GetInterForm(); + CPDFSDK_InterForm* pInterForm = m_pEnv->GetSDKDocument()->GetInterForm(); CPDFSDK_XFAWidget* pWidget = new CPDFSDK_XFAWidget(pAnnot, pPage, pInterForm); pInterForm->AddXFAMap(pAnnot, pWidget); return pWidget; diff --git a/fpdfsdk/formfiller/cffl_formfiller.cpp b/fpdfsdk/formfiller/cffl_formfiller.cpp index 6369b45d7e..e2e99c9a22 100644 --- a/fpdfsdk/formfiller/cffl_formfiller.cpp +++ b/fpdfsdk/formfiller/cffl_formfiller.cpp @@ -251,8 +251,8 @@ FX_BOOL CFFL_FormFiller::OnChar(CPDFSDK_Annot* pAnnot, void CFFL_FormFiller::SetFocusForAnnot(CPDFSDK_Annot* pAnnot, uint32_t nFlag) { CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot; UnderlyingPageType* pPage = pWidget->GetUnderlyingPage(); - CPDFSDK_Document* pDoc = m_pEnv->GetSDKDocument(); - CPDFSDK_PageView* pPageView = pDoc->GetPageView(pPage, true); + CPDFSDK_PageView* pPageView = + m_pEnv->GetSDKDocument()->GetPageView(pPage, true); if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, TRUE)) pWnd->SetFocus(); @@ -458,8 +458,7 @@ CFX_FloatRect CFFL_FormFiller::GetPDFWindowRect() const { CPDFSDK_PageView* CFFL_FormFiller::GetCurPageView(bool renew) { UnderlyingPageType* pPage = m_pAnnot->GetUnderlyingPage(); - CPDFSDK_Document* pSDKDoc = m_pEnv->GetSDKDocument(); - return pSDKDoc ? pSDKDoc->GetPageView(pPage, renew) : nullptr; + return m_pEnv ? m_pEnv->GetSDKDocument()->GetPageView(pPage, renew) : nullptr; } CFX_FloatRect CFFL_FormFiller::GetFocusBox(CPDFSDK_PageView* pPageView) { diff --git a/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp b/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp index c62de9bfb5..27ad4faeb6 100644 --- a/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp +++ b/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp @@ -67,8 +67,7 @@ void CFFL_InteractiveFormFiller::OnDraw(CPDFSDK_PageView* pPageView, pFormFiller->OnDraw(pPageView, pAnnot, pDevice, pUser2Device); pAnnot->GetPDFPage(); - CPDFSDK_Document* pDocument = m_pEnv->GetSDKDocument(); - if (pDocument->GetFocusAnnot() == pAnnot) { + if (m_pEnv->GetSDKDocument()->GetFocusAnnot() == pAnnot) { CFX_FloatRect rcFocus = pFormFiller->GetFocusBox(pPageView); if (!rcFocus.IsEmpty()) { CFX_PathData path; @@ -239,7 +238,6 @@ FX_BOOL CFFL_InteractiveFormFiller::OnLButtonUp( const CFX_FloatPoint& point) { ASSERT((*pAnnot)->GetPDFAnnot()->GetSubtype() == CPDF_Annot::Subtype::WIDGET); CPDFSDK_Widget* pWidget = static_cast(pAnnot->Get()); - CPDFSDK_Document* pDocument = m_pEnv->GetSDKDocument(); switch (pWidget->GetFieldType()) { case FIELDTYPE_PUSHBUTTON: @@ -247,10 +245,10 @@ FX_BOOL CFFL_InteractiveFormFiller::OnLButtonUp( case FIELDTYPE_RADIOBUTTON: if (GetViewBBox(pPageView, pAnnot->Get()) .Contains((int)point.x, (int)point.y)) - pDocument->SetFocusAnnot(pAnnot); + m_pEnv->GetSDKDocument()->SetFocusAnnot(pAnnot); break; default: - pDocument->SetFocusAnnot(pAnnot); + m_pEnv->GetSDKDocument()->SetFocusAnnot(pAnnot); break; } @@ -258,7 +256,7 @@ FX_BOOL CFFL_InteractiveFormFiller::OnLButtonUp( if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot->Get(), FALSE)) bRet = pFormFiller->OnLButtonUp(pPageView, pAnnot->Get(), nFlags, point); - if (pDocument->GetFocusAnnot() == pAnnot->Get()) { + if (m_pEnv->GetSDKDocument()->GetFocusAnnot() == pAnnot->Get()) { FX_BOOL bExit = FALSE; FX_BOOL bReset = FALSE; OnButtonUp(pAnnot, pPageView, bReset, bExit, nFlags); diff --git a/fpdfsdk/javascript/Document.cpp b/fpdfsdk/javascript/Document.cpp index ac94e10303..ed87c2dbba 100644 --- a/fpdfsdk/javascript/Document.cpp +++ b/fpdfsdk/javascript/Document.cpp @@ -376,10 +376,6 @@ FX_BOOL Document::importTextData(IJS_Context* cc, // exports the form data and mails the resulting fdf file as an attachment to // all recipients. // comment: need reader supports -// note: -// int CPDFSDK_Document::mailForm(FX_BOOL bUI,String cto,string ccc,string -// cbcc,string cSubject,string cms); - FX_BOOL Document::mailForm(IJS_Context* cc, const std::vector& params, CJS_Value& vRet, -- cgit v1.2.3