summaryrefslogtreecommitdiff
path: root/cui/source/dialogs
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-09-05 10:00:04 +0100
committerCaolán McNamara <caolanm@redhat.com>2019-09-05 12:45:18 +0200
commitaae9f2765036569901ec0924ac16ac1f6d91ef48 (patch)
treea046b64cb4ab98e8cb3c01b5a1fa850a819af9c4 /cui/source/dialogs
parent57c9bdab377a00649299d1a4c9ed2f9e5e03b84e (diff)
Resolves: tdf#127033 use UI font for spell checking widget
Change-Id: I18e0459bf16ee69860b7dcc8c5ecc75a7805fe13 Reviewed-on: https://gerrit.libreoffice.org/78632 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'cui/source/dialogs')
-rw-r--r--cui/source/dialogs/SpellDialog.cxx20
1 files changed, 20 insertions, 0 deletions
diff --git a/cui/source/dialogs/SpellDialog.cxx b/cui/source/dialogs/SpellDialog.cxx
index ab03a51c4e15..5e9e6f4d764f 100644
--- a/cui/source/dialogs/SpellDialog.cxx
+++ b/cui/source/dialogs/SpellDialog.cxx
@@ -28,6 +28,8 @@
#include <unotools/lingucfg.hxx>
#include <editeng/colritem.hxx>
#include <editeng/eeitem.hxx>
+#include <editeng/fhgtitem.hxx>
+#include <editeng/fontitem.hxx>
#include <editeng/langitem.hxx>
#include <editeng/splwrap.hxx>
#include <editeng/unolingu.hxx>
@@ -1104,6 +1106,24 @@ SentenceEditWindow_Impl::SentenceEditWindow_Impl()
{
}
+// tdf#127033 want to use UI font so override makeEditEngine to enable that
+void SentenceEditWindow_Impl::makeEditEngine()
+{
+ SfxItemPool* pItemPool = EditEngine::CreatePool();
+
+ vcl::Font aAppFont(Application::GetSettings().GetStyleSettings().GetAppFont());
+
+ pItemPool->SetPoolDefaultItem(SvxFontItem(aAppFont.GetFamilyType(),aAppFont.GetFamilyName(),"",PITCH_DONTKNOW,RTL_TEXTENCODING_DONTKNOW,EE_CHAR_FONTINFO));
+ pItemPool->SetPoolDefaultItem(SvxFontItem(aAppFont.GetFamilyType(),aAppFont.GetFamilyName(),"",PITCH_DONTKNOW,RTL_TEXTENCODING_DONTKNOW,EE_CHAR_FONTINFO_CJK));
+ pItemPool->SetPoolDefaultItem(SvxFontItem(aAppFont.GetFamilyType(),aAppFont.GetFamilyName(),"",PITCH_DONTKNOW,RTL_TEXTENCODING_DONTKNOW,EE_CHAR_FONTINFO_CTL));
+
+ pItemPool->SetPoolDefaultItem(SvxFontHeightItem(aAppFont.GetFontHeight() * 20, 100, EE_CHAR_FONTHEIGHT));
+ pItemPool->SetPoolDefaultItem(SvxFontHeightItem(aAppFont.GetFontHeight() * 20, 100, EE_CHAR_FONTHEIGHT_CJK));
+ pItemPool->SetPoolDefaultItem(SvxFontHeightItem(aAppFont.GetFontHeight() * 20, 100, EE_CHAR_FONTHEIGHT_CTL));
+
+ m_xEditEngine.reset(new EditEngine(pItemPool));
+}
+
void SentenceEditWindow_Impl::SetDrawingArea(weld::DrawingArea* pDrawingArea)
{
Size aSize(pDrawingArea->get_approximate_digit_width() * 60,