summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-07-04 18:00:52 +0100
committerCaolán McNamara <caolanm@redhat.com>2020-07-05 16:42:39 +0200
commita5f95804c1a730fb393c33b49e6fbe0f5a5e9eac (patch)
tree44ceb650ccfa1e7e5178d8902ceb6f088acf47af /svx
parent72bb13af1808b27a293e09a3ead2aadd049e9ec1 (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/+/97991 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/tbxctrls/tbcontrl.cxx16
1 files changed, 10 insertions, 6 deletions
diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index 732ad7d9f835..d64e033d6823 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);
}
@@ -1635,9 +1635,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;
@@ -1645,8 +1649,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)