include/svtools/ctrlbox.hxx | 1 + svx/source/tbxctrls/tbcontrl.cxx | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-)
New commits: commit a9db5edbccf001eec46a76c48c36812930e535a5 Author: Mert Tumer <mert.tu...@collabora.com> AuthorDate: Tue Jan 18 12:57:16 2022 +0300 Commit: Mert Tumer <mert.tu...@collabora.com> CommitDate: Tue Jan 18 13:31:24 2022 +0100 set active element to -1 when no selection for fontnamebox FontNameBox sets the currentVal to emptystring when there's a mixed font-name selection on the text but does not update the active_element which is incorrect whereas other comboboxes such as FontSize does it correctly. Signed-off-by: Mert Tumer <mert.tu...@collabora.com> Change-Id: Iff86bba64c2ab564ff5c5fa979eb846af9651a11 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128551 Reviewed-by: Szymon Kłos <szymon.k...@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> diff --git a/include/svtools/ctrlbox.hxx b/include/svtools/ctrlbox.hxx index 9cea6647f461..69b5aefac7dd 100644 --- a/include/svtools/ctrlbox.hxx +++ b/include/svtools/ctrlbox.hxx @@ -366,6 +366,7 @@ public: int get_active() const { return m_xComboBox->get_active(); } OUString get_active_text() const { return m_xComboBox->get_active_text(); } void set_active_or_entry_text(const OUString& rText); + void set_active(int nPos) { m_xComboBox->set_active(nPos); } int get_count() const { return m_xComboBox->get_count(); } OUString get_text(int nIndex) const { return m_xComboBox->get_text(nIndex); } void set_sensitive(bool bSensitive) { m_xComboBox->set_sensitive(bSensitive); } diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx index 8f8055352695..5e9727ddfe3d 100644 --- a/svx/source/tbxctrls/tbcontrl.cxx +++ b/svx/source/tbxctrls/tbcontrl.cxx @@ -3032,8 +3032,11 @@ void SvxFontNameBox_Base::statusChanged_Impl( const css::frame::FeatureStateEven css::awt::FontDescriptor aFontDesc; if ( rEvent.State >>= aFontDesc ) Update(&aFontDesc); - else + else { + // no active element; delete value in the display + m_xWidget->set_active(-1); set_active_or_entry_text(""); + } m_xWidget->save_value(); } }