diff options
author | dsinclair <dsinclair@chromium.org> | 2016-10-12 12:05:44 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-10-12 12:05:44 -0700 |
commit | 8779fa8578cf3336ddd4473f833900aba2e595fb (patch) | |
tree | df330933cab06ed2c6a6b5b825680fd2b4731d57 /fpdfsdk | |
parent | 7cbe68e34257b460bfa3baf0ea68fd6d50e1bc77 (diff) | |
download | pdfium-8779fa8578cf3336ddd4473f833900aba2e595fb.tar.xz |
Cleanup env variable names
This CL cleans up any old m_pEnv variables to
be correctly named m_pFormFillEnv.
Review-Url: https://codereview.chromium.org/2412523002
Diffstat (limited to 'fpdfsdk')
28 files changed, 183 insertions, 174 deletions
diff --git a/fpdfsdk/cfx_systemhandler.cpp b/fpdfsdk/cfx_systemhandler.cpp index 62bad46ba0..541ef2ba64 100644 --- a/fpdfsdk/cfx_systemhandler.cpp +++ b/fpdfsdk/cfx_systemhandler.cpp @@ -57,7 +57,8 @@ void CFX_SystemHandler::InvalidateRect(CPDFSDK_Widget* widget, FX_RECT rect) { CFX_FloatRect rcPDF(left, bottom, right, top); rcPDF.Normalize(); - m_pEnv->Invalidate(pPage, rcPDF.left, rcPDF.top, rcPDF.right, rcPDF.bottom); + m_pFormFillEnv->Invalidate(pPage, rcPDF.left, rcPDF.top, rcPDF.right, + rcPDF.bottom); } void CFX_SystemHandler::OutputSelectedRect(CFFL_FormFiller* pFormFiller, @@ -74,19 +75,19 @@ void CFX_SystemHandler::OutputSelectedRect(CFFL_FormFiller* pFormFiller, UnderlyingPageType* pPage = pAnnot->GetUnderlyingPage(); ASSERT(pPage); - m_pEnv->OutputSelectedRect(pPage, ptA.x, ptB.y, ptB.x, ptA.y); + m_pFormFillEnv->OutputSelectedRect(pPage, ptA.x, ptB.y, ptB.x, ptA.y); } bool CFX_SystemHandler::IsSelectionImplemented() const { - if (!m_pEnv) + if (!m_pFormFillEnv) return false; - FPDF_FORMFILLINFO* pInfo = m_pEnv->GetFormFillInfo(); + FPDF_FORMFILLINFO* pInfo = m_pFormFillEnv->GetFormFillInfo(); return pInfo && pInfo->FFI_OutputSelectedRect; } void CFX_SystemHandler::SetCursor(int32_t nCursorType) { - m_pEnv->SetCursor(nCursorType); + m_pFormFillEnv->SetCursor(nCursorType); } bool CFX_SystemHandler::FindNativeTrueTypeFont(CFX_ByteString sFontFaceName) { @@ -126,21 +127,21 @@ CPDF_Font* CFX_SystemHandler::AddNativeTrueTypeFontToPDF( int32_t CFX_SystemHandler::SetTimer(int32_t uElapse, TimerCallback lpTimerFunc) { - return m_pEnv->SetTimer(uElapse, lpTimerFunc); + return m_pFormFillEnv->SetTimer(uElapse, lpTimerFunc); } void CFX_SystemHandler::KillTimer(int32_t nID) { - m_pEnv->KillTimer(nID); + m_pFormFillEnv->KillTimer(nID); } bool CFX_SystemHandler::IsSHIFTKeyDown(uint32_t nFlag) const { - return !!m_pEnv->IsSHIFTKeyDown(nFlag); + return !!m_pFormFillEnv->IsSHIFTKeyDown(nFlag); } bool CFX_SystemHandler::IsCTRLKeyDown(uint32_t nFlag) const { - return !!m_pEnv->IsCTRLKeyDown(nFlag); + return !!m_pFormFillEnv->IsCTRLKeyDown(nFlag); } bool CFX_SystemHandler::IsALTKeyDown(uint32_t nFlag) const { - return !!m_pEnv->IsALTKeyDown(nFlag); + return !!m_pFormFillEnv->IsALTKeyDown(nFlag); } diff --git a/fpdfsdk/cfx_systemhandler.h b/fpdfsdk/cfx_systemhandler.h index 9381d9e08c..82cfc531ca 100644 --- a/fpdfsdk/cfx_systemhandler.h +++ b/fpdfsdk/cfx_systemhandler.h @@ -49,8 +49,8 @@ class CPDFSDK_Widget; class CFX_SystemHandler { public: - explicit CFX_SystemHandler(CPDFSDK_FormFillEnvironment* pEnv) - : m_pEnv(pEnv) {} + explicit CFX_SystemHandler(CPDFSDK_FormFillEnvironment* pFormFillEnv) + : m_pFormFillEnv(pFormFillEnv) {} ~CFX_SystemHandler() {} void InvalidateRect(CPDFSDK_Widget* widget, FX_RECT rect); @@ -72,7 +72,7 @@ class CFX_SystemHandler { bool IsALTKeyDown(uint32_t nFlag) const; private: - CPDFSDK_FormFillEnvironment* const m_pEnv; + CPDFSDK_FormFillEnvironment* const m_pFormFillEnv; }; #endif // FPDFSDK_CFX_SYSTEMHANDLER_H_ diff --git a/fpdfsdk/cpdfsdk_annothandlermgr.cpp b/fpdfsdk/cpdfsdk_annothandlermgr.cpp index 5324c3fef3..098bf3d709 100644 --- a/fpdfsdk/cpdfsdk_annothandlermgr.cpp +++ b/fpdfsdk/cpdfsdk_annothandlermgr.cpp @@ -24,14 +24,14 @@ #endif // PDF_ENABLE_XFA CPDFSDK_AnnotHandlerMgr::CPDFSDK_AnnotHandlerMgr( - CPDFSDK_FormFillEnvironment* pEnv) + CPDFSDK_FormFillEnvironment* pFormFillEnv) : m_pBAAnnotHandler(new CPDFSDK_BAAnnotHandler()), - m_pWidgetHandler(new CPDFSDK_WidgetHandler(pEnv)), + m_pWidgetHandler(new CPDFSDK_WidgetHandler(pFormFillEnv)), #ifdef PDF_ENABLE_XFA - m_pXFAWidgetHandler(new CPDFSDK_XFAWidgetHandler(pEnv)), + m_pXFAWidgetHandler(new CPDFSDK_XFAWidgetHandler(pFormFillEnv)), #endif // PDF_ENABLE_XFA - m_pEnv(pEnv) { - m_pWidgetHandler->SetFormFiller(m_pEnv->GetInteractiveFormFiller()); + m_pFormFillEnv(pFormFillEnv) { + m_pWidgetHandler->SetFormFiller(m_pFormFillEnv->GetInteractiveFormFiller()); } CPDFSDK_AnnotHandlerMgr::~CPDFSDK_AnnotHandlerMgr() {} @@ -195,14 +195,15 @@ FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnChar(CPDFSDK_Annot* pAnnot, FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnKeyDown(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag) { - if (m_pEnv->IsCTRLKeyDown(nFlag) || m_pEnv->IsALTKeyDown(nFlag)) + if (m_pFormFillEnv->IsCTRLKeyDown(nFlag) || + m_pFormFillEnv->IsALTKeyDown(nFlag)) return GetAnnotHandler(pAnnot)->OnKeyDown(pAnnot, nKeyCode, nFlag); CPDFSDK_PageView* pPage = pAnnot->GetPageView(); CPDFSDK_Annot* pFocusAnnot = pPage->GetFocusAnnot(); if (pFocusAnnot && (nKeyCode == FWL_VKEY_Tab)) { CPDFSDK_Annot::ObservedPtr pNext( - GetNextAnnot(pFocusAnnot, !m_pEnv->IsSHIFTKeyDown(nFlag))); + GetNextAnnot(pFocusAnnot, !m_pFormFillEnv->IsSHIFTKeyDown(nFlag))); if (pNext && pNext.Get() != pFocusAnnot) { pPage->GetFormFillEnv()->SetFocusAnnot(&pNext); return TRUE; diff --git a/fpdfsdk/cpdfsdk_annothandlermgr.h b/fpdfsdk/cpdfsdk_annothandlermgr.h index 1bb63d62e8..4d96397588 100644 --- a/fpdfsdk/cpdfsdk_annothandlermgr.h +++ b/fpdfsdk/cpdfsdk_annothandlermgr.h @@ -112,7 +112,7 @@ class CPDFSDK_AnnotHandlerMgr { std::unique_ptr<CPDFSDK_XFAWidgetHandler> m_pXFAWidgetHandler; #endif // PDF_ENABLE_XFA - CPDFSDK_FormFillEnvironment* m_pEnv; + CPDFSDK_FormFillEnvironment* m_pFormFillEnv; }; #endif // FPDFSDK_CPDFSDK_ANNOTHANDLERMGR_H_ diff --git a/fpdfsdk/cpdfsdk_formfillenvironment.cpp b/fpdfsdk/cpdfsdk_formfillenvironment.cpp index 2beaadeb1a..b4624548e9 100644 --- a/fpdfsdk/cpdfsdk_formfillenvironment.cpp +++ b/fpdfsdk/cpdfsdk_formfillenvironment.cpp @@ -63,7 +63,7 @@ CPDFSDK_FormFillEnvironment::~CPDFSDK_FormFillEnvironment() { #ifdef PDF_ENABLE_XFA CPDFXFA_App* pProvider = CPDFXFA_App::GetInstance(); - if (pProvider->m_pEnvList.GetSize() == 0) + if (pProvider->m_pFormFillEnvList.GetSize() == 0) pProvider->SetJavaScriptInitialized(FALSE); #endif // PDF_ENABLE_XFA if (m_pInfo && m_pInfo->Release) diff --git a/fpdfsdk/cpdfsdk_widgethandler.cpp b/fpdfsdk/cpdfsdk_widgethandler.cpp index a75e6c7c49..daa97b4dba 100644 --- a/fpdfsdk/cpdfsdk_widgethandler.cpp +++ b/fpdfsdk/cpdfsdk_widgethandler.cpp @@ -23,8 +23,9 @@ #include "fpdfsdk/fpdfxfa/cpdfxfa_document.h" #endif // PDF_ENABLE_XFA -CPDFSDK_WidgetHandler::CPDFSDK_WidgetHandler(CPDFSDK_FormFillEnvironment* pEnv) - : m_pEnv(pEnv), m_pFormFiller(nullptr) {} +CPDFSDK_WidgetHandler::CPDFSDK_WidgetHandler( + CPDFSDK_FormFillEnvironment* pFormFillEnv) + : m_pFormFillEnv(pFormFillEnv), m_pFormFiller(nullptr) {} CPDFSDK_WidgetHandler::~CPDFSDK_WidgetHandler() {} @@ -53,7 +54,7 @@ FX_BOOL CPDFSDK_WidgetHandler::CanAnswer(CPDFSDK_Annot* pAnnot) { CPDFSDK_Annot* CPDFSDK_WidgetHandler::NewAnnot(CPDF_Annot* pAnnot, CPDFSDK_PageView* pPage) { - CPDFSDK_InterForm* pInterForm = m_pEnv->GetInterForm(); + CPDFSDK_InterForm* pInterForm = m_pFormFillEnv->GetInterForm(); CPDF_FormControl* pCtrl = CPDFSDK_Widget::GetFormControl( pInterForm->GetInterForm(), pAnnot->GetAnnotDict()); if (!pCtrl) diff --git a/fpdfsdk/cpdfsdk_widgethandler.h b/fpdfsdk/cpdfsdk_widgethandler.h index 5df6018bbf..0918a126c1 100644 --- a/fpdfsdk/cpdfsdk_widgethandler.h +++ b/fpdfsdk/cpdfsdk_widgethandler.h @@ -106,7 +106,7 @@ class CPDFSDK_WidgetHandler : public IPDFSDK_AnnotHandler { CFFL_InteractiveFormFiller* GetFormFiller() { return m_pFormFiller; } private: - CPDFSDK_FormFillEnvironment* m_pEnv; + CPDFSDK_FormFillEnvironment* m_pFormFillEnv; CFFL_InteractiveFormFiller* m_pFormFiller; }; diff --git a/fpdfsdk/cpdfsdk_xfawidgethandler.cpp b/fpdfsdk/cpdfsdk_xfawidgethandler.cpp index a7310a7638..0e232748b3 100644 --- a/fpdfsdk/cpdfsdk_xfawidgethandler.cpp +++ b/fpdfsdk/cpdfsdk_xfawidgethandler.cpp @@ -22,8 +22,8 @@ #include "xfa/fxgraphics/cfx_graphics.h" CPDFSDK_XFAWidgetHandler::CPDFSDK_XFAWidgetHandler( - CPDFSDK_FormFillEnvironment* pEnv) - : m_pEnv(pEnv) {} + CPDFSDK_FormFillEnvironment* pFormFillEnv) + : m_pFormFillEnv(pFormFillEnv) {} CPDFSDK_XFAWidgetHandler::~CPDFSDK_XFAWidgetHandler() {} @@ -38,7 +38,7 @@ CPDFSDK_Annot* CPDFSDK_XFAWidgetHandler::NewAnnot(CPDF_Annot* pAnnot, CPDFSDK_Annot* CPDFSDK_XFAWidgetHandler::NewAnnot(CXFA_FFWidget* pAnnot, CPDFSDK_PageView* pPage) { - CPDFSDK_InterForm* pInterForm = m_pEnv->GetInterForm(); + CPDFSDK_InterForm* pInterForm = m_pFormFillEnv->GetInterForm(); CPDFSDK_XFAWidget* pWidget = new CPDFSDK_XFAWidget(pAnnot, pPage, pInterForm); pInterForm->AddXFAMap(pAnnot, pWidget); return pWidget; diff --git a/fpdfsdk/cpdfsdk_xfawidgethandler.h b/fpdfsdk/cpdfsdk_xfawidgethandler.h index c395a05600..fdbcbcc7ee 100644 --- a/fpdfsdk/cpdfsdk_xfawidgethandler.h +++ b/fpdfsdk/cpdfsdk_xfawidgethandler.h @@ -96,7 +96,7 @@ class CPDFSDK_XFAWidgetHandler : public IPDFSDK_AnnotHandler { CXFA_FFWidgetHandler* GetXFAWidgetHandler(CPDFSDK_Annot* pAnnot); uint32_t GetFWLFlags(uint32_t dwFlag); - CPDFSDK_FormFillEnvironment* m_pEnv; + CPDFSDK_FormFillEnvironment* m_pFormFillEnv; }; #endif // FPDFSDK_CPDFSDK_XFAWIDGETHANDLER_H_ diff --git a/fpdfsdk/formfiller/cffl_checkbox.cpp b/fpdfsdk/formfiller/cffl_checkbox.cpp index 64981f053c..8b5a97c01d 100644 --- a/fpdfsdk/formfiller/cffl_checkbox.cpp +++ b/fpdfsdk/formfiller/cffl_checkbox.cpp @@ -49,8 +49,8 @@ FX_BOOL CFFL_CheckBox::OnChar(CPDFSDK_Annot* pAnnot, FX_BOOL bReset = FALSE; FX_BOOL bExit = FALSE; CPDFSDK_Annot::ObservedPtr pObserved(m_pWidget); - m_pEnv->GetInteractiveFormFiller()->OnButtonUp(&pObserved, pPageView, - bReset, bExit, nFlags); + m_pFormFillEnv->GetInteractiveFormFiller()->OnButtonUp( + &pObserved, pPageView, bReset, bExit, nFlags); if (!pObserved) { m_pWidget = nullptr; return TRUE; diff --git a/fpdfsdk/formfiller/cffl_combobox.cpp b/fpdfsdk/formfiller/cffl_combobox.cpp index a7dda07e3b..cb2fdf4d73 100644 --- a/fpdfsdk/formfiller/cffl_combobox.cpp +++ b/fpdfsdk/formfiller/cffl_combobox.cpp @@ -55,7 +55,8 @@ CPWL_Wnd* CFFL_ComboBox::NewPDFWindow(const PWL_CREATEPARAM& cp, pWnd->AttachFFLData(this); pWnd->Create(cp); - CFFL_InteractiveFormFiller* pFormFiller = m_pEnv->GetInteractiveFormFiller(); + CFFL_InteractiveFormFiller* pFormFiller = + m_pFormFillEnv->GetInteractiveFormFiller(); pWnd->SetFillerNotify(pFormFiller); int32_t nCurSel = m_pWidget->GetSelectedIndex(0); @@ -260,7 +261,7 @@ FX_BOOL CFFL_ComboBox::IsFieldFull(CPDFSDK_PageView* pPageView) { #endif // PDF_ENABLE_XFA void CFFL_ComboBox::OnSetFocus(CPWL_Wnd* pWnd) { - ASSERT(m_pEnv); + ASSERT(m_pFormFillEnv); if (pWnd->GetClassName() == PWL_CLASSNAME_EDIT) { CPWL_Edit* pEdit = (CPWL_Edit*)pWnd; @@ -272,7 +273,7 @@ void CFFL_ComboBox::OnSetFocus(CPWL_Wnd* pWnd) { int nCharacters = wsText.GetLength(); CFX_ByteString bsUTFText = wsText.UTF16LE_Encode(); unsigned short* pBuffer = (unsigned short*)bsUTFText.c_str(); - m_pEnv->OnSetFieldInputFocus(pBuffer, nCharacters, TRUE); + m_pFormFillEnv->OnSetFieldInputFocus(pBuffer, nCharacters, TRUE); } } diff --git a/fpdfsdk/formfiller/cffl_formfiller.cpp b/fpdfsdk/formfiller/cffl_formfiller.cpp index 30609fdac4..1e58d10799 100644 --- a/fpdfsdk/formfiller/cffl_formfiller.cpp +++ b/fpdfsdk/formfiller/cffl_formfiller.cpp @@ -21,9 +21,9 @@ #define FFL_HINT_ELAPSE 800 -CFFL_FormFiller::CFFL_FormFiller(CPDFSDK_FormFillEnvironment* pEnv, +CFFL_FormFiller::CFFL_FormFiller(CPDFSDK_FormFillEnvironment* pFormFillEnv, CPDFSDK_Annot* pAnnot) - : m_pEnv(pEnv), m_pAnnot(pAnnot), m_bValid(FALSE) { + : m_pFormFillEnv(pFormFillEnv), m_pAnnot(pAnnot), m_bValid(FALSE) { m_pWidget = static_cast<CPDFSDK_Widget*>(pAnnot); } @@ -244,7 +244,7 @@ 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_PageView* pPageView = m_pEnv->GetPageView(pPage, true); + CPDFSDK_PageView* pPageView = m_pFormFillEnv->GetPageView(pPage, true); if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, TRUE)) pWnd->SetFocus(); @@ -285,7 +285,7 @@ FX_BOOL CFFL_FormFiller::IsValid() const { } PWL_CREATEPARAM CFFL_FormFiller::GetCreateParam() { - ASSERT(m_pEnv); + ASSERT(m_pFormFillEnv); PWL_CREATEPARAM cp; cp.pParentWnd = nullptr; @@ -337,7 +337,7 @@ PWL_CREATEPARAM CFFL_FormFiller::GetCreateParam() { dwCreateFlags |= PWS_AUTOFONTSIZE; cp.dwFlags = dwCreateFlags; - cp.pSystemHandler = m_pEnv->GetSysHandler(); + cp.pSystemHandler = m_pFormFillEnv->GetSysHandler(); return cp; } @@ -432,7 +432,7 @@ CFX_Matrix CFFL_FormFiller::GetCurMatrix() { } CFX_WideString CFFL_FormFiller::LoadPopupMenuString(int nIndex) { - ASSERT(m_pEnv); + ASSERT(m_pFormFillEnv); return L""; } @@ -450,7 +450,7 @@ CFX_FloatRect CFFL_FormFiller::GetPDFWindowRect() const { CPDFSDK_PageView* CFFL_FormFiller::GetCurPageView(bool renew) { UnderlyingPageType* pPage = m_pAnnot->GetUnderlyingPage(); - return m_pEnv ? m_pEnv->GetPageView(pPage, renew) : nullptr; + return m_pFormFillEnv ? m_pFormFillEnv->GetPageView(pPage, renew) : nullptr; } CFX_FloatRect CFFL_FormFiller::GetFocusBox(CPDFSDK_PageView* pPageView) { @@ -517,7 +517,7 @@ FX_BOOL CFFL_FormFiller::CommitData(CPDFSDK_PageView* pPageView, FX_BOOL bRC = TRUE; FX_BOOL bExit = FALSE; CFFL_InteractiveFormFiller* pFormFiller = - m_pEnv->GetInteractiveFormFiller(); + m_pFormFillEnv->GetInteractiveFormFiller(); CPDFSDK_Annot::ObservedPtr pObserved(m_pWidget); pFormFiller->OnKeyStrokeCommit(&pObserved, pPageView, bRC, bExit, nFlag); if (!pObserved || bExit) @@ -556,7 +556,7 @@ FX_BOOL CFFL_FormFiller::IsFieldFull(CPDFSDK_PageView* pPageView) { #endif // PDF_ENABLE_XFA void CFFL_FormFiller::SetChangeMark() { - m_pEnv->OnChange(); + m_pFormFillEnv->OnChange(); } void CFFL_FormFiller::GetActionData(CPDFSDK_PageView* pPageView, @@ -587,7 +587,7 @@ CPWL_Wnd* CFFL_FormFiller::ResetPDFWindow(CPDFSDK_PageView* pPageView, void CFFL_FormFiller::TimerProc() {} CFX_SystemHandler* CFFL_FormFiller::GetSystemHandler() const { - return m_pEnv->GetSysHandler(); + return m_pFormFillEnv->GetSysHandler(); } void CFFL_FormFiller::EscapeFiller(CPDFSDK_PageView* pPageView, @@ -606,7 +606,7 @@ void CFFL_FormFiller::InvalidateRect(double left, double right, double bottom) { UnderlyingPageType* pPage = m_pWidget->GetUnderlyingPage(); - m_pEnv->Invalidate(pPage, left, top, right, bottom); + m_pFormFillEnv->Invalidate(pPage, left, top, right, bottom); } CFFL_Button::CFFL_Button(CPDFSDK_FormFillEnvironment* pApp, @@ -667,7 +667,7 @@ FX_BOOL CFFL_Button::OnMouseMove(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, uint32_t nFlags, const CFX_FloatPoint& point) { - ASSERT(m_pEnv); + ASSERT(m_pFormFillEnv); return TRUE; } diff --git a/fpdfsdk/formfiller/cffl_formfiller.h b/fpdfsdk/formfiller/cffl_formfiller.h index 23c3ba7df2..cd04de4765 100644 --- a/fpdfsdk/formfiller/cffl_formfiller.h +++ b/fpdfsdk/formfiller/cffl_formfiller.h @@ -20,7 +20,8 @@ class CPDFSDK_Widget; class CFFL_FormFiller : public IPWL_Provider, public CPWL_TimerHandler { public: - CFFL_FormFiller(CPDFSDK_FormFillEnvironment* pEnv, CPDFSDK_Annot* pAnnot); + CFFL_FormFiller(CPDFSDK_FormFillEnvironment* pFormFillEnv, + CPDFSDK_Annot* pAnnot); ~CFFL_FormFiller() override; virtual FX_RECT GetViewBBox(CPDFSDK_PageView* pPageView, @@ -157,7 +158,7 @@ class CFFL_FormFiller : public IPWL_Provider, public CPWL_TimerHandler { // until the PWL_Edit is done with it. pdfium:566 void DestroyWindows(); - CPDFSDK_FormFillEnvironment* m_pEnv; + CPDFSDK_FormFillEnvironment* m_pFormFillEnv; CPDFSDK_Widget* m_pWidget; CPDFSDK_Annot* m_pAnnot; @@ -168,7 +169,8 @@ class CFFL_FormFiller : public IPWL_Provider, public CPWL_TimerHandler { class CFFL_Button : public CFFL_FormFiller { public: - CFFL_Button(CPDFSDK_FormFillEnvironment* pEnv, CPDFSDK_Annot* pWidget); + CFFL_Button(CPDFSDK_FormFillEnvironment* pFormFillEnv, + CPDFSDK_Annot* pWidget); ~CFFL_Button() override; // CFFL_FormFiller diff --git a/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp b/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp index b06dfdba4a..a699522aa8 100644 --- a/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp +++ b/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp @@ -27,8 +27,8 @@ #define FFL_MAXLISTBOXHEIGHT 140.0f CFFL_InteractiveFormFiller::CFFL_InteractiveFormFiller( - CPDFSDK_FormFillEnvironment* pEnv) - : m_pEnv(pEnv), m_bNotifying(FALSE) {} + CPDFSDK_FormFillEnvironment* pFormFillEnv) + : m_pFormFillEnv(pFormFillEnv), m_bNotifying(FALSE) {} CFFL_InteractiveFormFiller::~CFFL_InteractiveFormFiller() {} @@ -66,7 +66,7 @@ void CFFL_InteractiveFormFiller::OnDraw(CPDFSDK_PageView* pPageView, pFormFiller->OnDraw(pPageView, pAnnot, pDevice, pUser2Device); pAnnot->GetPDFPage(); - if (m_pEnv->GetFocusAnnot() == pAnnot) { + if (m_pFormFillEnv->GetFocusAnnot() == pAnnot) { CFX_FloatRect rcFocus = pFormFiller->GetFocusBox(pPageView); if (!rcFocus.IsEmpty()) { CFX_PathData path; @@ -119,8 +119,8 @@ void CFFL_InteractiveFormFiller::OnMouseEnter( ASSERT(pPageView); PDFSDK_FieldAction fa; - fa.bModifier = m_pEnv->IsCTRLKeyDown(nFlag); - fa.bShift = m_pEnv->IsSHIFTKeyDown(nFlag); + fa.bModifier = m_pFormFillEnv->IsCTRLKeyDown(nFlag); + fa.bShift = m_pFormFillEnv->IsSHIFTKeyDown(nFlag); pWidget->OnAAction(CPDF_AAction::CursorEnter, fa, pPageView); m_bNotifying = FALSE; if (!(*pAnnot)) @@ -153,8 +153,8 @@ void CFFL_InteractiveFormFiller::OnMouseExit(CPDFSDK_PageView* pPageView, ASSERT(pPageView); PDFSDK_FieldAction fa; - fa.bModifier = m_pEnv->IsCTRLKeyDown(nFlag); - fa.bShift = m_pEnv->IsSHIFTKeyDown(nFlag); + fa.bModifier = m_pFormFillEnv->IsCTRLKeyDown(nFlag); + fa.bShift = m_pFormFillEnv->IsSHIFTKeyDown(nFlag); pWidget->OnAAction(CPDF_AAction::CursorExit, fa, pPageView); m_bNotifying = FALSE; if (!(*pAnnot)) @@ -190,8 +190,8 @@ FX_BOOL CFFL_InteractiveFormFiller::OnLButtonDown( ASSERT(pPageView); PDFSDK_FieldAction fa; - fa.bModifier = m_pEnv->IsCTRLKeyDown(nFlags); - fa.bShift = m_pEnv->IsSHIFTKeyDown(nFlags); + fa.bModifier = m_pFormFillEnv->IsCTRLKeyDown(nFlags); + fa.bShift = m_pFormFillEnv->IsSHIFTKeyDown(nFlags); pWidget->OnAAction(CPDF_AAction::ButtonDown, fa, pPageView); m_bNotifying = FALSE; if (!(*pAnnot)) @@ -228,10 +228,10 @@ FX_BOOL CFFL_InteractiveFormFiller::OnLButtonUp( case FIELDTYPE_RADIOBUTTON: if (GetViewBBox(pPageView, pAnnot->Get()) .Contains((int)point.x, (int)point.y)) - m_pEnv->SetFocusAnnot(pAnnot); + m_pFormFillEnv->SetFocusAnnot(pAnnot); break; default: - m_pEnv->SetFocusAnnot(pAnnot); + m_pFormFillEnv->SetFocusAnnot(pAnnot); break; } @@ -239,7 +239,7 @@ FX_BOOL CFFL_InteractiveFormFiller::OnLButtonUp( if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot->Get(), FALSE)) bRet = pFormFiller->OnLButtonUp(pPageView, pAnnot->Get(), nFlags, point); - if (m_pEnv->GetFocusAnnot() == pAnnot->Get()) { + if (m_pFormFillEnv->GetFocusAnnot() == pAnnot->Get()) { FX_BOOL bExit = FALSE; FX_BOOL bReset = FALSE; OnButtonUp(pAnnot, pPageView, bReset, bExit, nFlags); @@ -269,8 +269,8 @@ void CFFL_InteractiveFormFiller::OnButtonUp(CPDFSDK_Annot::ObservedPtr* pAnnot, ASSERT(pPageView); PDFSDK_FieldAction fa; - fa.bModifier = m_pEnv->IsCTRLKeyDown(nFlag); - fa.bShift = m_pEnv->IsSHIFTKeyDown(nFlag); + fa.bModifier = m_pFormFillEnv->IsCTRLKeyDown(nFlag); + fa.bShift = m_pFormFillEnv->IsSHIFTKeyDown(nFlag); pWidget->OnAAction(CPDF_AAction::ButtonUp, fa, pPageView); m_bNotifying = FALSE; if (!(*pAnnot) || !IsValidAnnot(pPageView, pWidget)) { @@ -394,8 +394,8 @@ FX_BOOL CFFL_InteractiveFormFiller::OnSetFocus( ASSERT(pPageView); PDFSDK_FieldAction fa; - fa.bModifier = m_pEnv->IsCTRLKeyDown(nFlag); - fa.bShift = m_pEnv->IsSHIFTKeyDown(nFlag); + fa.bModifier = m_pFormFillEnv->IsCTRLKeyDown(nFlag); + fa.bShift = m_pFormFillEnv->IsSHIFTKeyDown(nFlag); pFormFiller->GetActionData(pPageView, CPDF_AAction::GetFocus, fa); pWidget->OnAAction(CPDF_AAction::GetFocus, fa, pPageView); m_bNotifying = FALSE; @@ -436,8 +436,8 @@ FX_BOOL CFFL_InteractiveFormFiller::OnKillFocus( ASSERT(pPageView); PDFSDK_FieldAction fa; - fa.bModifier = m_pEnv->IsCTRLKeyDown(nFlag); - fa.bShift = m_pEnv->IsSHIFTKeyDown(nFlag); + fa.bModifier = m_pFormFillEnv->IsCTRLKeyDown(nFlag); + fa.bShift = m_pFormFillEnv->IsSHIFTKeyDown(nFlag); pFormFiller->GetActionData(pPageView, CPDF_AAction::LoseFocus, fa); pWidget->OnAAction(CPDF_AAction::LoseFocus, fa, pPageView); m_bNotifying = FALSE; @@ -485,22 +485,22 @@ CFFL_FormFiller* CFFL_InteractiveFormFiller::GetFormFiller( CFFL_FormFiller* pFormFiller; switch (nFieldType) { case FIELDTYPE_PUSHBUTTON: - pFormFiller = new CFFL_PushButton(m_pEnv, pWidget); + pFormFiller = new CFFL_PushButton(m_pFormFillEnv, pWidget); break; case FIELDTYPE_CHECKBOX: - pFormFiller = new CFFL_CheckBox(m_pEnv, pWidget); + pFormFiller = new CFFL_CheckBox(m_pFormFillEnv, pWidget); break; case FIELDTYPE_RADIOBUTTON: - pFormFiller = new CFFL_RadioButton(m_pEnv, pWidget); + pFormFiller = new CFFL_RadioButton(m_pFormFillEnv, pWidget); break; case FIELDTYPE_TEXTFIELD: - pFormFiller = new CFFL_TextField(m_pEnv, pWidget); + pFormFiller = new CFFL_TextField(m_pFormFillEnv, pWidget); break; case FIELDTYPE_LISTBOX: - pFormFiller = new CFFL_ListBox(m_pEnv, pWidget); + pFormFiller = new CFFL_ListBox(m_pFormFillEnv, pWidget); break; case FIELDTYPE_COMBOBOX: - pFormFiller = new CFFL_ComboBox(m_pEnv, pWidget); + pFormFiller = new CFFL_ComboBox(m_pFormFillEnv, pWidget); break; case FIELDTYPE_UNKNOWN: default: @@ -615,8 +615,8 @@ void CFFL_InteractiveFormFiller::OnKeyStrokeCommit( pWidget->ClearAppModified(); PDFSDK_FieldAction fa; - fa.bModifier = m_pEnv->IsCTRLKeyDown(nFlag); - fa.bShift = m_pEnv->IsSHIFTKeyDown(nFlag); + fa.bModifier = m_pFormFillEnv->IsCTRLKeyDown(nFlag); + fa.bShift = m_pFormFillEnv->IsSHIFTKeyDown(nFlag); fa.bWillCommit = TRUE; fa.bKeyDown = TRUE; fa.bRC = TRUE; @@ -647,8 +647,8 @@ void CFFL_InteractiveFormFiller::OnValidate(CPDFSDK_Annot::ObservedPtr* pAnnot, pWidget->ClearAppModified(); PDFSDK_FieldAction fa; - fa.bModifier = m_pEnv->IsCTRLKeyDown(nFlag); - fa.bShift = m_pEnv->IsSHIFTKeyDown(nFlag); + fa.bModifier = m_pFormFillEnv->IsCTRLKeyDown(nFlag); + fa.bShift = m_pFormFillEnv->IsSHIFTKeyDown(nFlag); fa.bKeyDown = TRUE; fa.bRC = TRUE; @@ -714,8 +714,8 @@ void CFFL_InteractiveFormFiller::OnClick(CPDFSDK_Widget* pWidget, int nValueAge = pWidget->GetValueAge(); PDFSDK_FieldAction fa; - fa.bModifier = m_pEnv->IsCTRLKeyDown(nFlag); - fa.bShift = m_pEnv->IsSHIFTKeyDown(nFlag); + fa.bModifier = m_pFormFillEnv->IsCTRLKeyDown(nFlag); + fa.bShift = m_pFormFillEnv->IsSHIFTKeyDown(nFlag); pWidget->OnXFAAAction(PDFSDK_XFA_Click, fa, pPageView); m_bNotifying = FALSE; @@ -749,8 +749,8 @@ void CFFL_InteractiveFormFiller::OnFull(CPDFSDK_Widget* pWidget, int nValueAge = pWidget->GetValueAge(); PDFSDK_FieldAction fa; - fa.bModifier = m_pEnv->IsCTRLKeyDown(nFlag); - fa.bShift = m_pEnv->IsSHIFTKeyDown(nFlag); + fa.bModifier = m_pFormFillEnv->IsCTRLKeyDown(nFlag); + fa.bShift = m_pFormFillEnv->IsSHIFTKeyDown(nFlag); pWidget->OnXFAAAction(PDFSDK_XFA_Full, fa, pPageView); m_bNotifying = FALSE; @@ -812,8 +812,8 @@ void CFFL_InteractiveFormFiller::OnPreOpen(CPDFSDK_Widget* pWidget, int nValueAge = pWidget->GetValueAge(); PDFSDK_FieldAction fa; - fa.bModifier = m_pEnv->IsCTRLKeyDown(nFlag); - fa.bShift = m_pEnv->IsSHIFTKeyDown(nFlag); + fa.bModifier = m_pFormFillEnv->IsCTRLKeyDown(nFlag); + fa.bShift = m_pFormFillEnv->IsSHIFTKeyDown(nFlag); pWidget->OnXFAAAction(PDFSDK_XFA_PreOpen, fa, pPageView); m_bNotifying = FALSE; @@ -847,8 +847,8 @@ void CFFL_InteractiveFormFiller::OnPostOpen(CPDFSDK_Widget* pWidget, int nValueAge = pWidget->GetValueAge(); PDFSDK_FieldAction fa; - fa.bModifier = m_pEnv->IsCTRLKeyDown(nFlag); - fa.bShift = m_pEnv->IsSHIFTKeyDown(nFlag); + fa.bModifier = m_pFormFillEnv->IsCTRLKeyDown(nFlag); + fa.bShift = m_pFormFillEnv->IsSHIFTKeyDown(nFlag); pWidget->OnXFAAAction(PDFSDK_XFA_PostOpen, fa, pPageView); m_bNotifying = FALSE; @@ -914,8 +914,8 @@ void CFFL_InteractiveFormFiller::OnBeforeKeyStroke( pData->pPageView->GetFormFillEnv(); PDFSDK_FieldAction fa; - fa.bModifier = m_pEnv->IsCTRLKeyDown(nFlag); - fa.bShift = m_pEnv->IsSHIFTKeyDown(nFlag); + fa.bModifier = m_pFormFillEnv->IsCTRLKeyDown(nFlag); + fa.bShift = m_pFormFillEnv->IsSHIFTKeyDown(nFlag); fa.sChange = strChange; fa.sChangeEx = strChangeEx; fa.bKeyDown = bKeyDown; diff --git a/fpdfsdk/formfiller/cffl_interactiveformfiller.h b/fpdfsdk/formfiller/cffl_interactiveformfiller.h index 1a1af44ebb..70ec43ddd6 100644 --- a/fpdfsdk/formfiller/cffl_interactiveformfiller.h +++ b/fpdfsdk/formfiller/cffl_interactiveformfiller.h @@ -21,7 +21,8 @@ class CPDFSDK_Widget; class CFFL_InteractiveFormFiller : public IPWL_Filler_Notify { public: - explicit CFFL_InteractiveFormFiller(CPDFSDK_FormFillEnvironment* pEnv); + explicit CFFL_InteractiveFormFiller( + CPDFSDK_FormFillEnvironment* pFormFillEnv); ~CFFL_InteractiveFormFiller() override; FX_BOOL Annot_HitTest(CPDFSDK_PageView* pPageView, @@ -165,7 +166,7 @@ class CFFL_InteractiveFormFiller : public IPWL_Filler_Notify { #endif // PDF_ENABLE_XFA void UnRegisterFormFiller(CPDFSDK_Annot* pAnnot); - CPDFSDK_FormFillEnvironment* const m_pEnv; + CPDFSDK_FormFillEnvironment* const m_pFormFillEnv; CFFL_Widget2Filler m_Maps; FX_BOOL m_bNotifying; }; diff --git a/fpdfsdk/formfiller/cffl_listbox.cpp b/fpdfsdk/formfiller/cffl_listbox.cpp index d8331e5027..85b907017c 100644 --- a/fpdfsdk/formfiller/cffl_listbox.cpp +++ b/fpdfsdk/formfiller/cffl_listbox.cpp @@ -38,8 +38,8 @@ PWL_CREATEPARAM CFFL_ListBox::GetCreateParam() { cp.fFontSize = FFL_DEFAULTLISTBOXFONTSIZE; if (!m_pFontMap) { - m_pFontMap = - pdfium::MakeUnique<CBA_FontMap>(m_pWidget, m_pEnv->GetSysHandler()); + m_pFontMap = pdfium::MakeUnique<CBA_FontMap>( + m_pWidget, m_pFormFillEnv->GetSysHandler()); } cp.pFontMap = m_pFontMap.get(); @@ -51,7 +51,7 @@ CPWL_Wnd* CFFL_ListBox::NewPDFWindow(const PWL_CREATEPARAM& cp, CPWL_ListBox* pWnd = new CPWL_ListBox(); pWnd->AttachFFLData(this); pWnd->Create(cp); - pWnd->SetFillerNotify(m_pEnv->GetInteractiveFormFiller()); + pWnd->SetFillerNotify(m_pFormFillEnv->GetInteractiveFormFiller()); for (int32_t i = 0, sz = m_pWidget->CountOptions(); i < sz; i++) pWnd->AddString(m_pWidget->GetOptionLabel(i)); diff --git a/fpdfsdk/formfiller/cffl_radiobutton.cpp b/fpdfsdk/formfiller/cffl_radiobutton.cpp index 73fd18d2af..8186c2f137 100644 --- a/fpdfsdk/formfiller/cffl_radiobutton.cpp +++ b/fpdfsdk/formfiller/cffl_radiobutton.cpp @@ -52,8 +52,8 @@ FX_BOOL CFFL_RadioButton::OnChar(CPDFSDK_Annot* pAnnot, FX_BOOL bReset = FALSE; FX_BOOL bExit = FALSE; CPDFSDK_Annot::ObservedPtr pObserved(m_pWidget); - m_pEnv->GetInteractiveFormFiller()->OnButtonUp(&pObserved, pPageView, - bReset, bExit, nFlags); + m_pFormFillEnv->GetInteractiveFormFiller()->OnButtonUp( + &pObserved, pPageView, bReset, bExit, nFlags); if (!pObserved || bReset || bExit) return TRUE; diff --git a/fpdfsdk/formfiller/cffl_textfield.cpp b/fpdfsdk/formfiller/cffl_textfield.cpp index a2612f17ef..566051c2de 100644 --- a/fpdfsdk/formfiller/cffl_textfield.cpp +++ b/fpdfsdk/formfiller/cffl_textfield.cpp @@ -73,8 +73,8 @@ PWL_CREATEPARAM CFFL_TextField::GetCreateParam() { } if (!m_pFontMap) { - m_pFontMap = - pdfium::MakeUnique<CBA_FontMap>(m_pWidget, m_pEnv->GetSysHandler()); + m_pFontMap = pdfium::MakeUnique<CBA_FontMap>( + m_pWidget, m_pFormFillEnv->GetSysHandler()); } cp.pFontMap = m_pFontMap.get(); cp.pFocusHandler = this; @@ -87,7 +87,7 @@ CPWL_Wnd* CFFL_TextField::NewPDFWindow(const PWL_CREATEPARAM& cp, CPWL_Edit* pWnd = new CPWL_Edit(); pWnd->AttachFFLData(this); pWnd->Create(cp); - pWnd->SetFillerNotify(m_pEnv->GetInteractiveFormFiller()); + pWnd->SetFillerNotify(m_pFormFillEnv->GetInteractiveFormFiller()); int32_t nMaxLen = m_pWidget->GetMaxLen(); CFX_WideString swValue = m_pWidget->GetValue(); @@ -115,8 +115,8 @@ FX_BOOL CFFL_TextField::OnChar(CPDFSDK_Annot* pAnnot, ASSERT(pPageView); m_bValid = !m_bValid; CFX_FloatRect rcAnnot = pAnnot->GetRect(); - m_pEnv->Invalidate(pAnnot->GetUnderlyingPage(), rcAnnot.left, - rcAnnot.top, rcAnnot.right, rcAnnot.bottom); + m_pFormFillEnv->Invalidate(pAnnot->GetUnderlyingPage(), rcAnnot.left, + rcAnnot.top, rcAnnot.right, rcAnnot.bottom); if (m_bValid) { if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, TRUE)) @@ -271,7 +271,7 @@ FX_BOOL CFFL_TextField::IsFieldFull(CPDFSDK_PageView* pPageView) { #endif // PDF_ENABLE_XFA void CFFL_TextField::OnSetFocus(CPWL_Wnd* pWnd) { - ASSERT(m_pEnv); + ASSERT(m_pFormFillEnv); if (pWnd->GetClassName() == PWL_CLASSNAME_EDIT) { CPWL_Edit* pEdit = (CPWL_Edit*)pWnd; pEdit->SetCharSet(FXFONT_GB2312_CHARSET); @@ -282,6 +282,6 @@ void CFFL_TextField::OnSetFocus(CPWL_Wnd* pWnd) { int nCharacters = wsText.GetLength(); CFX_ByteString bsUTFText = wsText.UTF16LE_Encode(); unsigned short* pBuffer = (unsigned short*)bsUTFText.c_str(); - m_pEnv->OnSetFieldInputFocus(pBuffer, nCharacters, TRUE); + m_pFormFillEnv->OnSetFieldInputFocus(pBuffer, nCharacters, TRUE); } } diff --git a/fpdfsdk/fpdfformfill.cpp b/fpdfsdk/fpdfformfill.cpp index de43273f09..34e206d6bc 100644 --- a/fpdfsdk/fpdfformfill.cpp +++ b/fpdfsdk/fpdfformfill.cpp @@ -246,9 +246,9 @@ FPDFDOC_InitFormFillEnvironment(FPDF_DOCUMENT document, return nullptr; #ifdef PDF_ENABLE_XFA - // If the CPDFXFA_Document has a SDKDocument already then we've done this - // and can just return the old Env. Otherwise, we'll end up setting a new - // SDKDocument into the XFADocument and, that could get weird. + // If the CPDFXFA_Document has a FormFillEnvironment already then we've done + // this and can just return the old Env. Otherwise, we'll end up setting a new + // environment into the XFADocument and, that could get weird. if (pDocument->GetFormFillEnv()) return pDocument->GetFormFillEnv(); #endif diff --git a/fpdfsdk/fpdfxfa/cpdfxfa_app.cpp b/fpdfsdk/fpdfxfa/cpdfxfa_app.cpp index d1a3bd0112..626a07eb29 100644 --- a/fpdfsdk/fpdfxfa/cpdfxfa_app.cpp +++ b/fpdfsdk/fpdfxfa/cpdfxfa_app.cpp @@ -38,7 +38,7 @@ CPDFXFA_App::CPDFXFA_App() : m_bJavaScriptInitialized(FALSE), m_pIsolate(nullptr), m_csAppType(JS_STR_VIEWERTYPE_STANDARD) { - m_pEnvList.RemoveAll(); + m_pFormFillEnvList.RemoveAll(); } CPDFXFA_App::~CPDFXFA_App() { @@ -64,21 +64,22 @@ FX_BOOL CPDFXFA_App::Initialize(v8::Isolate* pIsolate) { return TRUE; } -FX_BOOL CPDFXFA_App::AddFormFillEnv(CPDFSDK_FormFillEnvironment* pEnv) { - if (!pEnv) +FX_BOOL CPDFXFA_App::AddFormFillEnv(CPDFSDK_FormFillEnvironment* pFormFillEnv) { + if (!pFormFillEnv) return FALSE; - m_pEnvList.Add(pEnv); + m_pFormFillEnvList.Add(pFormFillEnv); return TRUE; } -FX_BOOL CPDFXFA_App::RemoveFormFillEnv(CPDFSDK_FormFillEnvironment* pEnv) { - if (!pEnv) +FX_BOOL CPDFXFA_App::RemoveFormFillEnv( + CPDFSDK_FormFillEnvironment* pFormFillEnv) { + if (!pFormFillEnv) return FALSE; - int nFind = m_pEnvList.Find(pEnv); + int nFind = m_pFormFillEnvList.Find(pFormFillEnv); if (nFind != -1) { - m_pEnvList.RemoveAt(nFind); + m_pFormFillEnvList.RemoveAt(nFind); return TRUE; } @@ -90,10 +91,9 @@ void CPDFXFA_App::GetAppType(CFX_WideString& wsAppType) { } void CPDFXFA_App::GetAppName(CFX_WideString& wsName) { - CPDFSDK_FormFillEnvironment* pEnv = m_pEnvList.GetAt(0); - if (pEnv) { - wsName = pEnv->FFI_GetAppName(); - } + CPDFSDK_FormFillEnvironment* pFormFillEnv = m_pFormFillEnvList.GetAt(0); + if (pFormFillEnv) + wsName = pFormFillEnv->FFI_GetAppName(); } void CPDFXFA_App::SetAppType(const CFX_WideStringC& wsAppType) { @@ -101,15 +101,15 @@ void CPDFXFA_App::SetAppType(const CFX_WideStringC& wsAppType) { } void CPDFXFA_App::GetLanguage(CFX_WideString& wsLanguage) { - CPDFSDK_FormFillEnvironment* pEnv = m_pEnvList.GetAt(0); - if (pEnv) - wsLanguage = pEnv->GetLanguage(); + CPDFSDK_FormFillEnvironment* pFormFillEnv = m_pFormFillEnvList.GetAt(0); + if (pFormFillEnv) + wsLanguage = pFormFillEnv->GetLanguage(); } void CPDFXFA_App::GetPlatform(CFX_WideString& wsPlatform) { - CPDFSDK_FormFillEnvironment* pEnv = m_pEnvList.GetAt(0); - if (pEnv) { - wsPlatform = pEnv->GetPlatform(); + CPDFSDK_FormFillEnvironment* pFormFillEnv = m_pFormFillEnvList.GetAt(0); + if (pFormFillEnv) { + wsPlatform = pFormFillEnv->GetPlatform(); } } @@ -122,9 +122,9 @@ void CPDFXFA_App::GetVersion(CFX_WideString& wsVersion) { } void CPDFXFA_App::Beep(uint32_t dwType) { - CPDFSDK_FormFillEnvironment* pEnv = m_pEnvList.GetAt(0); - if (pEnv) { - pEnv->JS_appBeep(dwType); + CPDFSDK_FormFillEnvironment* pFormFillEnv = m_pFormFillEnvList.GetAt(0); + if (pFormFillEnv) { + pFormFillEnv->JS_appBeep(dwType); } } @@ -132,8 +132,8 @@ int32_t CPDFXFA_App::MsgBox(const CFX_WideString& wsMessage, const CFX_WideString& wsTitle, uint32_t dwIconType, uint32_t dwButtonType) { - CPDFSDK_FormFillEnvironment* pEnv = m_pEnvList.GetAt(0); - if (!pEnv) + CPDFSDK_FormFillEnvironment* pFormFillEnv = m_pFormFillEnvList.GetAt(0); + if (!pFormFillEnv) return -1; uint32_t iconType = 0; @@ -166,8 +166,8 @@ int32_t CPDFXFA_App::MsgBox(const CFX_WideString& wsMessage, iButtonType |= 3; break; } - int32_t iRet = pEnv->JS_appAlert(wsMessage.c_str(), wsTitle.c_str(), - iButtonType, iconType); + int32_t iRet = pFormFillEnv->JS_appAlert(wsMessage.c_str(), wsTitle.c_str(), + iButtonType, iconType); switch (iRet) { case 1: return XFA_IDOK; @@ -186,13 +186,13 @@ CFX_WideString CPDFXFA_App::Response(const CFX_WideString& wsQuestion, const CFX_WideString& wsDefaultAnswer, FX_BOOL bMark) { CFX_WideString wsAnswer; - CPDFSDK_FormFillEnvironment* pEnv = m_pEnvList.GetAt(0); - if (pEnv) { + CPDFSDK_FormFillEnvironment* pFormFillEnv = m_pFormFillEnvList.GetAt(0); + if (pFormFillEnv) { int nLength = 2048; char* pBuff = new char[nLength]; - nLength = pEnv->JS_appResponse(wsQuestion.c_str(), wsTitle.c_str(), - wsDefaultAnswer.c_str(), nullptr, bMark, - pBuff, nLength); + nLength = pFormFillEnv->JS_appResponse(wsQuestion.c_str(), wsTitle.c_str(), + wsDefaultAnswer.c_str(), nullptr, + bMark, pBuff, nLength); if (nLength > 0) { nLength = nLength > 2046 ? 2046 : nLength; pBuff[nLength] = 0; @@ -207,8 +207,8 @@ CFX_WideString CPDFXFA_App::Response(const CFX_WideString& wsQuestion, } IFX_FileRead* CPDFXFA_App::DownloadURL(const CFX_WideString& wsURL) { - CPDFSDK_FormFillEnvironment* pEnv = m_pEnvList.GetAt(0); - return pEnv ? pEnv->DownloadFromURL(wsURL.c_str()) : nullptr; + CPDFSDK_FormFillEnvironment* pFormFillEnv = m_pFormFillEnvList.GetAt(0); + return pFormFillEnv ? pFormFillEnv->DownloadFromURL(wsURL.c_str()) : nullptr; } FX_BOOL CPDFXFA_App::PostRequestURL(const CFX_WideString& wsURL, @@ -217,22 +217,23 @@ FX_BOOL CPDFXFA_App::PostRequestURL(const CFX_WideString& wsURL, const CFX_WideString& wsEncode, const CFX_WideString& wsHeader, CFX_WideString& wsResponse) { - CPDFSDK_FormFillEnvironment* pEnv = m_pEnvList.GetAt(0); - if (!pEnv) + CPDFSDK_FormFillEnvironment* pFormFillEnv = m_pFormFillEnvList.GetAt(0); + if (!pFormFillEnv) return FALSE; - wsResponse = - pEnv->PostRequestURL(wsURL.c_str(), wsData.c_str(), wsContentType.c_str(), - wsEncode.c_str(), wsHeader.c_str()); + wsResponse = pFormFillEnv->PostRequestURL(wsURL.c_str(), wsData.c_str(), + wsContentType.c_str(), + wsEncode.c_str(), wsHeader.c_str()); return TRUE; } FX_BOOL CPDFXFA_App::PutRequestURL(const CFX_WideString& wsURL, const CFX_WideString& wsData, const CFX_WideString& wsEncode) { - CPDFSDK_FormFillEnvironment* pEnv = m_pEnvList.GetAt(0); - return pEnv && - pEnv->PutRequestURL(wsURL.c_str(), wsData.c_str(), wsEncode.c_str()); + CPDFSDK_FormFillEnvironment* pFormFillEnv = m_pFormFillEnvList.GetAt(0); + return pFormFillEnv && + pFormFillEnv->PutRequestURL(wsURL.c_str(), wsData.c_str(), + wsEncode.c_str()); } void CPDFXFA_App::LoadString(int32_t iStringID, CFX_WideString& wsString) { @@ -334,8 +335,8 @@ void CPDFXFA_App::LoadString(int32_t iStringID, CFX_WideString& wsString) { IFWL_AdapterTimerMgr* CPDFXFA_App::GetTimerMgr() { CXFA_FWLAdapterTimerMgr* pAdapter = nullptr; - CPDFSDK_FormFillEnvironment* pEnv = m_pEnvList.GetAt(0); - if (pEnv) - pAdapter = new CXFA_FWLAdapterTimerMgr(pEnv); + CPDFSDK_FormFillEnvironment* pFormFillEnv = m_pFormFillEnvList.GetAt(0); + if (pFormFillEnv) + pAdapter = new CXFA_FWLAdapterTimerMgr(pFormFillEnv); return pAdapter; } diff --git a/fpdfsdk/fpdfxfa/cpdfxfa_app.h b/fpdfsdk/fpdfxfa/cpdfxfa_app.h index 3d5256381c..6deaeacff0 100644 --- a/fpdfsdk/fpdfxfa/cpdfxfa_app.h +++ b/fpdfsdk/fpdfxfa/cpdfxfa_app.h @@ -23,8 +23,8 @@ class CPDFXFA_App : public IXFA_AppProvider { FX_BOOL Initialize(v8::Isolate* pIsolate); CXFA_FFApp* GetXFAApp() { return m_pXFAApp.get(); } - FX_BOOL AddFormFillEnv(CPDFSDK_FormFillEnvironment* pEnv); - FX_BOOL RemoveFormFillEnv(CPDFSDK_FormFillEnvironment* pEnv); + FX_BOOL AddFormFillEnv(CPDFSDK_FormFillEnvironment* pFormFillEnv); + FX_BOOL RemoveFormFillEnv(CPDFSDK_FormFillEnvironment* pFormFillEnv); FX_BOOL IsJavaScriptInitialized() const { return m_bJavaScriptInitialized; } void SetJavaScriptInitialized(FX_BOOL bInitialized) { @@ -67,7 +67,7 @@ class CPDFXFA_App : public IXFA_AppProvider { void LoadString(int32_t iStringID, CFX_WideString& wsString) override; IFWL_AdapterTimerMgr* GetTimerMgr() override; - CFX_ArrayTemplate<CPDFSDK_FormFillEnvironment*> m_pEnvList; + CFX_ArrayTemplate<CPDFSDK_FormFillEnvironment*> m_pFormFillEnvList; protected: FX_BOOL m_bJavaScriptInitialized; diff --git a/fpdfsdk/fpdfxfa/cpdfxfa_document.cpp b/fpdfsdk/fpdfxfa/cpdfxfa_document.cpp index c768b591ba..df0da31beb 100644 --- a/fpdfsdk/fpdfxfa/cpdfxfa_document.cpp +++ b/fpdfsdk/fpdfxfa/cpdfxfa_document.cpp @@ -44,7 +44,7 @@ CPDFXFA_Document::~CPDFXFA_Document() { if (m_pFormFillEnv) { m_pFormFillEnv->ClearAllFocusedAnnots(); - // Once we're deleted the SDKDocument will point at a bad underlying + // Once we're deleted the FormFillEnvironment will point at a bad underlying // doc so we need to reset it ... m_pFormFillEnv->ResetXFADocument(); m_pFormFillEnv = nullptr; diff --git a/fpdfsdk/fpdfxfa/cxfa_fwladaptertimermgr.cpp b/fpdfsdk/fpdfxfa/cxfa_fwladaptertimermgr.cpp index 8d9356990b..4c390ae917 100644 --- a/fpdfsdk/fpdfxfa/cxfa_fwladaptertimermgr.cpp +++ b/fpdfsdk/fpdfxfa/cxfa_fwladaptertimermgr.cpp @@ -17,10 +17,10 @@ FWL_Error CXFA_FWLAdapterTimerMgr::Start(IFWL_Timer* pTimer, uint32_t dwElapse, bool bImmediately, IFWL_TimerInfo** pTimerInfo) { - if (!m_pEnv) + if (!m_pFormFillEnv) return FWL_Error::Indefinite; - int32_t id_event = m_pEnv->SetTimer(dwElapse, TimerProc); + int32_t id_event = m_pFormFillEnv->SetTimer(dwElapse, TimerProc); if (!s_TimerArray) s_TimerArray = new std::vector<CFWL_TimerInfo*>; @@ -30,11 +30,11 @@ FWL_Error CXFA_FWLAdapterTimerMgr::Start(IFWL_Timer* pTimer, } FWL_Error CXFA_FWLAdapterTimerMgr::Stop(IFWL_TimerInfo* pTimerInfo) { - if (!pTimerInfo || !m_pEnv) + if (!pTimerInfo || !m_pFormFillEnv) return FWL_Error::Indefinite; CFWL_TimerInfo* pInfo = static_cast<CFWL_TimerInfo*>(pTimerInfo); - m_pEnv->KillTimer(pInfo->idEvent); + m_pFormFillEnv->KillTimer(pInfo->idEvent); if (s_TimerArray) { auto it = std::find(s_TimerArray->begin(), s_TimerArray->end(), pInfo); if (it != s_TimerArray->end()) { diff --git a/fpdfsdk/fpdfxfa/cxfa_fwladaptertimermgr.h b/fpdfsdk/fpdfxfa/cxfa_fwladaptertimermgr.h index 5c046b5bdd..5f5017b5d8 100644 --- a/fpdfsdk/fpdfxfa/cxfa_fwladaptertimermgr.h +++ b/fpdfsdk/fpdfxfa/cxfa_fwladaptertimermgr.h @@ -21,7 +21,8 @@ struct CFWL_TimerInfo; class CXFA_FWLAdapterTimerMgr : public IFWL_AdapterTimerMgr { public: - CXFA_FWLAdapterTimerMgr(CPDFSDK_FormFillEnvironment* pEnv) : m_pEnv(pEnv) {} + CXFA_FWLAdapterTimerMgr(CPDFSDK_FormFillEnvironment* pFormFillEnv) + : m_pFormFillEnv(pFormFillEnv) {} FWL_Error Start(IFWL_Timer* pTimer, uint32_t dwElapse, @@ -33,7 +34,7 @@ class CXFA_FWLAdapterTimerMgr : public IFWL_AdapterTimerMgr { static void TimerProc(int32_t idEvent); static std::vector<CFWL_TimerInfo*>* s_TimerArray; - CPDFSDK_FormFillEnvironment* const m_pEnv; + CPDFSDK_FormFillEnvironment* const m_pFormFillEnv; }; struct CFWL_TimerInfo : public IFWL_TimerInfo { diff --git a/fpdfsdk/javascript/Document.cpp b/fpdfsdk/javascript/Document.cpp index 6b795a02ec..0b08f66f33 100644 --- a/fpdfsdk/javascript/Document.cpp +++ b/fpdfsdk/javascript/Document.cpp @@ -402,10 +402,10 @@ FX_BOOL Document::mailForm(IJS_Context* cc, return FALSE; pRuntime->BeginBlock(); - CPDFSDK_FormFillEnvironment* pEnv = pContext->GetFormFillEnv(); - pEnv->JS_docmailForm(textBuf.GetBuffer(), textBuf.GetLength(), bUI, - cTo.c_str(), cSubject.c_str(), cCc.c_str(), cBcc.c_str(), - cMsg.c_str()); + CPDFSDK_FormFillEnvironment* pFormFillEnv = pContext->GetFormFillEnv(); + pFormFillEnv->JS_docmailForm(textBuf.GetBuffer(), textBuf.GetLength(), bUI, + cTo.c_str(), cSubject.c_str(), cCc.c_str(), + cBcc.c_str(), cMsg.c_str()); pRuntime->EndBlock(); return TRUE; } @@ -751,9 +751,9 @@ FX_BOOL Document::mailDoc(IJS_Context* cc, } pRuntime->BeginBlock(); - CPDFSDK_FormFillEnvironment* pEnv = pRuntime->GetFormFillEnv(); - pEnv->JS_docmailForm(nullptr, 0, bUI, cTo.c_str(), cSubject.c_str(), - cCc.c_str(), cBcc.c_str(), cMsg.c_str()); + CPDFSDK_FormFillEnvironment* pFormFillEnv = pRuntime->GetFormFillEnv(); + pFormFillEnv->JS_docmailForm(nullptr, 0, bUI, cTo.c_str(), cSubject.c_str(), + cCc.c_str(), cBcc.c_str(), cMsg.c_str()); pRuntime->EndBlock(); return TRUE; diff --git a/fpdfsdk/javascript/PublicMethods.cpp b/fpdfsdk/javascript/PublicMethods.cpp index 344af5aa02..2310200084 100644 --- a/fpdfsdk/javascript/PublicMethods.cpp +++ b/fpdfsdk/javascript/PublicMethods.cpp @@ -79,9 +79,9 @@ CFX_WideString StrTrim(const CFX_WideString& pStr) { } void AlertIfPossible(CJS_Context* pContext, const FX_WCHAR* swMsg) { - CPDFSDK_FormFillEnvironment* pEnv = pContext->GetFormFillEnv(); - if (pEnv) - pEnv->JS_appAlert(swMsg, nullptr, 0, 3); + CPDFSDK_FormFillEnvironment* pFormFillEnv = pContext->GetFormFillEnv(); + if (pFormFillEnv) + pFormFillEnv->JS_appAlert(swMsg, nullptr, 0, 3); } } // namespace diff --git a/fpdfsdk/javascript/global.cpp b/fpdfsdk/javascript/global.cpp index 3ac8c40384..eb7d2cac19 100644 --- a/fpdfsdk/javascript/global.cpp +++ b/fpdfsdk/javascript/global.cpp @@ -49,16 +49,16 @@ JSGlobalData::~JSGlobalData() { } JSGlobalAlternate::JSGlobalAlternate(CJS_Object* pJSObject) - : CJS_EmbedObj(pJSObject), m_pEnv(nullptr) {} + : CJS_EmbedObj(pJSObject), m_pFormFillEnv(nullptr) {} JSGlobalAlternate::~JSGlobalAlternate() { DestroyGlobalPersisitentVariables(); m_pGlobalData->Release(); } -void JSGlobalAlternate::Initial(CPDFSDK_FormFillEnvironment* pEnv) { - m_pEnv = pEnv; - m_pGlobalData = CJS_GlobalData::GetRetainedInstance(pEnv); +void JSGlobalAlternate::Initial(CPDFSDK_FormFillEnvironment* pFormFillEnv) { + m_pFormFillEnv = pFormFillEnv; + m_pGlobalData = CJS_GlobalData::GetRetainedInstance(pFormFillEnv); UpdateGlobalPersistentVariables(); } diff --git a/fpdfsdk/javascript/global.h b/fpdfsdk/javascript/global.h index 6240fbfd4f..d5288e38b1 100644 --- a/fpdfsdk/javascript/global.h +++ b/fpdfsdk/javascript/global.h @@ -47,7 +47,7 @@ class JSGlobalAlternate : public CJS_EmbedObj { FX_BOOL DelProperty(IJS_Context* cc, const FX_WCHAR* propname, CFX_WideString& sError); - void Initial(CPDFSDK_FormFillEnvironment* pEnv); + void Initial(CPDFSDK_FormFillEnvironment* pFormFillEnv); private: void UpdateGlobalPersistentVariables(); @@ -68,7 +68,7 @@ class JSGlobalAlternate : public CJS_EmbedObj { std::map<CFX_ByteString, JSGlobalData*> m_mapGlobal; CFX_WideString m_sFilePath; CJS_GlobalData* m_pGlobalData; - CPDFSDK_FormFillEnvironment* m_pEnv; + CPDFSDK_FormFillEnvironment* m_pFormFillEnv; }; class CJS_Global : public CJS_Object { |