summaryrefslogtreecommitdiff
path: root/fpdfsdk/formfiller/cffl_formfiller.cpp
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2017-06-02 00:45:14 -0700
committerChromium commit bot <commit-bot@chromium.org>2017-06-02 18:31:20 +0000
commit4f34c64914be17966f2d91591921dec635582061 (patch)
tree762d9af8dd0aaeb084a007e6133418e56f6a7605 /fpdfsdk/formfiller/cffl_formfiller.cpp
parentdd29c258fbf7838ddd0ee99361beb4c2da8dce7f (diff)
downloadpdfium-4f34c64914be17966f2d91591921dec635582061.tar.xz
Clean up CFFL formfiller classes.
- Consolidate assertions for m_pFormFillEnv. - Remove check for m_pFormFillEnv being NULL. - Pass in a CPDFSDK_Widget* instead of an Annot* and then casting. - Remove unused LoadPopupMenuString() method. Change-Id: Ic22e75c9e41eb54002be812945a3ee80debeca8b Reviewed-on: https://pdfium-review.googlesource.com/6232 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'fpdfsdk/formfiller/cffl_formfiller.cpp')
-rw-r--r--fpdfsdk/formfiller/cffl_formfiller.cpp21
1 files changed, 6 insertions, 15 deletions
diff --git a/fpdfsdk/formfiller/cffl_formfiller.cpp b/fpdfsdk/formfiller/cffl_formfiller.cpp
index b104d67b6d..f15efd2462 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_FormFillEnvironment* pFormFillEnv,
- CPDFSDK_Annot* pAnnot)
- : m_pFormFillEnv(pFormFillEnv), m_pAnnot(pAnnot), m_bValid(false) {
- m_pWidget = static_cast<CPDFSDK_Widget*>(pAnnot);
+ CPDFSDK_Widget* pWidget)
+ : m_pFormFillEnv(pFormFillEnv), m_pWidget(pWidget), m_bValid(false) {
+ ASSERT(m_pFormFillEnv);
}
CFFL_FormFiller::~CFFL_FormFiller() {
@@ -282,8 +282,6 @@ bool CFFL_FormFiller::IsValid() const {
}
PWL_CREATEPARAM CFFL_FormFiller::GetCreateParam() {
- ASSERT(m_pFormFillEnv);
-
PWL_CREATEPARAM cp;
cp.pParentWnd = nullptr;
cp.pProvider.Reset(this);
@@ -422,12 +420,6 @@ CFX_Matrix CFFL_FormFiller::GetCurMatrix() {
return mt;
}
-CFX_WideString CFFL_FormFiller::LoadPopupMenuString(int nIndex) {
- ASSERT(m_pFormFillEnv);
-
- return L"";
-}
-
CFX_FloatRect CFFL_FormFiller::GetPDFWindowRect() const {
CFX_FloatRect rectAnnot = m_pWidget->GetPDFAnnot()->GetRect();
@@ -440,8 +432,8 @@ CFX_FloatRect CFFL_FormFiller::GetPDFWindowRect() const {
}
CPDFSDK_PageView* CFFL_FormFiller::GetCurPageView(bool renew) {
- UnderlyingPageType* pPage = m_pAnnot->GetUnderlyingPage();
- return m_pFormFillEnv ? m_pFormFillEnv->GetPageView(pPage, renew) : nullptr;
+ UnderlyingPageType* pPage = m_pWidget->GetUnderlyingPage();
+ return m_pFormFillEnv->GetPageView(pPage, renew);
}
CFX_FloatRect CFFL_FormFiller::GetFocusBox(CPDFSDK_PageView* pPageView) {
@@ -585,7 +577,7 @@ void CFFL_FormFiller::InvalidateRect(const FX_RECT& rect) {
}
CFFL_Button::CFFL_Button(CPDFSDK_FormFillEnvironment* pApp,
- CPDFSDK_Annot* pWidget)
+ CPDFSDK_Widget* pWidget)
: CFFL_FormFiller(pApp, pWidget), m_bMouseIn(false), m_bMouseDown(false) {}
CFFL_Button::~CFFL_Button() {}
@@ -636,7 +628,6 @@ bool CFFL_Button::OnMouseMove(CPDFSDK_PageView* pPageView,
CPDFSDK_Annot* pAnnot,
uint32_t nFlags,
const CFX_PointF& point) {
- ASSERT(m_pFormFillEnv);
return true;
}