diff options
Diffstat (limited to 'fpdfsdk/formfiller/cffl_combobox.cpp')
-rw-r--r-- | fpdfsdk/formfiller/cffl_combobox.cpp | 27 |
1 files changed, 4 insertions, 23 deletions
diff --git a/fpdfsdk/formfiller/cffl_combobox.cpp b/fpdfsdk/formfiller/cffl_combobox.cpp index c4554c1173..98f98b3ee2 100644 --- a/fpdfsdk/formfiller/cffl_combobox.cpp +++ b/fpdfsdk/formfiller/cffl_combobox.cpp @@ -9,7 +9,6 @@ #include "fpdfsdk/cpdfsdk_formfillenvironment.h" #include "fpdfsdk/cpdfsdk_widget.h" #include "fpdfsdk/formfiller/cba_fontmap.h" -#include "fpdfsdk/formfiller/cffl_formfiller.h" #include "fpdfsdk/formfiller/cffl_interactiveformfiller.h" #include "fpdfsdk/fsdk_common.h" #include "fpdfsdk/pwl/cpwl_combo_box.h" @@ -17,7 +16,7 @@ CFFL_ComboBox::CFFL_ComboBox(CPDFSDK_FormFillEnvironment* pApp, CPDFSDK_Widget* pWidget) - : CFFL_FormFiller(pApp, pWidget) { + : CFFL_TextObject(pApp, pWidget) { m_State.nIndex = 0; m_State.nStart = 0; m_State.nEnd = 0; @@ -34,15 +33,11 @@ CFFL_ComboBox::~CFFL_ComboBox() { } PWL_CREATEPARAM CFFL_ComboBox::GetCreateParam() { - PWL_CREATEPARAM cp = CFFL_FormFiller::GetCreateParam(); + PWL_CREATEPARAM cp = CFFL_TextObject::GetCreateParam(); if (m_pWidget->GetFieldFlags() & FIELDFLAG_EDIT) cp.dwFlags |= PCBS_ALLOWCUSTOMTEXT; - if (!m_pFontMap) { - m_pFontMap = - pdfium::MakeUnique<CBA_FontMap>(m_pWidget.Get(), GetSystemHandler()); - } - cp.pFontMap = m_pFontMap.get(); + cp.pFontMap = MaybeCreateFontMap(); cp.pFocusHandler = this; return cp; } @@ -75,7 +70,7 @@ CPWL_Wnd* CFFL_ComboBox::NewPDFWindow(const PWL_CREATEPARAM& cp) { bool CFFL_ComboBox::OnChar(CPDFSDK_Annot* pAnnot, uint32_t nChar, uint32_t nFlags) { - return CFFL_FormFiller::OnChar(pAnnot, nChar, nFlags); + return CFFL_TextObject::OnChar(pAnnot, nChar, nFlags); } bool CFFL_ComboBox::IsDataChanged(CPDFSDK_PageView* pPageView) { @@ -225,20 +220,6 @@ void CFFL_ComboBox::RestoreState(CPDFSDK_PageView* pPageView) { } } -CPWL_Wnd* CFFL_ComboBox::ResetPDFWindow(CPDFSDK_PageView* pPageView, - bool bRestoreValue) { - if (bRestoreValue) - SaveState(pPageView); - - DestroyPDFWindow(pPageView); - if (bRestoreValue) - RestoreState(pPageView); - - CPWL_Wnd::ObservedPtr pRet(GetPDFWindow(pPageView, !bRestoreValue)); - m_pWidget->UpdateField(); // May invoke JS, invalidating pRet. - return pRet.Get(); -} - #ifdef PDF_ENABLE_XFA bool CFFL_ComboBox::IsFieldFull(CPDFSDK_PageView* pPageView) { if (CPWL_ComboBox* pComboBox = |