From eda202769e5c79eba1d2fb5090f6e9cf176e2d4a Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Thu, 11 Jun 2015 13:03:09 -0700 Subject: Cleanup: Get this rid of "this->" in fpdfsdk/ Also remove commented out code and trailing whitespaces. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1179653005. --- fpdfsdk/src/formfiller/FFL_ComboBox.cpp | 22 ++---------- fpdfsdk/src/formfiller/FFL_FormFiller.cpp | 60 ++++++++++++++----------------- fpdfsdk/src/formfiller/FFL_ListBox.cpp | 14 +++----- fpdfsdk/src/formfiller/FFL_Notify.cpp | 20 ++++++----- fpdfsdk/src/formfiller/FFL_TextField.cpp | 11 +++--- 5 files changed, 50 insertions(+), 77 deletions(-) (limited to 'fpdfsdk/src/formfiller') diff --git a/fpdfsdk/src/formfiller/FFL_ComboBox.cpp b/fpdfsdk/src/formfiller/FFL_ComboBox.cpp index 3c74c9f7e1..e10c981d1a 100644 --- a/fpdfsdk/src/formfiller/FFL_ComboBox.cpp +++ b/fpdfsdk/src/formfiller/FFL_ComboBox.cpp @@ -16,7 +16,6 @@ CFFL_ComboBox::CFFL_ComboBox(CPDFDoc_Environment* pApp, CPDFSDK_Annot* pAnnot) : CFFL_FormFiller(pApp, pAnnot), m_pFontMap( NULL ) { - //m_pFontMap = new CBA_FontMap( pAnnot, GetSystemHandler() ); m_State.nIndex = 0; m_State.nStart = 0; m_State.nEnd = 0; @@ -29,13 +28,6 @@ CFFL_ComboBox::~CFFL_ComboBox() delete m_pFontMap; m_pFontMap = NULL; } - -// for (int i=0,sz=m_IMBox.GetSize(); im_pApp != NULL); m_pFontMap = new CBA_FontMap(m_pWidget, GetSystemHandler()); m_pFontMap->Initial(); } @@ -311,10 +295,10 @@ CPWL_Wnd* CFFL_ComboBox::ResetPDFWindow(CPDFSDK_PageView* pPageView, FX_BOOL bRe if (bRestoreValue) { RestoreState(pPageView); - pRet = this->GetPDFWindow(pPageView, FALSE); + pRet = GetPDFWindow(pPageView, FALSE); } else - pRet = this->GetPDFWindow(pPageView, TRUE); + pRet = GetPDFWindow(pPageView, TRUE); m_pWidget->UpdateField(); @@ -331,7 +315,7 @@ void CFFL_ComboBox::OnKeyStroke(FX_BOOL bKeyDown, FX_UINT nFlag) { if (m_bValid) { - CPDFSDK_PageView* pPageView = this->GetCurPageView(); + CPDFSDK_PageView* pPageView = GetCurPageView(); ASSERT(pPageView != NULL); if (CommitData(pPageView, nFlag)) diff --git a/fpdfsdk/src/formfiller/FFL_FormFiller.cpp b/fpdfsdk/src/formfiller/FFL_FormFiller.cpp index 1e2db7004a..d9a9848ec5 100644 --- a/fpdfsdk/src/formfiller/FFL_FormFiller.cpp +++ b/fpdfsdk/src/formfiller/FFL_FormFiller.cpp @@ -49,7 +49,7 @@ CFFL_FormFiller::~CFFL_FormFiller() void CFFL_FormFiller::SetWindowRect(CPDFSDK_PageView* pPageView, const CPDF_Rect& rcWindow) { - if (CPWL_Wnd* pWnd = this->GetPDFWindow(pPageView, FALSE)) + if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, FALSE)) { pWnd->Move(CPDF_Rect(rcWindow), TRUE, FALSE); } @@ -57,7 +57,7 @@ void CFFL_FormFiller::SetWindowRect(CPDFSDK_PageView* pPageView, const CPDF_Rect CPDF_Rect CFFL_FormFiller::GetWindowRect(CPDFSDK_PageView* pPageView) { - if (CPWL_Wnd* pWnd = this->GetPDFWindow(pPageView, FALSE)) + if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, FALSE)) { return pWnd->GetWindowRect(); } @@ -72,16 +72,15 @@ FX_RECT CFFL_FormFiller::GetViewBBox(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* CPDF_Rect rcAnnot = m_pWidget->GetRect(); - if (CPWL_Wnd* pWnd = this->GetPDFWindow(pPageView, FALSE)) + if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, FALSE)) { CPDF_Rect rcWindow = pWnd->GetWindowRect(); rcAnnot = PWLtoFFL(rcWindow); } CPDF_Rect rcWin = rcAnnot; -// pPageView->DocToWindow(rcAnnot, rcWin); - CPDF_Rect rcFocus = this->GetFocusBox(pPageView); + CPDF_Rect rcFocus = GetFocusBox(pPageView); if (!rcFocus.IsEmpty()) rcWin.Union(rcFocus); @@ -98,7 +97,7 @@ void CFFL_FormFiller::OnDraw(CPDFSDK_PageView *pPageView, /*HDC hDC,*/ CPDFSDK_A if (CPWL_Wnd * pWnd = GetPDFWindow(pPageView, FALSE)) { - CPDF_Matrix mt = this->GetCurMatrix(); + CPDF_Matrix mt = GetCurMatrix(); mt.Concat(*pUser2Device); pWnd->DrawAppearance(pDevice,&mt); } @@ -149,8 +148,8 @@ FX_BOOL CFFL_FormFiller::OnLButtonDown(CPDFSDK_PageView *pPageView, CPDFSDK_Anno if (CPWL_Wnd * pWnd = GetPDFWindow(pPageView, TRUE)) { m_bValid = TRUE; - FX_RECT rect = this->GetViewBBox(pPageView,pAnnot); - this->InvalidateRect(rect.left, rect.top, rect.right, rect.bottom); + FX_RECT rect = GetViewBBox(pPageView,pAnnot); + InvalidateRect(rect.left, rect.top, rect.right, rect.bottom); if(!rect.Contains((int)point.x, (int)point.y)) return FALSE; @@ -165,8 +164,8 @@ FX_BOOL CFFL_FormFiller::OnLButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* { if (CPWL_Wnd * pWnd = GetPDFWindow(pPageView, FALSE)) { - FX_RECT rcFFL = this->GetViewBBox(pPageView, pAnnot); - this->InvalidateRect(rcFFL.left, rcFFL.top, rcFFL.right, rcFFL.bottom); + FX_RECT rcFFL = GetViewBBox(pPageView, pAnnot); + InvalidateRect(rcFFL.left, rcFFL.top, rcFFL.right, rcFFL.bottom); pWnd->OnLButtonUp(WndtoPWL(pPageView, point),nFlags); return TRUE; } @@ -250,7 +249,7 @@ FX_BOOL CFFL_FormFiller::OnKeyDown(CPDFSDK_Annot* pAnnot, FX_UINT nKeyCode, FX_U { if (IsValid()) { - CPDFSDK_PageView* pPageView = this->GetCurPageView(); + CPDFSDK_PageView* pPageView = GetCurPageView(); ASSERT(pPageView != NULL); if (CPWL_Wnd * pWnd = GetPDFWindow(pPageView, FALSE)) @@ -266,7 +265,7 @@ FX_BOOL CFFL_FormFiller::OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nF { if (IsValid()) { - CPDFSDK_PageView* pPageView = this->GetCurPageView(); + CPDFSDK_PageView* pPageView = GetCurPageView(); ASSERT(pPageView != NULL); if (CPWL_Wnd * pWnd = GetPDFWindow(pPageView, FALSE)) @@ -311,8 +310,8 @@ FX_BOOL CFFL_FormFiller::OnSetFocus(CPDFSDK_Annot* pAnnot, FX_UINT nFlag) m_bValid = TRUE; - FX_RECT rcRect = this->GetViewBBox(pPageView,pAnnot); - this->InvalidateRect(rcRect.left, rcRect.top, rcRect.right, rcRect.bottom); + FX_RECT rcRect = GetViewBBox(pPageView,pAnnot); + InvalidateRect(rcRect.left, rcRect.top, rcRect.right, rcRect.bottom); return TRUE; } @@ -321,7 +320,7 @@ FX_BOOL CFFL_FormFiller::OnKillFocus(CPDFSDK_Annot* pAnnot, FX_UINT nFlag) { if (IsValid()) { - CPDFSDK_PageView* pPageView = this->GetCurPageView(); + CPDFSDK_PageView* pPageView = GetCurPageView(); ASSERT(pPageView != NULL); CommitData(pPageView, nFlag); @@ -446,7 +445,7 @@ CPWL_Wnd* CFFL_FormFiller::GetPDFWindow(CPDFSDK_PageView* pPageView, FX_BOOL bNe if (pPrivateData->nWidgetAge != m_pWidget->GetAppearanceAge()) { - return this->ResetPDFWindow(pPageView, m_pWidget->GetValueAge() == pPrivateData->nValueAge); + return ResetPDFWindow(pPageView, m_pWidget->GetValueAge() == pPrivateData->nValueAge); } } else @@ -677,7 +676,7 @@ FX_BOOL CFFL_FormFiller::CommitData(CPDFSDK_PageView* pPageView, FX_UINT nFlag) if (bExit) return TRUE; if (!bRC) { - this->ResetPDFWindow(pPageView, FALSE); + ResetPDFWindow(pPageView, FALSE); return TRUE; } @@ -685,7 +684,7 @@ FX_BOOL CFFL_FormFiller::CommitData(CPDFSDK_PageView* pPageView, FX_UINT nFlag) if (bExit) return TRUE; if (!bRC) { - this->ResetPDFWindow(pPageView, FALSE); + ResetPDFWindow(pPageView, FALSE); return TRUE; } @@ -767,8 +766,8 @@ void CFFL_FormFiller::EscapeFiller(CPDFSDK_PageView* pPageView, FX_BOOL bDestroy { m_bValid = FALSE; - FX_RECT rcRect = this->GetViewBBox(pPageView, m_pWidget); - this->InvalidateRect(rcRect.left, rcRect.top, rcRect.right, rcRect.bottom); + FX_RECT rcRect = GetViewBBox(pPageView, m_pWidget); + InvalidateRect(rcRect.left, rcRect.top, rcRect.right, rcRect.bottom); if(bDestroyPDFWindow) DestroyPDFWindow(pPageView); @@ -823,21 +822,18 @@ CFFL_Button::~CFFL_Button() void CFFL_Button::OnMouseEnter(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot) { m_bMouseIn = TRUE; - FX_RECT rect = this->GetViewBBox(pPageView,pAnnot); - this->InvalidateRect(rect.left, rect.top, rect.right, rect.bottom); -// ::InvalidateRect(pPageView->GetPageViewWnd(), &this->GetViewBBox(pPageView, pAnnot), TRUE); + FX_RECT rect = GetViewBBox(pPageView,pAnnot); + InvalidateRect(rect.left, rect.top, rect.right, rect.bottom); } void CFFL_Button::OnMouseExit(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot) { m_bMouseIn = FALSE; - FX_RECT rect = this->GetViewBBox(pPageView,pAnnot); - this->InvalidateRect(rect.left, rect.top, rect.right, rect.bottom); -// ::InvalidateRect(pPageView->GetPageViewWnd(), &this->GetViewBBox(pPageView, pAnnot), TRUE); + FX_RECT rect = GetViewBBox(pPageView,pAnnot); + InvalidateRect(rect.left, rect.top, rect.right, rect.bottom); EndTimer(); ASSERT(m_pWidget != NULL); -// m_pWidget->HideHint(); } FX_BOOL CFFL_Button::OnLButtonDown(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point) @@ -848,9 +844,8 @@ FX_BOOL CFFL_Button::OnLButtonDown(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* p m_bMouseDown = TRUE; m_bValid = TRUE; - FX_RECT rect = this->GetViewBBox(pPageView, pAnnot); - this->InvalidateRect(rect.left, rect.top, rect.right, rect.bottom); -// ::InvalidateRect(pPageView->GetPageViewWnd(), &this->GetViewBBox(pPageView, pAnnot), TRUE); + FX_RECT rect = GetViewBBox(pPageView, pAnnot); + InvalidateRect(rect.left, rect.top, rect.right, rect.bottom); return TRUE; } @@ -864,9 +859,8 @@ FX_BOOL CFFL_Button::OnLButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAn m_pWidget->GetPDFPage(); - FX_RECT rect = this->GetViewBBox(pPageView, pAnnot); - this->InvalidateRect(rect.left, rect.top, rect.right, rect.bottom); -// ::InvalidateRect(pPageView->GetPageViewWnd(), &this->GetViewBBox(pPageView, pAnnot), TRUE); + FX_RECT rect = GetViewBBox(pPageView, pAnnot); + InvalidateRect(rect.left, rect.top, rect.right, rect.bottom); return TRUE; } diff --git a/fpdfsdk/src/formfiller/FFL_ListBox.cpp b/fpdfsdk/src/formfiller/FFL_ListBox.cpp index 6b0aa1b347..6ee608a5bb 100644 --- a/fpdfsdk/src/formfiller/FFL_ListBox.cpp +++ b/fpdfsdk/src/formfiller/FFL_ListBox.cpp @@ -45,11 +45,6 @@ PWL_CREATEPARAM CFFL_ListBox::GetCreateParam() cp.dwFlags |= PLBS_MULTIPLESEL; } - if (dwFieldFlag & FIELDFLAG_COMMITONSELCHANGE) - { - //cp.dwFlags |= PLBS_COMMITSELECTEDVALUE; - } - cp.dwFlags |= PWS_VSCROLL; if (cp.dwFlags & PWS_AUTOFONTSIZE) @@ -57,8 +52,7 @@ PWL_CREATEPARAM CFFL_ListBox::GetCreateParam() if (!m_pFontMap) { - ASSERT(this->m_pApp != NULL); - m_pFontMap = new CBA_FontMap(m_pWidget,m_pApp->GetSysHandler());//, ISystemHandle::GetSystemHandler(m_pApp)); + m_pFontMap = new CBA_FontMap(m_pWidget, m_pApp->GetSysHandler()); m_pFontMap->Initial(); } cp.pFontMap = m_pFontMap; @@ -283,10 +277,10 @@ CPWL_Wnd* CFFL_ListBox::ResetPDFWindow(CPDFSDK_PageView* pPageView, FX_BOOL bRes if (bRestoreValue) { RestoreState(pPageView); - pRet = this->GetPDFWindow(pPageView, FALSE); + pRet = GetPDFWindow(pPageView, FALSE); } else - pRet = this->GetPDFWindow(pPageView, TRUE); + pRet = GetPDFWindow(pPageView, TRUE); m_pWidget->UpdateField(); @@ -303,7 +297,7 @@ void CFFL_ListBox::OnKeyStroke(FX_BOOL bKeyDown, FX_DWORD nFlag) { if (m_bValid) { - CPDFSDK_PageView* pPageView = this->GetCurPageView(); + CPDFSDK_PageView* pPageView = GetCurPageView(); ASSERT(pPageView != NULL); if (CommitData(pPageView, nFlag)) diff --git a/fpdfsdk/src/formfiller/FFL_Notify.cpp b/fpdfsdk/src/formfiller/FFL_Notify.cpp index 406aa8d489..4fd2bd84ea 100644 --- a/fpdfsdk/src/formfiller/FFL_Notify.cpp +++ b/fpdfsdk/src/formfiller/FFL_Notify.cpp @@ -111,15 +111,17 @@ FX_BOOL CFFL_Notify::OnValidate(CPDF_FormField* pFormField, CFX_WideString& strV FX_BOOL CFFL_Notify::DoAAction(CPDF_AAction::AActionType eAAT, FX_BOOL & bExit) { - if (this->m_bDoActioning) return FALSE; - - CPDF_Action action; - if (!FindAAction(eAAT,action)) return FALSE; - - this->m_bDoActioning = TRUE; - ExecuteActionTree(eAAT,action,bExit); - this->m_bDoActioning = FALSE; - return TRUE; + if (m_bDoActioning) + return FALSE; + + CPDF_Action action; + if (!FindAAction(eAAT, action)) + return FALSE; + + m_bDoActioning = TRUE; + ExecuteActionTree(eAAT,action,bExit); + m_bDoActioning = FALSE; + return TRUE; } FX_BOOL CFFL_Notify::ExecuteActionTree(CPDF_AAction::AActionType eAAT,CPDF_Action & action, FX_BOOL& bExit) diff --git a/fpdfsdk/src/formfiller/FFL_TextField.cpp b/fpdfsdk/src/formfiller/FFL_TextField.cpp index cd0299ce1b..33fb751ff1 100644 --- a/fpdfsdk/src/formfiller/FFL_TextField.cpp +++ b/fpdfsdk/src/formfiller/FFL_TextField.cpp @@ -91,8 +91,7 @@ PWL_CREATEPARAM CFFL_TextField::GetCreateParam() if (!m_pFontMap) { - ASSERT(this->m_pApp != NULL); - m_pFontMap = new CBA_FontMap(m_pWidget, /*ISystemHandle::GetSystemHandler(m_pApp)*/m_pApp->GetSysHandler()); + m_pFontMap = new CBA_FontMap(m_pWidget, m_pApp->GetSysHandler()); m_pFontMap->Initial(); } cp.pFontMap = m_pFontMap; @@ -142,7 +141,7 @@ FX_BOOL CFFL_TextField::OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFl case FWL_VKEY_Return: if (!(m_pWidget->GetFieldFlags() & FIELDFLAG_MULTILINE)) { - CPDFSDK_PageView* pPageView = this->GetCurPageView(); + CPDFSDK_PageView* pPageView = GetCurPageView(); ASSERT(pPageView != NULL); m_bValid = !m_bValid; CPDF_Rect rcAnnot = pAnnot->GetRect(); @@ -169,7 +168,7 @@ FX_BOOL CFFL_TextField::OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFl break; case FWL_VKEY_Escape: { - CPDFSDK_PageView* pPageView = this->GetCurPageView(); + CPDFSDK_PageView* pPageView = GetCurPageView(); ASSERT(pPageView != NULL); EscapeFiller(pPageView,TRUE); return TRUE; @@ -308,10 +307,10 @@ CPWL_Wnd* CFFL_TextField::ResetPDFWindow(CPDFSDK_PageView* pPageView, FX_BOOL bR if (bRestoreValue) { RestoreState(pPageView); - pRet = this->GetPDFWindow(pPageView, FALSE); + pRet = GetPDFWindow(pPageView, FALSE); } else - pRet = this->GetPDFWindow(pPageView, TRUE); + pRet = GetPDFWindow(pPageView, TRUE); m_pWidget->UpdateField(); -- cgit v1.2.3