From 5819e4f334521cb1599f3d5f1f28df40528727ba Mon Sep 17 00:00:00 2001 From: dsinclair Date: Wed, 21 Sep 2016 10:14:10 -0700 Subject: Rename m_pApp to m_pEnv The m_pApp variable holds a CPDFSDK_Environment. This Cl renames the variable to be m_pEnv so as not to confuse with the various App classes that exist. Review-Url: https://codereview.chromium.org/2357293002 --- fpdfsdk/formfiller/cffl_checkbox.cpp | 2 +- fpdfsdk/formfiller/cffl_combobox.cpp | 6 +-- fpdfsdk/formfiller/cffl_formfiller.cpp | 24 +++++------ fpdfsdk/formfiller/cffl_formfiller.h | 7 ++-- fpdfsdk/formfiller/cffl_iformfiller.cpp | 72 ++++++++++++++++----------------- fpdfsdk/formfiller/cffl_iformfiller.h | 4 +- fpdfsdk/formfiller/cffl_listbox.cpp | 4 +- fpdfsdk/formfiller/cffl_radiobutton.cpp | 2 +- fpdfsdk/formfiller/cffl_textfield.cpp | 10 ++--- 9 files changed, 65 insertions(+), 66 deletions(-) diff --git a/fpdfsdk/formfiller/cffl_checkbox.cpp b/fpdfsdk/formfiller/cffl_checkbox.cpp index 9b9245d410..ef1bf18ea6 100644 --- a/fpdfsdk/formfiller/cffl_checkbox.cpp +++ b/fpdfsdk/formfiller/cffl_checkbox.cpp @@ -42,7 +42,7 @@ FX_BOOL CFFL_CheckBox::OnChar(CPDFSDK_Annot* pAnnot, switch (nChar) { case FWL_VKEY_Return: case FWL_VKEY_Space: { - CFFL_IFormFiller* pIFormFiller = m_pApp->GetIFormFiller(); + CFFL_IFormFiller* pIFormFiller = m_pEnv->GetIFormFiller(); ASSERT(pIFormFiller); CPDFSDK_PageView* pPageView = pAnnot->GetPageView(); diff --git a/fpdfsdk/formfiller/cffl_combobox.cpp b/fpdfsdk/formfiller/cffl_combobox.cpp index 40e5c346b2..84e242ab5c 100644 --- a/fpdfsdk/formfiller/cffl_combobox.cpp +++ b/fpdfsdk/formfiller/cffl_combobox.cpp @@ -54,7 +54,7 @@ CPWL_Wnd* CFFL_ComboBox::NewPDFWindow(const PWL_CREATEPARAM& cp, pWnd->AttachFFLData(this); pWnd->Create(cp); - CFFL_IFormFiller* pFormFiller = m_pApp->GetIFormFiller(); + CFFL_IFormFiller* pFormFiller = m_pEnv->GetIFormFiller(); pWnd->SetFillerNotify(pFormFiller); int32_t nCurSel = m_pWidget->GetSelectedIndex(0); @@ -259,7 +259,7 @@ FX_BOOL CFFL_ComboBox::IsFieldFull(CPDFSDK_PageView* pPageView) { #endif // PDF_ENABLE_XFA void CFFL_ComboBox::OnSetFocus(CPWL_Wnd* pWnd) { - ASSERT(m_pApp); + ASSERT(m_pEnv); if (pWnd->GetClassName() == PWL_CLASSNAME_EDIT) { CPWL_Edit* pEdit = (CPWL_Edit*)pWnd; @@ -271,7 +271,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_pApp->OnSetFieldInputFocus(m_pWidget->GetFormField(), pBuffer, + m_pEnv->OnSetFieldInputFocus(m_pWidget->GetFormField(), pBuffer, nCharacters, TRUE); } } diff --git a/fpdfsdk/formfiller/cffl_formfiller.cpp b/fpdfsdk/formfiller/cffl_formfiller.cpp index e2f5be197f..889f3b46a1 100644 --- a/fpdfsdk/formfiller/cffl_formfiller.cpp +++ b/fpdfsdk/formfiller/cffl_formfiller.cpp @@ -22,9 +22,9 @@ #define FFL_HINT_ELAPSE 800 -CFFL_FormFiller::CFFL_FormFiller(CPDFSDK_Environment* pApp, +CFFL_FormFiller::CFFL_FormFiller(CPDFSDK_Environment* pEnv, CPDFSDK_Annot* pAnnot) - : m_pApp(pApp), m_pAnnot(pAnnot), m_bValid(FALSE) { + : m_pEnv(pEnv), m_pAnnot(pAnnot), m_bValid(FALSE) { m_pWidget = static_cast(pAnnot); } @@ -251,7 +251,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_Document* pDoc = m_pApp->GetSDKDocument(); + CPDFSDK_Document* pDoc = m_pEnv->GetSDKDocument(); CPDFSDK_PageView* pPageView = pDoc->GetPageView(pPage, true); if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, TRUE)) pWnd->SetFocus(); @@ -293,7 +293,7 @@ FX_BOOL CFFL_FormFiller::IsValid() const { } PWL_CREATEPARAM CFFL_FormFiller::GetCreateParam() { - ASSERT(m_pApp); + ASSERT(m_pEnv); PWL_CREATEPARAM cp; cp.pParentWnd = nullptr; @@ -345,7 +345,7 @@ PWL_CREATEPARAM CFFL_FormFiller::GetCreateParam() { dwCreateFlags |= PWS_AUTOFONTSIZE; cp.dwFlags = dwCreateFlags; - cp.pSystemHandler = m_pApp->GetSysHandler(); + cp.pSystemHandler = m_pEnv->GetSysHandler(); return cp; } @@ -440,7 +440,7 @@ CFX_Matrix CFFL_FormFiller::GetCurMatrix() { } CFX_WideString CFFL_FormFiller::LoadPopupMenuString(int nIndex) { - ASSERT(m_pApp); + ASSERT(m_pEnv); return L""; } @@ -458,7 +458,7 @@ CFX_FloatRect CFFL_FormFiller::GetPDFWindowRect() const { CPDFSDK_PageView* CFFL_FormFiller::GetCurPageView(bool renew) { UnderlyingPageType* pPage = m_pAnnot->GetUnderlyingPage(); - CPDFSDK_Document* pSDKDoc = m_pApp->GetSDKDocument(); + CPDFSDK_Document* pSDKDoc = m_pEnv->GetSDKDocument(); return pSDKDoc ? pSDKDoc->GetPageView(pPage, renew) : nullptr; } @@ -525,7 +525,7 @@ FX_BOOL CFFL_FormFiller::CommitData(CPDFSDK_PageView* pPageView, if (IsDataChanged(pPageView)) { FX_BOOL bRC = TRUE; FX_BOOL bExit = FALSE; - CFFL_IFormFiller* pIFormFiller = m_pApp->GetIFormFiller(); + CFFL_IFormFiller* pIFormFiller = m_pEnv->GetIFormFiller(); pIFormFiller->OnKeyStrokeCommit(m_pWidget, pPageView, bRC, bExit, nFlag); if (bExit) return TRUE; @@ -565,7 +565,7 @@ FX_BOOL CFFL_FormFiller::IsFieldFull(CPDFSDK_PageView* pPageView) { #endif // PDF_ENABLE_XFA void CFFL_FormFiller::SetChangeMark() { - m_pApp->OnChange(); + m_pEnv->OnChange(); } void CFFL_FormFiller::GetActionData(CPDFSDK_PageView* pPageView, @@ -596,7 +596,7 @@ CPWL_Wnd* CFFL_FormFiller::ResetPDFWindow(CPDFSDK_PageView* pPageView, void CFFL_FormFiller::TimerProc() {} CFX_SystemHandler* CFFL_FormFiller::GetSystemHandler() const { - return m_pApp->GetSysHandler(); + return m_pEnv->GetSysHandler(); } void CFFL_FormFiller::EscapeFiller(CPDFSDK_PageView* pPageView, @@ -615,7 +615,7 @@ void CFFL_FormFiller::InvalidateRect(double left, double right, double bottom) { UnderlyingPageType* pPage = m_pWidget->GetUnderlyingPage(); - m_pApp->Invalidate(pPage, left, top, right, bottom); + m_pEnv->Invalidate(pPage, left, top, right, bottom); } CFFL_Button::CFFL_Button(CPDFSDK_Environment* pApp, CPDFSDK_Annot* pWidget) @@ -675,7 +675,7 @@ FX_BOOL CFFL_Button::OnMouseMove(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, uint32_t nFlags, const CFX_FloatPoint& point) { - ASSERT(m_pApp); + ASSERT(m_pEnv); return TRUE; } diff --git a/fpdfsdk/formfiller/cffl_formfiller.h b/fpdfsdk/formfiller/cffl_formfiller.h index 9d2b66b769..d2f2fe6230 100644 --- a/fpdfsdk/formfiller/cffl_formfiller.h +++ b/fpdfsdk/formfiller/cffl_formfiller.h @@ -20,7 +20,7 @@ class CPDFSDK_Widget; class CFFL_FormFiller : public IPWL_Provider, public CPWL_TimerHandler { public: - CFFL_FormFiller(CPDFSDK_Environment* pApp, CPDFSDK_Annot* pAnnot); + CFFL_FormFiller(CPDFSDK_Environment* pEnv, CPDFSDK_Annot* pAnnot); ~CFFL_FormFiller() override; virtual FX_RECT GetViewBBox(CPDFSDK_PageView* pPageView, @@ -148,7 +148,6 @@ class CFFL_FormFiller : public IPWL_Provider, public CPWL_TimerHandler { double top, double right, double bottom); - CPDFSDK_Environment* GetApp() { return m_pApp; } CPDFSDK_Annot* GetSDKAnnot() { return m_pAnnot; } protected: @@ -162,7 +161,7 @@ class CFFL_FormFiller : public IPWL_Provider, public CPWL_TimerHandler { // until the PWL_Edit is done with it. pdfium:566 void DestroyWindows(); - CPDFSDK_Environment* m_pApp; + CPDFSDK_Environment* m_pEnv; CPDFSDK_Widget* m_pWidget; CPDFSDK_Annot* m_pAnnot; @@ -173,7 +172,7 @@ class CFFL_FormFiller : public IPWL_Provider, public CPWL_TimerHandler { class CFFL_Button : public CFFL_FormFiller { public: - CFFL_Button(CPDFSDK_Environment* pApp, CPDFSDK_Annot* pWidget); + CFFL_Button(CPDFSDK_Environment* pEnv, CPDFSDK_Annot* pWidget); ~CFFL_Button() override; // CFFL_FormFiller diff --git a/fpdfsdk/formfiller/cffl_iformfiller.cpp b/fpdfsdk/formfiller/cffl_iformfiller.cpp index a81b486865..83e91982cc 100644 --- a/fpdfsdk/formfiller/cffl_iformfiller.cpp +++ b/fpdfsdk/formfiller/cffl_iformfiller.cpp @@ -27,8 +27,8 @@ #define FFL_MAXLISTBOXHEIGHT 140.0f -CFFL_IFormFiller::CFFL_IFormFiller(CPDFSDK_Environment* pApp) - : m_pApp(pApp), m_bNotifying(FALSE) {} +CFFL_IFormFiller::CFFL_IFormFiller(CPDFSDK_Environment* pEnv) + : m_pEnv(pEnv), m_bNotifying(FALSE) {} CFFL_IFormFiller::~CFFL_IFormFiller() {} @@ -66,7 +66,7 @@ void CFFL_IFormFiller::OnDraw(CPDFSDK_PageView* pPageView, pFormFiller->OnDraw(pPageView, pAnnot, pDevice, pUser2Device); pAnnot->GetPDFPage(); - CPDFSDK_Document* pDocument = m_pApp->GetSDKDocument(); + CPDFSDK_Document* pDocument = m_pEnv->GetSDKDocument(); if (pDocument->GetFocusAnnot() == pAnnot) { CFX_FloatRect rcFocus = pFormFiller->GetFocusBox(pPageView); if (!rcFocus.IsEmpty()) { @@ -138,8 +138,8 @@ void CFFL_IFormFiller::OnMouseEnter(CPDFSDK_PageView* pPageView, ASSERT(pPageView); PDFSDK_FieldAction fa; - fa.bModifier = m_pApp->IsCTRLKeyDown(nFlag); - fa.bShift = m_pApp->IsSHIFTKeyDown(nFlag); + fa.bModifier = m_pEnv->IsCTRLKeyDown(nFlag); + fa.bShift = m_pEnv->IsSHIFTKeyDown(nFlag); pWidget->OnAAction(CPDF_AAction::CursorEnter, fa, pPageView); m_bNotifying = FALSE; @@ -173,8 +173,8 @@ void CFFL_IFormFiller::OnMouseExit(CPDFSDK_PageView* pPageView, ASSERT(pPageView); PDFSDK_FieldAction fa; - fa.bModifier = m_pApp->IsCTRLKeyDown(nFlag); - fa.bShift = m_pApp->IsSHIFTKeyDown(nFlag); + fa.bModifier = m_pEnv->IsCTRLKeyDown(nFlag); + fa.bShift = m_pEnv->IsSHIFTKeyDown(nFlag); pWidget->OnAAction(CPDF_AAction::CursorExit, fa, pPageView); m_bNotifying = FALSE; @@ -211,8 +211,8 @@ FX_BOOL CFFL_IFormFiller::OnLButtonDown(CPDFSDK_PageView* pPageView, ASSERT(pPageView); PDFSDK_FieldAction fa; - fa.bModifier = m_pApp->IsCTRLKeyDown(nFlags); - fa.bShift = m_pApp->IsSHIFTKeyDown(nFlags); + fa.bModifier = m_pEnv->IsCTRLKeyDown(nFlags); + fa.bShift = m_pEnv->IsSHIFTKeyDown(nFlags); pWidget->OnAAction(CPDF_AAction::ButtonDown, fa, pPageView); m_bNotifying = FALSE; @@ -241,7 +241,7 @@ FX_BOOL CFFL_IFormFiller::OnLButtonUp(CPDFSDK_PageView* pPageView, const CFX_FloatPoint& point) { ASSERT(pAnnot->GetPDFAnnot()->GetSubtype() == CPDF_Annot::Subtype::WIDGET); CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot; - CPDFSDK_Document* pDocument = m_pApp->GetSDKDocument(); + CPDFSDK_Document* pDocument = m_pEnv->GetSDKDocument(); switch (pWidget->GetFieldType()) { case FIELDTYPE_PUSHBUTTON: @@ -292,8 +292,8 @@ void CFFL_IFormFiller::OnButtonUp(CPDFSDK_Widget* pWidget, ASSERT(pPageView); PDFSDK_FieldAction fa; - fa.bModifier = m_pApp->IsCTRLKeyDown(nFlag); - fa.bShift = m_pApp->IsSHIFTKeyDown(nFlag); + fa.bModifier = m_pEnv->IsCTRLKeyDown(nFlag); + fa.bShift = m_pEnv->IsSHIFTKeyDown(nFlag); pWidget->OnAAction(CPDF_AAction::ButtonUp, fa, pPageView); m_bNotifying = FALSE; @@ -426,8 +426,8 @@ FX_BOOL CFFL_IFormFiller::OnSetFocus(CPDFSDK_Annot* pAnnot, uint32_t nFlag) { ASSERT(pPageView); PDFSDK_FieldAction fa; - fa.bModifier = m_pApp->IsCTRLKeyDown(nFlag); - fa.bShift = m_pApp->IsSHIFTKeyDown(nFlag); + fa.bModifier = m_pEnv->IsCTRLKeyDown(nFlag); + fa.bShift = m_pEnv->IsSHIFTKeyDown(nFlag); CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, TRUE); if (!pFormFiller) @@ -469,8 +469,8 @@ FX_BOOL CFFL_IFormFiller::OnKillFocus(CPDFSDK_Annot* pAnnot, uint32_t nFlag) { ASSERT(pPageView); PDFSDK_FieldAction fa; - fa.bModifier = m_pApp->IsCTRLKeyDown(nFlag); - fa.bShift = m_pApp->IsSHIFTKeyDown(nFlag); + fa.bModifier = m_pEnv->IsCTRLKeyDown(nFlag); + fa.bShift = m_pEnv->IsSHIFTKeyDown(nFlag); pFormFiller->GetActionData(pPageView, CPDF_AAction::LoseFocus, fa); @@ -518,22 +518,22 @@ CFFL_FormFiller* CFFL_IFormFiller::GetFormFiller(CPDFSDK_Annot* pAnnot, CFFL_FormFiller* pFormFiller; switch (nFieldType) { case FIELDTYPE_PUSHBUTTON: - pFormFiller = new CFFL_PushButton(m_pApp, pWidget); + pFormFiller = new CFFL_PushButton(m_pEnv, pWidget); break; case FIELDTYPE_CHECKBOX: - pFormFiller = new CFFL_CheckBox(m_pApp, pWidget); + pFormFiller = new CFFL_CheckBox(m_pEnv, pWidget); break; case FIELDTYPE_RADIOBUTTON: - pFormFiller = new CFFL_RadioButton(m_pApp, pWidget); + pFormFiller = new CFFL_RadioButton(m_pEnv, pWidget); break; case FIELDTYPE_TEXTFIELD: - pFormFiller = new CFFL_TextField(m_pApp, pWidget); + pFormFiller = new CFFL_TextField(m_pEnv, pWidget); break; case FIELDTYPE_LISTBOX: - pFormFiller = new CFFL_ListBox(m_pApp, pWidget); + pFormFiller = new CFFL_ListBox(m_pEnv, pWidget); break; case FIELDTYPE_COMBOBOX: - pFormFiller = new CFFL_ComboBox(m_pApp, pWidget); + pFormFiller = new CFFL_ComboBox(m_pEnv, pWidget); break; case FIELDTYPE_UNKNOWN: default: @@ -648,8 +648,8 @@ void CFFL_IFormFiller::OnKeyStrokeCommit(CPDFSDK_Widget* pWidget, ASSERT(pPageView); PDFSDK_FieldAction fa; - fa.bModifier = m_pApp->IsCTRLKeyDown(nFlag); - fa.bShift = m_pApp->IsSHIFTKeyDown(nFlag); + fa.bModifier = m_pEnv->IsCTRLKeyDown(nFlag); + fa.bShift = m_pEnv->IsSHIFTKeyDown(nFlag); fa.bWillCommit = TRUE; fa.bKeyDown = TRUE; fa.bRC = TRUE; @@ -679,8 +679,8 @@ void CFFL_IFormFiller::OnValidate(CPDFSDK_Widget* pWidget, ASSERT(pPageView); PDFSDK_FieldAction fa; - fa.bModifier = m_pApp->IsCTRLKeyDown(nFlag); - fa.bShift = m_pApp->IsSHIFTKeyDown(nFlag); + fa.bModifier = m_pEnv->IsCTRLKeyDown(nFlag); + fa.bShift = m_pEnv->IsSHIFTKeyDown(nFlag); fa.bKeyDown = TRUE; fa.bRC = TRUE; @@ -747,8 +747,8 @@ void CFFL_IFormFiller::OnClick(CPDFSDK_Widget* pWidget, int nValueAge = pWidget->GetValueAge(); PDFSDK_FieldAction fa; - fa.bModifier = m_pApp->IsCTRLKeyDown(nFlag); - fa.bShift = m_pApp->IsSHIFTKeyDown(nFlag); + fa.bModifier = m_pEnv->IsCTRLKeyDown(nFlag); + fa.bShift = m_pEnv->IsSHIFTKeyDown(nFlag); pWidget->OnXFAAAction(PDFSDK_XFA_Click, fa, pPageView); m_bNotifying = FALSE; @@ -782,8 +782,8 @@ void CFFL_IFormFiller::OnFull(CPDFSDK_Widget* pWidget, int nValueAge = pWidget->GetValueAge(); PDFSDK_FieldAction fa; - fa.bModifier = m_pApp->IsCTRLKeyDown(nFlag); - fa.bShift = m_pApp->IsSHIFTKeyDown(nFlag); + fa.bModifier = m_pEnv->IsCTRLKeyDown(nFlag); + fa.bShift = m_pEnv->IsSHIFTKeyDown(nFlag); pWidget->OnXFAAAction(PDFSDK_XFA_Full, fa, pPageView); m_bNotifying = FALSE; @@ -849,8 +849,8 @@ void CFFL_IFormFiller::OnPreOpen(CPDFSDK_Widget* pWidget, int nValueAge = pWidget->GetValueAge(); PDFSDK_FieldAction fa; - fa.bModifier = m_pApp->IsCTRLKeyDown(nFlag); - fa.bShift = m_pApp->IsSHIFTKeyDown(nFlag); + fa.bModifier = m_pEnv->IsCTRLKeyDown(nFlag); + fa.bShift = m_pEnv->IsSHIFTKeyDown(nFlag); pWidget->OnXFAAAction(PDFSDK_XFA_PreOpen, fa, pPageView); m_bNotifying = FALSE; @@ -884,8 +884,8 @@ void CFFL_IFormFiller::OnPostOpen(CPDFSDK_Widget* pWidget, int nValueAge = pWidget->GetValueAge(); PDFSDK_FieldAction fa; - fa.bModifier = m_pApp->IsCTRLKeyDown(nFlag); - fa.bShift = m_pApp->IsSHIFTKeyDown(nFlag); + fa.bModifier = m_pEnv->IsCTRLKeyDown(nFlag); + fa.bShift = m_pEnv->IsSHIFTKeyDown(nFlag); pWidget->OnXFAAAction(PDFSDK_XFA_PostOpen, fa, pPageView); m_bNotifying = FALSE; @@ -952,8 +952,8 @@ void CFFL_IFormFiller::OnBeforeKeyStroke(void* pPrivateData, CPDFSDK_Document* pDocument = pData->pPageView->GetSDKDocument(); PDFSDK_FieldAction fa; - fa.bModifier = m_pApp->IsCTRLKeyDown(nFlag); - fa.bShift = m_pApp->IsSHIFTKeyDown(nFlag); + fa.bModifier = m_pEnv->IsCTRLKeyDown(nFlag); + fa.bShift = m_pEnv->IsSHIFTKeyDown(nFlag); fa.sChange = strChange; fa.sChangeEx = strChangeEx; fa.bKeyDown = bKeyDown; diff --git a/fpdfsdk/formfiller/cffl_iformfiller.h b/fpdfsdk/formfiller/cffl_iformfiller.h index ff942bedf1..f326123a47 100644 --- a/fpdfsdk/formfiller/cffl_iformfiller.h +++ b/fpdfsdk/formfiller/cffl_iformfiller.h @@ -21,7 +21,7 @@ class CPDFSDK_Widget; class CFFL_IFormFiller : public IPWL_Filler_Notify { public: - explicit CFFL_IFormFiller(CPDFSDK_Environment* pApp); + explicit CFFL_IFormFiller(CPDFSDK_Environment* pEnv); ~CFFL_IFormFiller() override; virtual FX_BOOL Annot_HitTest(CPDFSDK_PageView* pPageView, @@ -173,7 +173,7 @@ class CFFL_IFormFiller : public IPWL_Filler_Notify { #endif // PDF_ENABLE_XFA void UnRegisterFormFiller(CPDFSDK_Annot* pAnnot); - CPDFSDK_Environment* const m_pApp; + CPDFSDK_Environment* const m_pEnv; CFFL_Widget2Filler m_Maps; FX_BOOL m_bNotifying; }; diff --git a/fpdfsdk/formfiller/cffl_listbox.cpp b/fpdfsdk/formfiller/cffl_listbox.cpp index a089432477..0f253ec380 100644 --- a/fpdfsdk/formfiller/cffl_listbox.cpp +++ b/fpdfsdk/formfiller/cffl_listbox.cpp @@ -36,7 +36,7 @@ PWL_CREATEPARAM CFFL_ListBox::GetCreateParam() { cp.fFontSize = FFL_DEFAULTLISTBOXFONTSIZE; if (!m_pFontMap) - m_pFontMap.reset(new CBA_FontMap(m_pWidget, m_pApp->GetSysHandler())); + m_pFontMap.reset(new CBA_FontMap(m_pWidget, m_pEnv->GetSysHandler())); cp.pFontMap = m_pFontMap.get(); return cp; @@ -48,7 +48,7 @@ CPWL_Wnd* CFFL_ListBox::NewPDFWindow(const PWL_CREATEPARAM& cp, pWnd->AttachFFLData(this); pWnd->Create(cp); - CFFL_IFormFiller* pIFormFiller = m_pApp->GetIFormFiller(); + CFFL_IFormFiller* pIFormFiller = m_pEnv->GetIFormFiller(); pWnd->SetFillerNotify(pIFormFiller); for (int32_t i = 0, sz = m_pWidget->CountOptions(); i < sz; i++) diff --git a/fpdfsdk/formfiller/cffl_radiobutton.cpp b/fpdfsdk/formfiller/cffl_radiobutton.cpp index ec3aee3d8c..8e782d0eb9 100644 --- a/fpdfsdk/formfiller/cffl_radiobutton.cpp +++ b/fpdfsdk/formfiller/cffl_radiobutton.cpp @@ -46,7 +46,7 @@ FX_BOOL CFFL_RadioButton::OnChar(CPDFSDK_Annot* pAnnot, switch (nChar) { case FWL_VKEY_Return: case FWL_VKEY_Space: { - CFFL_IFormFiller* pIFormFiller = m_pApp->GetIFormFiller(); + CFFL_IFormFiller* pIFormFiller = m_pEnv->GetIFormFiller(); CPDFSDK_PageView* pPageView = pAnnot->GetPageView(); ASSERT(pPageView); diff --git a/fpdfsdk/formfiller/cffl_textfield.cpp b/fpdfsdk/formfiller/cffl_textfield.cpp index 9aad1894ae..aa3b87a09a 100644 --- a/fpdfsdk/formfiller/cffl_textfield.cpp +++ b/fpdfsdk/formfiller/cffl_textfield.cpp @@ -71,7 +71,7 @@ PWL_CREATEPARAM CFFL_TextField::GetCreateParam() { } if (!m_pFontMap) - m_pFontMap.reset(new CBA_FontMap(m_pWidget, m_pApp->GetSysHandler())); + m_pFontMap.reset(new CBA_FontMap(m_pWidget, m_pEnv->GetSysHandler())); cp.pFontMap = m_pFontMap.get(); cp.pFocusHandler = this; @@ -84,7 +84,7 @@ CPWL_Wnd* CFFL_TextField::NewPDFWindow(const PWL_CREATEPARAM& cp, pWnd->AttachFFLData(this); pWnd->Create(cp); - CFFL_IFormFiller* pIFormFiller = m_pApp->GetIFormFiller(); + CFFL_IFormFiller* pIFormFiller = m_pEnv->GetIFormFiller(); pWnd->SetFillerNotify(pIFormFiller); int32_t nMaxLen = m_pWidget->GetMaxLen(); @@ -113,7 +113,7 @@ FX_BOOL CFFL_TextField::OnChar(CPDFSDK_Annot* pAnnot, ASSERT(pPageView); m_bValid = !m_bValid; CFX_FloatRect rcAnnot = pAnnot->GetRect(); - m_pApp->Invalidate(pAnnot->GetUnderlyingPage(), rcAnnot.left, + m_pEnv->Invalidate(pAnnot->GetUnderlyingPage(), rcAnnot.left, rcAnnot.top, rcAnnot.right, rcAnnot.bottom); if (m_bValid) { @@ -269,7 +269,7 @@ FX_BOOL CFFL_TextField::IsFieldFull(CPDFSDK_PageView* pPageView) { #endif // PDF_ENABLE_XFA void CFFL_TextField::OnSetFocus(CPWL_Wnd* pWnd) { - ASSERT(m_pApp); + ASSERT(m_pEnv); if (pWnd->GetClassName() == PWL_CLASSNAME_EDIT) { CPWL_Edit* pEdit = (CPWL_Edit*)pWnd; pEdit->SetCharSet(FXFONT_GB2312_CHARSET); @@ -280,7 +280,7 @@ 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_pApp->OnSetFieldInputFocus(m_pWidget->GetFormField(), pBuffer, + m_pEnv->OnSetFieldInputFocus(m_pWidget->GetFormField(), pBuffer, nCharacters, TRUE); } } -- cgit v1.2.3