diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-07-04 18:00:52 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-07-04 19:55:29 +0200 |
commit | f9d86399e92d9c734fdffc6a7c83a2007877ba93 (patch) | |
tree | a3f511ff9734e2c9e688bfa74d64f609e3aedd52 /svx | |
parent | d70da0b9e24991f8d58e83f53dbbf5b58c721f43 (diff) |
tdf#134479 allow disable font preview to work on existing font comboboxes
not just newly created one.
you can only restore back to a text-only view, not a text+(icon/whatever) view
Change-Id: Ic3becd7a942ee6b1dbabb57eebf1e25d1b626fdb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97972
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/tbxctrls/tbcontrl.cxx | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx index d8e0e6d90991..2d398c992dff 100644 --- a/svx/source/tbxctrls/tbcontrl.cxx +++ b/svx/source/tbxctrls/tbcontrl.cxx @@ -856,7 +856,7 @@ SvxStyleBox_Base::SvxStyleBox_Base(std::unique_ptr<weld::ComboBox> xWidget, m_xWidget->connect_custom_get_size(LINK(this, SvxStyleBox_Base, CustomGetSizeHdl)); m_xWidget->connect_custom_render(LINK(this, SvxStyleBox_Base, CustomRenderHdl)); - m_xWidget->set_custom_renderer(); + m_xWidget->set_custom_renderer(true); m_xWidget->set_entry_width_chars(COMBO_WIDTH_IN_CHARS); } @@ -1632,9 +1632,13 @@ void SvxFontNameBox_Base::ReleaseFocus_Impl() void SvxFontNameBox_Base::EnableControls_Impl() { SvtFontOptions aFontOpt; - bool bEnable = aFontOpt.IsFontHistoryEnabled(); - sal_uInt16 nEntries = bEnable ? MAX_MRU_FONTNAME_ENTRIES : 0; - if (m_xWidget->get_max_mru_count() != nEntries) + bool bEnableMRU = aFontOpt.IsFontHistoryEnabled(); + sal_uInt16 nEntries = bEnableMRU ? MAX_MRU_FONTNAME_ENTRIES : 0; + + bool bNewWYSIWYG = aFontOpt.IsFontWYSIWYGEnabled(); + bool bOldWYSIWYG = m_xWidget->IsWYSIWYGEnabled(); + + if (m_xWidget->get_max_mru_count() != nEntries || bNewWYSIWYG != bOldWYSIWYG) { // refill in the next GetFocus-Handler pFontList = nullptr; @@ -1642,8 +1646,8 @@ void SvxFontNameBox_Base::EnableControls_Impl() m_xWidget->set_max_mru_count(nEntries); } - if (aFontOpt.IsFontWYSIWYGEnabled()) - m_xWidget->EnableWYSIWYG(); + if (bNewWYSIWYG != bOldWYSIWYG) + m_xWidget->EnableWYSIWYG(bNewWYSIWYG); } IMPL_LINK(SvxFontNameBox_Base, SelectHdl, weld::ComboBox&, rCombo, void) |