diff options
-rw-r--r-- | sw/source/ui/frmdlg/cption.cxx | 15 | ||||
-rw-r--r-- | sw/source/uibase/inc/cption.hxx | 1 |
2 files changed, 7 insertions, 9 deletions
diff --git a/sw/source/ui/frmdlg/cption.cxx b/sw/source/ui/frmdlg/cption.cxx index b9520dd71af3..6f4f8208b7ee 100644 --- a/sw/source/ui/frmdlg/cption.cxx +++ b/sw/source/ui/frmdlg/cption.cxx @@ -94,12 +94,6 @@ OUString TextFilterAutoConvert::filter(const OUString &rText) return rText; } -IMPL_LINK(SwCaptionDialog, TextFilterHdl, OUString&, rTest, bool) -{ - rTest = m_aTextFilter.filter(rTest); - return true; -} - SwCaptionDialog::SwCaptionDialog(weld::Window *pParent, SwView &rV) : SfxDialogController(pParent, "modules/swriter/ui/insertcaption.ui", "InsertCaptionDialog") , m_sNone(SwResId(SW_STR_NONE)) @@ -123,8 +117,6 @@ SwCaptionDialog::SwCaptionDialog(weld::Window *pParent, SwView &rV) , m_xOptionButton(m_xBuilder->weld_button("options")) , m_xPreview(new weld::CustomWeld(*m_xBuilder, "preview", m_aPreview)) { - m_xCategoryBox->connect_entry_insert_text(LINK(this, SwCaptionDialog, TextFilterHdl)); - //#i61007# order of captions ApplyCaptionOrder(); SwWrtShell &rSh = rView.GetWrtShell(); @@ -363,6 +355,13 @@ IMPL_LINK_NOARG(SwCaptionDialog, ModifyEntryHdl, weld::Entry&, void) IMPL_LINK_NOARG(SwCaptionDialog, ModifyComboHdl, weld::ComboBox&, void) { + OUString sText = m_xCategoryBox->get_active_text(); + OUString sAllowedText = m_aTextFilter.filter(sText); + if (sText != sAllowedText) + { + m_xCategoryBox->set_entry_text(sAllowedText); + m_xCategoryBox->select_entry_region(sAllowedText.getLength(), sAllowedText.getLength()); + } ModifyHdl(); } diff --git a/sw/source/uibase/inc/cption.hxx b/sw/source/uibase/inc/cption.hxx index cc992240cccd..16fa1f063da9 100644 --- a/sw/source/uibase/inc/cption.hxx +++ b/sw/source/uibase/inc/cption.hxx @@ -64,7 +64,6 @@ class SwCaptionDialog : public SfxDialogController DECL_LINK(ModifyComboHdl, weld::ComboBox&, void); DECL_LINK(OptionHdl, weld::Button&, void); DECL_LINK(CaptionHdl, weld::Button&, void); - DECL_LINK(TextFilterHdl, OUString&, bool); void Apply(); |