From b4fee4d5d471475ada1d0d9110e1a534b49477ba Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Tue, 1 Aug 2017 18:34:43 -0700 Subject: Add CFFL_TextField class. This class implements common code used by several CFFL_FormFiller sub-classes. Make those sub-classes inherit from CFFL_TextField, instead of inheriting from CFFL_FormFiller directly and then implementing the same functionality multiple times. Change-Id: Iad8a735b6d6e18e89d617636b753805d3f77a286 Reviewed-on: https://pdfium-review.googlesource.com/9850 Commit-Queue: Lei Zhang Reviewed-by: Tom Sepez --- fpdfsdk/formfiller/cffl_combobox.h | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) (limited to 'fpdfsdk/formfiller/cffl_combobox.h') diff --git a/fpdfsdk/formfiller/cffl_combobox.h b/fpdfsdk/formfiller/cffl_combobox.h index 96e8ffda84..0f510bef20 100644 --- a/fpdfsdk/formfiller/cffl_combobox.h +++ b/fpdfsdk/formfiller/cffl_combobox.h @@ -7,10 +7,8 @@ #ifndef FPDFSDK_FORMFILLER_CFFL_COMBOBOX_H_ #define FPDFSDK_FORMFILLER_CFFL_COMBOBOX_H_ -#include - #include "core/fxcrt/fx_string.h" -#include "fpdfsdk/formfiller/cffl_formfiller.h" +#include "fpdfsdk/formfiller/cffl_textobject.h" class CBA_FontMap; @@ -21,12 +19,12 @@ struct FFL_ComboBoxState { CFX_WideString sValue; }; -class CFFL_ComboBox : public CFFL_FormFiller, public IPWL_FocusHandler { +class CFFL_ComboBox : public CFFL_TextObject, public IPWL_FocusHandler { public: CFFL_ComboBox(CPDFSDK_FormFillEnvironment* pApp, CPDFSDK_Widget* pWidget); ~CFFL_ComboBox() override; - // CFFL_FormFiller: + // CFFL_TextObject: PWL_CREATEPARAM GetCreateParam() override; CPWL_Wnd* NewPDFWindow(const PWL_CREATEPARAM& cp) override; bool OnChar(CPDFSDK_Annot* pAnnot, uint32_t nChar, uint32_t nFlags) override; @@ -43,21 +41,16 @@ class CFFL_ComboBox : public CFFL_FormFiller, public IPWL_FocusHandler { const PDFSDK_FieldAction& faNew) override; void SaveState(CPDFSDK_PageView* pPageView) override; void RestoreState(CPDFSDK_PageView* pPageView) override; - CPWL_Wnd* ResetPDFWindow(CPDFSDK_PageView* pPageView, - bool bRestoreValue) override; +#ifdef PDF_ENABLE_XFA + bool IsFieldFull(CPDFSDK_PageView* pPageView) override; +#endif // IPWL_FocusHandler: void OnSetFocus(CPWL_Edit* pEdit) override; -#ifdef PDF_ENABLE_XFA - // CFFL_FormFiller: - bool IsFieldFull(CPDFSDK_PageView* pPageView) override; -#endif // PDF_ENABLE_XFA - private: CFX_WideString GetSelectExportText(); - std::unique_ptr m_pFontMap; FFL_ComboBoxState m_State; }; -- cgit v1.2.3