diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-03-12 12:29:52 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-03-13 20:28:12 +0100 |
commit | b8d3d4ad0f5bf4f449118214a91219b98ee506c3 (patch) | |
tree | 47bcf39252f1357b0e97a628be4f5b4611297f78 /sc | |
parent | c58cc416b604de0891fc8976bcf7cf099e2e8e00 (diff) |
merge the various SetPointFont via DefaultDevice calls
Change-Id: I769bb95c588c7222ff0dc6c4b845dfc3f0d7cbc0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112390
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/app/inputwin.cxx | 3 | ||||
-rw-r--r-- | sc/source/ui/dbgui/csvgrid.cxx | 8 |
2 files changed, 4 insertions, 7 deletions
diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx index bc91f0c835b6..926157e71d83 100644 --- a/sc/source/ui/app/inputwin.cxx +++ b/sc/source/ui/app/inputwin.cxx @@ -2051,8 +2051,7 @@ void ScTextWnd::SetDrawingArea(weld::DrawingArea* pDrawingArea) // always use application font, so a font with cjk chars can be installed vcl::Font aAppFont = Application::GetSettings().GetStyleSettings().GetAppFont(); - if (vcl::Window* pDefaultDevice = dynamic_cast<vcl::Window*>(Application::GetDefaultDevice())) - pDefaultDevice->SetPointFont(rDevice, aAppFont); + weld::SetPointFont(rDevice, aAppFont); aTextFont = rDevice.GetFont(); Size aFontSize = aTextFont.GetFontSize(); diff --git a/sc/source/ui/dbgui/csvgrid.cxx b/sc/source/ui/dbgui/csvgrid.cxx index d289ec0f69d4..a732039c788f 100644 --- a/sc/source/ui/dbgui/csvgrid.cxx +++ b/sc/source/ui/dbgui/csvgrid.cxx @@ -38,6 +38,7 @@ #include <vcl/settings.hxx> #include <vcl/svapp.hxx> #include <vcl/virdev.hxx> +#include <vcl/weldutils.hxx> #include <editeng/colritem.hxx> #include <editeng/fhgtitem.hxx> @@ -96,11 +97,8 @@ void ScCsvGrid::SetDrawingArea(weld::DrawingArea* pDrawingArea) maHeaderFont = Application::GetSettings().GetStyleSettings().GetAppFont(); // expand the point size of the desired font to the equivalent pixel size - if (vcl::Window* pDefaultDevice = dynamic_cast<vcl::Window*>(Application::GetDefaultDevice())) - { - pDefaultDevice->SetPointFont(rRefDevice, maHeaderFont); - maHeaderFont = rRefDevice.GetFont(); - } + weld::SetPointFont(rRefDevice, maHeaderFont); + maHeaderFont = rRefDevice.GetFont(); // Because this is an always LeftToRight layout widget the initial size of // this widget needs to be smaller than the size of the parent scrolling |