diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-09-29 15:34:30 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-09-30 10:04:54 +0200 |
commit | 61050c6d7b8bceef2704eba0bfe4473ee75e669d (patch) | |
tree | 763b0bce8ed7d0f8f440c493b8f2c5a322ee2de6 /svx | |
parent | 52a07baebf7d1bfeda7a74dd0eac22b9e349fb56 (diff) |
tdf#141633 set correct font sizes in tableview child widgets
Change-Id: Ic96a0ad8203bf3903546c0c2f07d96254ca01e4c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122832
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/fmcomp/gridcell.cxx | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx index 0fe549bf651b..da5a387ad187 100644 --- a/svx/source/fmcomp/gridcell.cxx +++ b/svx/source/fmcomp/gridcell.cxx @@ -60,6 +60,7 @@ #include <svx/dialmgr.hxx> #include <toolkit/helper/vclunohelper.hxx> #include <tools/debug.hxx> +#include <tools/fract.hxx> #include <tools/diagnose_ex.h> #include <vcl/settings.hxx> #include <vcl/svapp.hxx> @@ -694,11 +695,11 @@ bool DbCellControl::Commit() void DbCellControl::ImplInitWindow( vcl::Window const & rParent, const InitWindowFacet _eInitWhat ) { - vcl::Window* pWindows[] = { m_pPainter, m_pWindow }; + svt::ControlBase* pWindows[] = { m_pPainter, m_pWindow }; if (_eInitWhat & InitWindowFacet::WritingMode) { - for (vcl::Window* pWindow : pWindows) + for (svt::ControlBase* pWindow : pWindows) { if (pWindow) pWindow->EnableRTL(rParent.IsRTLEnabled()); @@ -707,26 +708,29 @@ void DbCellControl::ImplInitWindow( vcl::Window const & rParent, const InitWindo if (_eInitWhat & InitWindowFacet::Font) { - for (vcl::Window* pWindow : pWindows) + const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings(); + const Fraction& rZoom = rParent.GetZoom(); + + for (svt::ControlBase* pWindow : pWindows) { if (!pWindow) continue; - pWindow->SetZoom(rParent.GetZoom()); - - const StyleSettings& rStyleSettings = pWindow->GetSettings().GetStyleSettings(); vcl::Font aFont = rStyleSettings.GetFieldFont(); aFont.SetTransparent(isTransparent()); if (rParent.IsControlFont()) - { - pWindow->SetControlFont(rParent.GetControlFont()); aFont.Merge(rParent.GetControlFont()); + + if (rZoom.GetNumerator() != rZoom.GetDenominator()) + { + Size aSize = aFont.GetFontSize(); + aSize.setWidth(std::round(double(aSize.Width() * rZoom))); + aSize.setHeight(std::round(double(aSize.Height() * rZoom))); + aFont.SetFontSize(aSize); } - else - pWindow->SetControlFont(); - pWindow->SetZoomedPointFont(*pWindow->GetOutDev(), aFont); // FIXME RenderContext + pWindow->SetPointFont(aFont); } } @@ -737,7 +741,7 @@ void DbCellControl::ImplInitWindow( vcl::Window const & rParent, const InitWindo bool bTextLineColor = rParent.IsTextLineColor(); Color aTextLineColor(rParent.GetTextLineColor()); - for (vcl::Window* pWindow : pWindows) + for (svt::ControlBase* pWindow : pWindows) { if (pWindow) { @@ -759,7 +763,7 @@ void DbCellControl::ImplInitWindow( vcl::Window const & rParent, const InitWindo if (rParent.IsControlBackground()) { Color aColor(rParent.GetControlBackground()); - for (vcl::Window* pWindow : pWindows) + for (svt::ControlBase* pWindow : pWindows) { if (pWindow) { |