summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-10-10 19:45:14 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-10-10 19:45:14 +0000
commite2210acfff622ac73b0783e1523615753484073b (patch)
tree6adbff1232b2177a6b2581e3ef709b5909a0dda0
parent7348681933306c3b407cb3756ce4f01782791fb6 (diff)
downloadpdfium-e2210acfff622ac73b0783e1523615753484073b.tar.xz
Get rid of useless form of CPDFSDK_Widget::GetFormControl().
Just call CPDF_InterForm::GetControlByDict() directly instead. Change-Id: I3fce2330ab81324d62477530b2617feeb0a49749 Reviewed-on: https://pdfium-review.googlesource.com/c/43606 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
-rw-r--r--fpdfsdk/cpdfsdk_widget.cpp7
-rw-r--r--fpdfsdk/cpdfsdk_widget.h2
-rw-r--r--fpdfsdk/cpdfsdk_widgethandler.cpp6
3 files changed, 3 insertions, 12 deletions
diff --git a/fpdfsdk/cpdfsdk_widget.cpp b/fpdfsdk/cpdfsdk_widget.cpp
index fc848d5014..cbd2c7bbba 100644
--- a/fpdfsdk/cpdfsdk_widget.cpp
+++ b/fpdfsdk/cpdfsdk_widget.cpp
@@ -380,13 +380,6 @@ CPDF_FormControl* CPDFSDK_Widget::GetFormControl() const {
return pPDFInterForm->GetControlByDict(GetAnnotDict());
}
-CPDF_FormControl* CPDFSDK_Widget::GetFormControl(
- CPDF_InterForm* pInterForm,
- const CPDF_Dictionary* pAnnotDict) {
- ASSERT(pAnnotDict);
- return pInterForm->GetControlByDict(pAnnotDict);
-}
-
int CPDFSDK_Widget::GetRotate() const {
CPDF_FormControl* pCtrl = GetFormControl();
return pCtrl->GetRotation() % 360;
diff --git a/fpdfsdk/cpdfsdk_widget.h b/fpdfsdk/cpdfsdk_widget.h
index e3f9204eb8..283d244ca4 100644
--- a/fpdfsdk/cpdfsdk_widget.h
+++ b/fpdfsdk/cpdfsdk_widget.h
@@ -101,8 +101,6 @@ class CPDFSDK_Widget final : public CPDFSDK_BAAnnot {
CPDFSDK_InterForm* GetInterForm() const { return m_pInterForm.Get(); }
CPDF_FormField* GetFormField() const;
CPDF_FormControl* GetFormControl() const;
- static CPDF_FormControl* GetFormControl(CPDF_InterForm* pInterForm,
- const CPDF_Dictionary* pAnnotDict);
void DrawShadow(CFX_RenderDevice* pDevice, CPDFSDK_PageView* pPageView);
diff --git a/fpdfsdk/cpdfsdk_widgethandler.cpp b/fpdfsdk/cpdfsdk_widgethandler.cpp
index c63d91564b..bf7de5e742 100644
--- a/fpdfsdk/cpdfsdk_widgethandler.cpp
+++ b/fpdfsdk/cpdfsdk_widgethandler.cpp
@@ -54,14 +54,14 @@ bool CPDFSDK_WidgetHandler::CanAnswer(CPDFSDK_Annot* pAnnot) {
CPDFSDK_Annot* CPDFSDK_WidgetHandler::NewAnnot(CPDF_Annot* pAnnot,
CPDFSDK_PageView* pPage) {
CPDFSDK_InterForm* pInterForm = m_pFormFillEnv->GetInterForm();
- CPDF_FormControl* pCtrl = CPDFSDK_Widget::GetFormControl(
- pInterForm->GetInterForm(), pAnnot->GetAnnotDict());
+ CPDF_InterForm* pPDFInterForm = pInterForm->GetInterForm();
+ CPDF_FormControl* pCtrl =
+ pPDFInterForm->GetControlByDict(pAnnot->GetAnnotDict());
if (!pCtrl)
return nullptr;
CPDFSDK_Widget* pWidget = new CPDFSDK_Widget(pAnnot, pPage, pInterForm);
pInterForm->AddMap(pCtrl, pWidget);
- CPDF_InterForm* pPDFInterForm = pInterForm->GetInterForm();
if (pPDFInterForm->NeedConstructAP())
pWidget->ResetAppearance(pdfium::nullopt, false);
return pWidget;