From e2210acfff622ac73b0783e1523615753484073b Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Wed, 10 Oct 2018 19:45:14 +0000 Subject: 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 Reviewed-by: Tom Sepez --- fpdfsdk/cpdfsdk_widget.cpp | 7 ------- fpdfsdk/cpdfsdk_widget.h | 2 -- fpdfsdk/cpdfsdk_widgethandler.cpp | 6 +++--- 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; -- cgit v1.2.3