diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-11-06 16:52:50 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-11-06 22:13:59 +0100 |
commit | 2e4657f57f8ac559a2f3be4286a4726465e88203 (patch) | |
tree | cfef7c5551e2576963f4a2e859055ff356c32956 /cui | |
parent | 35eb9708b0c8c90e37a042f387300342cae2af06 (diff) |
Related: tdf#138030 make 'except' page act like 'replace'
wrt pressing return to activate the entries
Change-Id: If691caef70fb12f96e24441929ab325780304962
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105419
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/inc/autocdlg.hxx | 2 | ||||
-rw-r--r-- | cui/source/tabpages/autocdlg.cxx | 15 | ||||
-rw-r--r-- | cui/uiconfig/ui/acorexceptpage.ui | 2 |
3 files changed, 14 insertions, 5 deletions
diff --git a/cui/source/inc/autocdlg.hxx b/cui/source/inc/autocdlg.hxx index 5aa4a8c6041f..86218a58a581 100644 --- a/cui/source/inc/autocdlg.hxx +++ b/cui/source/inc/autocdlg.hxx @@ -239,7 +239,7 @@ private: DECL_LINK(NewDelActionHdl, weld::Entry&, bool); DECL_LINK(SelectHdl, weld::TreeView&, void); DECL_LINK(ModifyHdl, weld::Entry&, void); - void NewDelHdl(const weld::Widget*); + bool NewDelHdl(const weld::Widget*); /// Box filled with new language void RefillReplaceBoxes(bool bFromReset, LanguageType eOldLanguage, diff --git a/cui/source/tabpages/autocdlg.cxx b/cui/source/tabpages/autocdlg.cxx index 0ff5fcae4a4d..2328277eb4d8 100644 --- a/cui/source/tabpages/autocdlg.cxx +++ b/cui/source/tabpages/autocdlg.cxx @@ -1029,7 +1029,7 @@ bool OfaAutocorrReplacePage::NewDelHdl(const weld::Widget* pBtn) DeleteEntry(m_xReplaceTLB->get_text(nEntry, 0), m_xReplaceTLB->get_text(nEntry, 1)); m_xReplaceTLB->remove(nEntry); ModifyHdl(*m_xShortED); - return false; + return true; } } @@ -1450,11 +1450,10 @@ IMPL_LINK(OfaAutocorrExceptPage, NewDelButtonHdl, weld::Button&, rBtn, void) IMPL_LINK(OfaAutocorrExceptPage, NewDelActionHdl, weld::Entry&, rEdit, bool) { - NewDelHdl(&rEdit); - return false; + return NewDelHdl(&rEdit); } -void OfaAutocorrExceptPage::NewDelHdl(const weld::Widget* pBtn) +bool OfaAutocorrExceptPage::NewDelHdl(const weld::Widget* pBtn) { if ((pBtn == m_xNewAbbrevPB.get() || pBtn == m_xAbbrevED.get()) && !m_xAbbrevED->get_text().isEmpty() && m_xNewAbbrevPB->get_sensitive()) @@ -1478,6 +1477,14 @@ void OfaAutocorrExceptPage::NewDelHdl(const weld::Widget* pBtn) m_xDoubleCapsLB->remove_text(m_xDoubleCapsED->get_text()); ModifyHdl(*m_xDoubleCapsED); } + else + { + // we didn't do anything, if this was because of 'activate' in an + // entry then let it continue to close the dialog like the replace + // page does + return false; + } + return true; } IMPL_LINK(OfaAutocorrExceptPage, SelectHdl, weld::TreeView&, rBox, void) diff --git a/cui/uiconfig/ui/acorexceptpage.ui b/cui/uiconfig/ui/acorexceptpage.ui index 5c9b15678b4c..7558f7fd61ee 100644 --- a/cui/uiconfig/ui/acorexceptpage.ui +++ b/cui/uiconfig/ui/acorexceptpage.ui @@ -54,6 +54,7 @@ <property name="visible">True</property> <property name="can_focus">True</property> <property name="hexpand">True</property> + <property name="activates-default">True</property> <child internal-child="accessible"> <object class="AtkObject" id="abbrev-atkobject"> <property name="AtkObject::accessible-description" translatable="yes" context="acorexceptpage|extended_tip|abbrev">Type an abbreviation followed by a period, and then click New. This prevents %PRODUCTNAME from automatically capitalizing the first letter of the word that comes after the period at the end of the abbreviation.</property> @@ -251,6 +252,7 @@ <property name="can_focus">True</property> <property name="valign">start</property> <property name="hexpand">True</property> + <property name="activates-default">True</property> <child internal-child="accessible"> <object class="AtkObject" id="double-atkobject"> <property name="AtkObject::accessible-description" translatable="yes" context="acorexceptpage|extended_tip|double">Type the word or abbreviation that starts with two capital letters that you do not want %PRODUCTNAME to change to one initial capital. For example, enter PC to prevent %PRODUCTNAME from changing PC to Pc.</property> |