Remove unused parameters in CFFL_FormFiller methods.
Also devirtualized CFFL_FormFiller::GetViewBBox(), since it has no
overrides.
Change-Id: I7762d7ab6c78fa19cb8be3b574b7ce446d07f4be
Reviewed-on: https://pdfium-review.googlesource.com/c/51010
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
diff --git a/fpdfsdk/formfiller/cffl_button.cpp b/fpdfsdk/formfiller/cffl_button.cpp
index ea2315d..c961008 100644
--- a/fpdfsdk/formfiller/cffl_button.cpp
+++ b/fpdfsdk/formfiller/cffl_button.cpp
@@ -12,16 +12,14 @@
CFFL_Button::~CFFL_Button() {}
-void CFFL_Button::OnMouseEnter(CPDFSDK_PageView* pPageView,
- CPDFSDK_Annot* pAnnot) {
+void CFFL_Button::OnMouseEnter(CPDFSDK_PageView* pPageView) {
m_bMouseIn = true;
- InvalidateRect(GetViewBBox(pPageView, pAnnot));
+ InvalidateRect(GetViewBBox(pPageView));
}
-void CFFL_Button::OnMouseExit(CPDFSDK_PageView* pPageView,
- CPDFSDK_Annot* pAnnot) {
+void CFFL_Button::OnMouseExit(CPDFSDK_PageView* pPageView) {
m_bMouseIn = false;
- InvalidateRect(GetViewBBox(pPageView, pAnnot));
+ InvalidateRect(GetViewBBox(pPageView));
EndTimer();
ASSERT(m_pWidget);
}
@@ -35,7 +33,7 @@
m_bMouseDown = true;
m_bValid = true;
- InvalidateRect(GetViewBBox(pPageView, pAnnot));
+ InvalidateRect(GetViewBBox(pPageView));
return true;
}
@@ -48,12 +46,11 @@
m_bMouseDown = false;
m_pWidget->GetPDFPage();
- InvalidateRect(GetViewBBox(pPageView, pAnnot));
+ InvalidateRect(GetViewBBox(pPageView));
return true;
}
bool CFFL_Button::OnMouseMove(CPDFSDK_PageView* pPageView,
- CPDFSDK_Annot* pAnnot,
uint32_t nFlags,
const CFX_PointF& point) {
return true;
diff --git a/fpdfsdk/formfiller/cffl_button.h b/fpdfsdk/formfiller/cffl_button.h
index ad2eb5b..768c144 100644
--- a/fpdfsdk/formfiller/cffl_button.h
+++ b/fpdfsdk/formfiller/cffl_button.h
@@ -24,9 +24,8 @@
~CFFL_Button() override;
// CFFL_FormFiller
- void OnMouseEnter(CPDFSDK_PageView* pPageView,
- CPDFSDK_Annot* pAnnot) override;
- void OnMouseExit(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot) override;
+ void OnMouseEnter(CPDFSDK_PageView* pPageView) override;
+ void OnMouseExit(CPDFSDK_PageView* pPageView) override;
bool OnLButtonDown(CPDFSDK_PageView* pPageView,
CPDFSDK_Annot* pAnnot,
uint32_t nFlags,
@@ -36,7 +35,6 @@
uint32_t nFlags,
const CFX_PointF& point) override;
bool OnMouseMove(CPDFSDK_PageView* pPageView,
- CPDFSDK_Annot* pAnnot,
uint32_t nFlags,
const CFX_PointF& point) override;
void OnDraw(CPDFSDK_PageView* pPageView,
diff --git a/fpdfsdk/formfiller/cffl_checkbox.cpp b/fpdfsdk/formfiller/cffl_checkbox.cpp
index a40cfc6..553fa34 100644
--- a/fpdfsdk/formfiller/cffl_checkbox.cpp
+++ b/fpdfsdk/formfiller/cffl_checkbox.cpp
@@ -30,15 +30,13 @@
return std::move(pWnd);
}
-bool CFFL_CheckBox::OnKeyDown(CPDFSDK_Annot* pAnnot,
- uint32_t nKeyCode,
- uint32_t nFlags) {
+bool CFFL_CheckBox::OnKeyDown(uint32_t nKeyCode, uint32_t nFlags) {
switch (nKeyCode) {
case FWL_VKEY_Return:
case FWL_VKEY_Space:
return true;
default:
- return CFFL_FormFiller::OnKeyDown(pAnnot, nKeyCode, nFlags);
+ return CFFL_FormFiller::OnKeyDown(nKeyCode, nFlags);
}
}
bool CFFL_CheckBox::OnChar(CPDFSDK_Annot* pAnnot,
diff --git a/fpdfsdk/formfiller/cffl_checkbox.h b/fpdfsdk/formfiller/cffl_checkbox.h
index 25c6260..d590b50 100644
--- a/fpdfsdk/formfiller/cffl_checkbox.h
+++ b/fpdfsdk/formfiller/cffl_checkbox.h
@@ -22,9 +22,7 @@
std::unique_ptr<CPWL_Wnd> NewPWLWindow(
const CPWL_Wnd::CreateParams& cp,
std::unique_ptr<CPWL_Wnd::PrivateData> pAttachedData) override;
- bool OnKeyDown(CPDFSDK_Annot* pAnnot,
- uint32_t nKeyCode,
- uint32_t nFlags) override;
+ bool OnKeyDown(uint32_t nKeyCode, uint32_t nFlags) override;
bool OnChar(CPDFSDK_Annot* pAnnot, uint32_t nChar, uint32_t nFlags) override;
bool OnLButtonUp(CPDFSDK_PageView* pPageView,
CPDFSDK_Annot* pAnnot,
diff --git a/fpdfsdk/formfiller/cffl_formfiller.cpp b/fpdfsdk/formfiller/cffl_formfiller.cpp
index 7d25f1f..e492b29 100644
--- a/fpdfsdk/formfiller/cffl_formfiller.cpp
+++ b/fpdfsdk/formfiller/cffl_formfiller.cpp
@@ -36,10 +36,8 @@
}
}
-FX_RECT CFFL_FormFiller::GetViewBBox(CPDFSDK_PageView* pPageView,
- CPDFSDK_Annot* pAnnot) {
+FX_RECT CFFL_FormFiller::GetViewBBox(CPDFSDK_PageView* pPageView) {
ASSERT(pPageView);
- ASSERT(pAnnot);
CFX_FloatRect rcAnnot = m_pWidget->GetRect();
if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, false))
@@ -82,11 +80,9 @@
CPDF_Annot::Normal, nullptr);
}
-void CFFL_FormFiller::OnMouseEnter(CPDFSDK_PageView* pPageView,
- CPDFSDK_Annot* pAnnot) {}
+void CFFL_FormFiller::OnMouseEnter(CPDFSDK_PageView* pPageView) {}
-void CFFL_FormFiller::OnMouseExit(CPDFSDK_PageView* pPageView,
- CPDFSDK_Annot* pAnnot) {
+void CFFL_FormFiller::OnMouseExit(CPDFSDK_PageView* pPageView) {
EndTimer();
ASSERT(m_pWidget);
}
@@ -100,7 +96,7 @@
return false;
m_bValid = true;
- FX_RECT rect = GetViewBBox(pPageView, pAnnot);
+ FX_RECT rect = GetViewBBox(pPageView);
InvalidateRect(rect);
if (!rect.Contains(static_cast<int>(point.x), static_cast<int>(point.y)))
return false;
@@ -115,13 +111,12 @@
if (!pWnd)
return false;
- InvalidateRect(GetViewBBox(pPageView, pAnnot));
+ InvalidateRect(GetViewBBox(pPageView));
pWnd->OnLButtonUp(WndtoPWL(pPageView, point), nFlags);
return true;
}
bool CFFL_FormFiller::OnLButtonDblClk(CPDFSDK_PageView* pPageView,
- CPDFSDK_Annot* pAnnot,
uint32_t nFlags,
const CFX_PointF& point) {
CPWL_Wnd* pWnd = GetPDFWindow(pPageView, false);
@@ -133,7 +128,6 @@
}
bool CFFL_FormFiller::OnMouseMove(CPDFSDK_PageView* pPageView,
- CPDFSDK_Annot* pAnnot,
uint32_t nFlags,
const CFX_PointF& point) {
CPWL_Wnd* pWnd = GetPDFWindow(pPageView, false);
@@ -145,7 +139,6 @@
}
bool CFFL_FormFiller::OnMouseWheel(CPDFSDK_PageView* pPageView,
- CPDFSDK_Annot* pAnnot,
uint32_t nFlags,
short zDelta,
const CFX_PointF& point) {
@@ -157,7 +150,6 @@
}
bool CFFL_FormFiller::OnRButtonDown(CPDFSDK_PageView* pPageView,
- CPDFSDK_Annot* pAnnot,
uint32_t nFlags,
const CFX_PointF& point) {
CPWL_Wnd* pWnd = GetPDFWindow(pPageView, true);
@@ -169,7 +161,6 @@
}
bool CFFL_FormFiller::OnRButtonUp(CPDFSDK_PageView* pPageView,
- CPDFSDK_Annot* pAnnot,
uint32_t nFlags,
const CFX_PointF& point) {
CPWL_Wnd* pWnd = GetPDFWindow(pPageView, false);
@@ -180,9 +171,7 @@
return true;
}
-bool CFFL_FormFiller::OnKeyDown(CPDFSDK_Annot* pAnnot,
- uint32_t nKeyCode,
- uint32_t nFlags) {
+bool CFFL_FormFiller::OnKeyDown(uint32_t nKeyCode, uint32_t nFlags) {
if (!IsValid())
return false;
@@ -214,7 +203,7 @@
return false;
}
-WideString CFFL_FormFiller::GetText(CPDFSDK_Annot* pAnnot) {
+WideString CFFL_FormFiller::GetText() {
if (!IsValid())
return WideString();
@@ -225,7 +214,7 @@
return pWnd ? pWnd->GetText() : WideString();
}
-WideString CFFL_FormFiller::GetSelectedText(CPDFSDK_Annot* pAnnot) {
+WideString CFFL_FormFiller::GetSelectedText() {
if (!IsValid())
return WideString();
@@ -236,8 +225,7 @@
return pWnd ? pWnd->GetSelectedText() : WideString();
}
-void CFFL_FormFiller::ReplaceSelection(CPDFSDK_Annot* pAnnot,
- const WideString& text) {
+void CFFL_FormFiller::ReplaceSelection(const WideString& text) {
if (!IsValid())
return;
@@ -251,7 +239,7 @@
pWnd->ReplaceSelection(text);
}
-bool CFFL_FormFiller::CanUndo(CPDFSDK_Annot* pAnnot) {
+bool CFFL_FormFiller::CanUndo() {
if (!IsValid())
return false;
@@ -262,7 +250,7 @@
return pWnd && pWnd->CanUndo();
}
-bool CFFL_FormFiller::CanRedo(CPDFSDK_Annot* pAnnot) {
+bool CFFL_FormFiller::CanRedo() {
if (!IsValid())
return false;
@@ -273,7 +261,7 @@
return pWnd && pWnd->CanRedo();
}
-bool CFFL_FormFiller::Undo(CPDFSDK_Annot* pAnnot) {
+bool CFFL_FormFiller::Undo() {
if (!IsValid())
return false;
@@ -284,7 +272,7 @@
return pWnd && pWnd->Undo();
}
-bool CFFL_FormFiller::Redo(CPDFSDK_Annot* pAnnot) {
+bool CFFL_FormFiller::Redo() {
if (!IsValid())
return false;
@@ -303,10 +291,10 @@
pWnd->SetFocus();
m_bValid = true;
- InvalidateRect(GetViewBBox(pPageView, pAnnot));
+ InvalidateRect(GetViewBBox(pPageView));
}
-void CFFL_FormFiller::KillFocusForAnnot(CPDFSDK_Annot* pAnnot, uint32_t nFlag) {
+void CFFL_FormFiller::KillFocusForAnnot(uint32_t nFlag) {
if (!IsValid())
return;
@@ -600,7 +588,7 @@
bool bDestroyPDFWindow) {
m_bValid = false;
- InvalidateRect(GetViewBBox(pPageView, m_pWidget.Get()));
+ InvalidateRect(GetViewBBox(pPageView));
if (bDestroyPDFWindow)
DestroyPDFWindow(pPageView);
}
diff --git a/fpdfsdk/formfiller/cffl_formfiller.h b/fpdfsdk/formfiller/cffl_formfiller.h
index 30e329f..6fc6124 100644
--- a/fpdfsdk/formfiller/cffl_formfiller.h
+++ b/fpdfsdk/formfiller/cffl_formfiller.h
@@ -27,8 +27,6 @@
CPDFSDK_Widget* pWidget);
~CFFL_FormFiller() override;
- virtual FX_RECT GetViewBBox(CPDFSDK_PageView* pPageView,
- CPDFSDK_Annot* pAnnot);
virtual void OnDraw(CPDFSDK_PageView* pPageView,
CPDFSDK_Annot* pAnnot,
CFX_RenderDevice* pDevice,
@@ -38,8 +36,8 @@
CFX_RenderDevice* pDevice,
const CFX_Matrix& mtUser2Device);
- virtual void OnMouseEnter(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot);
- virtual void OnMouseExit(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot);
+ virtual void OnMouseEnter(CPDFSDK_PageView* pPageView);
+ virtual void OnMouseExit(CPDFSDK_PageView* pPageView);
virtual bool OnLButtonDown(CPDFSDK_PageView* pPageView,
CPDFSDK_Annot* pAnnot,
@@ -50,45 +48,40 @@
uint32_t nFlags,
const CFX_PointF& point);
virtual bool OnLButtonDblClk(CPDFSDK_PageView* pPageView,
- CPDFSDK_Annot* pAnnot,
uint32_t nFlags,
const CFX_PointF& point);
virtual bool OnMouseMove(CPDFSDK_PageView* pPageView,
- CPDFSDK_Annot* pAnnot,
uint32_t nFlags,
const CFX_PointF& point);
virtual bool OnMouseWheel(CPDFSDK_PageView* pPageView,
- CPDFSDK_Annot* pAnnot,
uint32_t nFlags,
short zDelta,
const CFX_PointF& point);
virtual bool OnRButtonDown(CPDFSDK_PageView* pPageView,
- CPDFSDK_Annot* pAnnot,
uint32_t nFlags,
const CFX_PointF& point);
virtual bool OnRButtonUp(CPDFSDK_PageView* pPageView,
- CPDFSDK_Annot* pAnnot,
uint32_t nFlags,
const CFX_PointF& point);
- virtual bool OnKeyDown(CPDFSDK_Annot* pAnnot,
- uint32_t nKeyCode,
- uint32_t nFlags);
+ virtual bool OnKeyDown(uint32_t nKeyCode, uint32_t nFlags);
virtual bool OnChar(CPDFSDK_Annot* pAnnot, uint32_t nChar, uint32_t nFlags);
virtual bool SetIndexSelected(int index, bool selected);
virtual bool IsIndexSelected(int index);
- WideString GetText(CPDFSDK_Annot* pAnnot);
- WideString GetSelectedText(CPDFSDK_Annot* pAnnot);
- void ReplaceSelection(CPDFSDK_Annot* pAnnot, const WideString& text);
+ FX_RECT GetViewBBox(CPDFSDK_PageView* pPageView);
- bool CanUndo(CPDFSDK_Annot* pAnnot);
- bool CanRedo(CPDFSDK_Annot* pAnnot);
- bool Undo(CPDFSDK_Annot* pAnnot);
- bool Redo(CPDFSDK_Annot* pAnnot);
+ WideString GetText();
+ WideString GetSelectedText();
+ void ReplaceSelection(const WideString& text);
+
+ bool CanUndo();
+ bool CanRedo();
+ bool Undo();
+ bool Redo();
void SetFocusForAnnot(CPDFSDK_Annot* pAnnot, uint32_t nFlag);
- void KillFocusForAnnot(CPDFSDK_Annot* pAnnot, uint32_t nFlag);
+ void KillFocusForAnnot(uint32_t nFlag);
// CPWL_TimerHandler
void TimerProc() override;
diff --git a/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp b/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp
index 6e9f132..42e12ea 100644
--- a/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp
+++ b/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp
@@ -43,7 +43,7 @@
FX_RECT CFFL_InteractiveFormFiller::GetViewBBox(CPDFSDK_PageView* pPageView,
CPDFSDK_Annot* pAnnot) {
if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, false))
- return pFormFiller->GetViewBBox(pPageView, pAnnot);
+ return pFormFiller->GetViewBBox(pPageView);
ASSERT(pPageView);
@@ -144,7 +144,7 @@
}
}
if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot->Get(), true))
- pFormFiller->OnMouseEnter(pPageView, pAnnot->Get());
+ pFormFiller->OnMouseEnter(pPageView);
}
void CFFL_InteractiveFormFiller::OnMouseExit(CPDFSDK_PageView* pPageView,
@@ -177,7 +177,7 @@
}
}
if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot->Get(), false))
- pFormFiller->OnMouseExit(pPageView, pAnnot->Get());
+ pFormFiller->OnMouseExit(pPageView);
}
bool CFFL_InteractiveFormFiller::OnLButtonDown(
@@ -316,8 +316,7 @@
const CFX_PointF& point) {
ASSERT((*pAnnot)->GetPDFAnnot()->GetSubtype() == CPDF_Annot::Subtype::WIDGET);
CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot->Get(), false);
- return pFormFiller &&
- pFormFiller->OnLButtonDblClk(pPageView, pAnnot->Get(), nFlags, point);
+ return pFormFiller && pFormFiller->OnLButtonDblClk(pPageView, nFlags, point);
}
bool CFFL_InteractiveFormFiller::OnMouseMove(CPDFSDK_PageView* pPageView,
@@ -326,8 +325,7 @@
const CFX_PointF& point) {
ASSERT((*pAnnot)->GetPDFAnnot()->GetSubtype() == CPDF_Annot::Subtype::WIDGET);
CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot->Get(), true);
- return pFormFiller &&
- pFormFiller->OnMouseMove(pPageView, pAnnot->Get(), nFlags, point);
+ return pFormFiller && pFormFiller->OnMouseMove(pPageView, nFlags, point);
}
bool CFFL_InteractiveFormFiller::OnMouseWheel(
@@ -339,8 +337,7 @@
ASSERT((*pAnnot)->GetPDFAnnot()->GetSubtype() == CPDF_Annot::Subtype::WIDGET);
CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot->Get(), false);
return pFormFiller &&
- pFormFiller->OnMouseWheel(pPageView, pAnnot->Get(), nFlags, zDelta,
- point);
+ pFormFiller->OnMouseWheel(pPageView, nFlags, zDelta, point);
}
bool CFFL_InteractiveFormFiller::OnRButtonDown(
@@ -350,8 +347,7 @@
const CFX_PointF& point) {
ASSERT((*pAnnot)->GetPDFAnnot()->GetSubtype() == CPDF_Annot::Subtype::WIDGET);
CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot->Get(), false);
- return pFormFiller &&
- pFormFiller->OnRButtonDown(pPageView, pAnnot->Get(), nFlags, point);
+ return pFormFiller && pFormFiller->OnRButtonDown(pPageView, nFlags, point);
}
bool CFFL_InteractiveFormFiller::OnRButtonUp(CPDFSDK_PageView* pPageView,
@@ -360,8 +356,7 @@
const CFX_PointF& point) {
ASSERT((*pAnnot)->GetPDFAnnot()->GetSubtype() == CPDF_Annot::Subtype::WIDGET);
CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot->Get(), false);
- return pFormFiller &&
- pFormFiller->OnRButtonUp(pPageView, pAnnot->Get(), nFlags, point);
+ return pFormFiller && pFormFiller->OnRButtonUp(pPageView, nFlags, point);
}
bool CFFL_InteractiveFormFiller::OnKeyDown(CPDFSDK_Annot* pAnnot,
@@ -370,7 +365,7 @@
ASSERT(pAnnot->GetPDFAnnot()->GetSubtype() == CPDF_Annot::Subtype::WIDGET);
CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, false);
- return pFormFiller && pFormFiller->OnKeyDown(pAnnot, nKeyCode, nFlags);
+ return pFormFiller && pFormFiller->OnKeyDown(nKeyCode, nFlags);
}
bool CFFL_InteractiveFormFiller::OnChar(CPDFSDK_Annot* pAnnot,
@@ -439,7 +434,7 @@
if (!pFormFiller)
return true;
- pFormFiller->KillFocusForAnnot(pAnnot->Get(), nFlag);
+ pFormFiller->KillFocusForAnnot(nFlag);
if (!pAnnot->HasObservable())
return false;
@@ -539,13 +534,13 @@
WideString CFFL_InteractiveFormFiller::GetText(CPDFSDK_Annot* pAnnot) {
ASSERT(pAnnot->GetPDFAnnot()->GetSubtype() == CPDF_Annot::Subtype::WIDGET);
CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, false);
- return pFormFiller ? pFormFiller->GetText(pAnnot) : WideString();
+ return pFormFiller ? pFormFiller->GetText() : WideString();
}
WideString CFFL_InteractiveFormFiller::GetSelectedText(CPDFSDK_Annot* pAnnot) {
ASSERT(pAnnot->GetPDFAnnot()->GetSubtype() == CPDF_Annot::Subtype::WIDGET);
CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, false);
- return pFormFiller ? pFormFiller->GetSelectedText(pAnnot) : WideString();
+ return pFormFiller ? pFormFiller->GetSelectedText() : WideString();
}
void CFFL_InteractiveFormFiller::ReplaceSelection(CPDFSDK_Annot* pAnnot,
@@ -555,31 +550,31 @@
if (!pFormFiller)
return;
- pFormFiller->ReplaceSelection(pAnnot, text);
+ pFormFiller->ReplaceSelection(text);
}
bool CFFL_InteractiveFormFiller::CanUndo(CPDFSDK_Annot* pAnnot) {
ASSERT(pAnnot->GetPDFAnnot()->GetSubtype() == CPDF_Annot::Subtype::WIDGET);
CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, false);
- return pFormFiller && pFormFiller->CanUndo(pAnnot);
+ return pFormFiller && pFormFiller->CanUndo();
}
bool CFFL_InteractiveFormFiller::CanRedo(CPDFSDK_Annot* pAnnot) {
ASSERT(pAnnot->GetPDFAnnot()->GetSubtype() == CPDF_Annot::Subtype::WIDGET);
CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, false);
- return pFormFiller && pFormFiller->CanRedo(pAnnot);
+ return pFormFiller && pFormFiller->CanRedo();
}
bool CFFL_InteractiveFormFiller::Undo(CPDFSDK_Annot* pAnnot) {
ASSERT(pAnnot->GetPDFAnnot()->GetSubtype() == CPDF_Annot::Subtype::WIDGET);
CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, false);
- return pFormFiller && pFormFiller->Undo(pAnnot);
+ return pFormFiller && pFormFiller->Undo();
}
bool CFFL_InteractiveFormFiller::Redo(CPDFSDK_Annot* pAnnot) {
ASSERT(pAnnot->GetPDFAnnot()->GetSubtype() == CPDF_Annot::Subtype::WIDGET);
CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, false);
- return pFormFiller && pFormFiller->Redo(pAnnot);
+ return pFormFiller && pFormFiller->Redo();
}
void CFFL_InteractiveFormFiller::UnRegisterFormFiller(CPDFSDK_Annot* pAnnot) {
diff --git a/fpdfsdk/formfiller/cffl_radiobutton.cpp b/fpdfsdk/formfiller/cffl_radiobutton.cpp
index c8c65dc..7c45af6 100644
--- a/fpdfsdk/formfiller/cffl_radiobutton.cpp
+++ b/fpdfsdk/formfiller/cffl_radiobutton.cpp
@@ -30,15 +30,13 @@
return std::move(pWnd);
}
-bool CFFL_RadioButton::OnKeyDown(CPDFSDK_Annot* pAnnot,
- uint32_t nKeyCode,
- uint32_t nFlags) {
+bool CFFL_RadioButton::OnKeyDown(uint32_t nKeyCode, uint32_t nFlags) {
switch (nKeyCode) {
case FWL_VKEY_Return:
case FWL_VKEY_Space:
return true;
default:
- return CFFL_FormFiller::OnKeyDown(pAnnot, nKeyCode, nFlags);
+ return CFFL_FormFiller::OnKeyDown(nKeyCode, nFlags);
}
}
diff --git a/fpdfsdk/formfiller/cffl_radiobutton.h b/fpdfsdk/formfiller/cffl_radiobutton.h
index bed7b6f..ccbbd3a 100644
--- a/fpdfsdk/formfiller/cffl_radiobutton.h
+++ b/fpdfsdk/formfiller/cffl_radiobutton.h
@@ -22,9 +22,7 @@
std::unique_ptr<CPWL_Wnd> NewPWLWindow(
const CPWL_Wnd::CreateParams& cp,
std::unique_ptr<CPWL_Wnd::PrivateData> pAttachedData) override;
- bool OnKeyDown(CPDFSDK_Annot* pAnnot,
- uint32_t nKeyCode,
- uint32_t nFlags) override;
+ bool OnKeyDown(uint32_t nKeyCode, uint32_t nFlags) override;
bool OnChar(CPDFSDK_Annot* pAnnot, uint32_t nChar, uint32_t nFlags) override;
bool OnLButtonUp(CPDFSDK_PageView* pPageView,
CPDFSDK_Annot* pAnnot,
diff --git a/fpdfsdk/pwl/cpwl_combo_box_embeddertest.cpp b/fpdfsdk/pwl/cpwl_combo_box_embeddertest.cpp
index b3bfe55..0caa4f2 100644
--- a/fpdfsdk/pwl/cpwl_combo_box_embeddertest.cpp
+++ b/fpdfsdk/pwl/cpwl_combo_box_embeddertest.cpp
@@ -273,8 +273,7 @@
TypeTextIntoTextField(10);
// Move cursor to beginning of user-editable combobox text field.
- EXPECT_TRUE(GetCFFLFormFiller()->OnKeyDown(GetCPDFSDKAnnotUserEditable(),
- FWL_VKEY_Home, 0));
+ EXPECT_TRUE(GetCFFLFormFiller()->OnKeyDown(FWL_VKEY_Home, 0));
GetCPWLComboBox()->ReplaceSelection(L"Hello");
EXPECT_STREQ(L"HelloABCDEFGHIJ", GetCPWLComboBox()->GetText().c_str());
@@ -287,8 +286,7 @@
// Move cursor to middle of user-editable combobox text field.
for (int i = 0; i < 5; ++i) {
- EXPECT_TRUE(GetCFFLFormFiller()->OnKeyDown(GetCPDFSDKAnnotUserEditable(),
- FWL_VKEY_Left, 0));
+ EXPECT_TRUE(GetCFFLFormFiller()->OnKeyDown(FWL_VKEY_Left, 0));
}
GetCPWLComboBox()->ReplaceSelection(L"Hello");
diff --git a/fpdfsdk/pwl/cpwl_edit_embeddertest.cpp b/fpdfsdk/pwl/cpwl_edit_embeddertest.cpp
index 296dd4f..0e9b272 100644
--- a/fpdfsdk/pwl/cpwl_edit_embeddertest.cpp
+++ b/fpdfsdk/pwl/cpwl_edit_embeddertest.cpp
@@ -216,8 +216,7 @@
TypeTextIntoTextField(10);
// Move cursor to beginning of text field.
- EXPECT_TRUE(
- GetCFFLFormFiller()->OnKeyDown(GetCPDFSDKAnnot(), FWL_VKEY_Home, 0));
+ EXPECT_TRUE(GetCFFLFormFiller()->OnKeyDown(FWL_VKEY_Home, 0));
GetCPWLEdit()->ReplaceSelection(L"Hello");
EXPECT_STREQ(L"HelloABCDEFGHIJ", GetCPWLEdit()->GetText().c_str());
@@ -229,8 +228,7 @@
// Move cursor to middle of text field.
for (int i = 0; i < 5; ++i) {
- EXPECT_TRUE(
- GetCFFLFormFiller()->OnKeyDown(GetCPDFSDKAnnot(), FWL_VKEY_Left, 0));
+ EXPECT_TRUE(GetCFFLFormFiller()->OnKeyDown(FWL_VKEY_Left, 0));
}
GetCPWLEdit()->ReplaceSelection(L"Hello");
@@ -319,8 +317,7 @@
FormFillerAndWindowSetup(GetCPDFSDKAnnotCharLimit());
// Move cursor to middle of text field.
for (int i = 0; i < 5; ++i) {
- EXPECT_TRUE(GetCFFLFormFiller()->OnKeyDown(GetCPDFSDKAnnotCharLimit(),
- FWL_VKEY_Right, 0));
+ EXPECT_TRUE(GetCFFLFormFiller()->OnKeyDown(FWL_VKEY_Right, 0));
}
GetCPWLEdit()->ReplaceSelection(L"Hippopotamus");
@@ -330,8 +327,7 @@
TEST_F(CPWLEditEmbedderTest, InsertTextInPopulatedCharLimitTextFieldRight) {
FormFillerAndWindowSetup(GetCPDFSDKAnnotCharLimit());
// Move cursor to end of text field.
- EXPECT_TRUE(GetCFFLFormFiller()->OnKeyDown(GetCPDFSDKAnnotCharLimit(),
- FWL_VKEY_End, 0));
+ EXPECT_TRUE(GetCFFLFormFiller()->OnKeyDown(FWL_VKEY_End, 0));
GetCPWLEdit()->ReplaceSelection(L"Hippopotamus");
EXPECT_STREQ(L"ElephantHi", GetCPWLEdit()->GetText().c_str());