cui/source/dialogs/SpellDialog.cxx | 20 ++++++++++++++++++++ cui/source/inc/SpellDialog.hxx | 1 + 2 files changed, 21 insertions(+)
New commits: commit 1da1bf44a7220637d13fa07dff5327e5e1bc7bc1 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Thu Sep 5 10:00:04 2019 +0100 Commit: Adolfo Jayme Barrientos <fit...@ubuntu.com> CommitDate: Wed Sep 18 01:29:54 2019 +0200 Resolves: tdf#127033 use UI font for spell checking widget Change-Id: I18e0459bf16ee69860b7dcc8c5ecc75a7805fe13 Reviewed-on: https://gerrit.libreoffice.org/78634 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos <fit...@ubuntu.com> diff --git a/cui/source/dialogs/SpellDialog.cxx b/cui/source/dialogs/SpellDialog.cxx index 74af6f7d2a57..ea79e61d5177 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> @@ -1116,6 +1118,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, diff --git a/cui/source/inc/SpellDialog.hxx b/cui/source/inc/SpellDialog.hxx index 3696f1f8e2d6..9da339df0446 100644 --- a/cui/source/inc/SpellDialog.hxx +++ b/cui/source/inc/SpellDialog.hxx @@ -80,6 +80,7 @@ private: protected: virtual bool KeyInput( const KeyEvent& rKEvt ) override; + virtual void makeEditEngine() override; public: SentenceEditWindow_Impl(); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits