summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/formfiller
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2015-06-13 00:41:00 -0700
committerLei Zhang <thestig@chromium.org>2015-06-13 00:41:00 -0700
commit60f507ba36893edccb53aa13d7282144a1dd2499 (patch)
tree8855790710cffc564547e83ca5f755437a16088f /fpdfsdk/src/formfiller
parent4999f914be6c390bbc6d709c5b65d8955a827970 (diff)
downloadpdfium-60f507ba36893edccb53aa13d7282144a1dd2499.tar.xz
Merge to XFA: 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. (cherry picked from commit eda202769e5c79eba1d2fb5090f6e9cf176e2d4a) Review URL: https://codereview.chromium.org/1187733002.
Diffstat (limited to 'fpdfsdk/src/formfiller')
-rw-r--r--fpdfsdk/src/formfiller/FFL_ComboBox.cpp22
-rw-r--r--fpdfsdk/src/formfiller/FFL_FormFiller.cpp60
-rw-r--r--fpdfsdk/src/formfiller/FFL_ListBox.cpp14
-rw-r--r--fpdfsdk/src/formfiller/FFL_Notify.cpp20
-rw-r--r--fpdfsdk/src/formfiller/FFL_TextField.cpp11
5 files changed, 50 insertions, 77 deletions
diff --git a/fpdfsdk/src/formfiller/FFL_ComboBox.cpp b/fpdfsdk/src/formfiller/FFL_ComboBox.cpp
index 123c1cd24a..8ae9254470 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(); i<sz; i++)
-// {
-// delete m_IMBox.GetAt(i);
-// }
-//
-// m_IMBox.RemoveAll();
}
PWL_CREATEPARAM CFFL_ComboBox::GetCreateParam()
@@ -51,16 +43,8 @@ PWL_CREATEPARAM CFFL_ComboBox::GetCreateParam()
cp.dwFlags |= PCBS_ALLOWCUSTOMTEXT;
}
- /*
- if (nFlags & FIELDFLAG_COMMITONSELCHANGE)
- {
- m_bCommitOnSelectChange = TRUE;
- }
- */
-
if (!m_pFontMap)
{
- ASSERT(this->m_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 9fdcbbdc4a..1148c78a5f 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;
}
@@ -772,8 +771,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);
@@ -828,21 +827,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)
@@ -853,9 +849,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;
}
@@ -869,9 +864,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 fb7fec9ea7..9f0a8148cf 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();