diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2021-08-10 08:10:19 +0900 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2021-08-11 06:41:17 +0200 |
commit | fa339b3adb53300ae68913bed87e18caf9f2e262 (patch) | |
tree | e3aed1bb38664cfe343a6d7f0803d2312c86c76a /reportdesign/source/ui/dlg/Condition.cxx | |
parent | e89404f00b25cfddd4098b4b2cf900d190617221 (diff) |
convert some LogicToLogic calls to use o3tl::convert instead
If a LogicToLogic uses fixed units, we can use o3tl::convert
instead. We can also do the same for all other cases where
LogicToLogic is used, but that needs additional investigation to
determine if it is safe to do so.
Note:
MapUnit::Pixel is converted to o3tl::Length::pt because it assumed
72 PPI for a logical pixel, which corresponds with the conversion
rate of a point (72 PPI).
Today, 96 PPI is standard, which is also used for o3tl::Length:px.
Change-Id: I29126df38bfcfda74b5d83d4cb880a378aecd18b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120230
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'reportdesign/source/ui/dlg/Condition.cxx')
-rw-r--r-- | reportdesign/source/ui/dlg/Condition.cxx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/reportdesign/source/ui/dlg/Condition.cxx b/reportdesign/source/ui/dlg/Condition.cxx index c4a05704c177..030685c572a4 100644 --- a/reportdesign/source/ui/dlg/Condition.cxx +++ b/reportdesign/source/ui/dlg/Condition.cxx @@ -320,7 +320,7 @@ void Condition::updateToolbar(const uno::Reference< report::XReportControlFormat { vcl::Font aBaseFont( Application::GetDefaultDevice()->GetSettings().GetStyleSettings().GetAppFont() ); SvxFont aFont( VCLUnoHelper::CreateFont( _xReportControlFormat->getFontDescriptor(), aBaseFont ) ); - aFont.SetFontHeight(OutputDevice::LogicToLogic(Size(0, aFont.GetFontHeight()), MapMode(MapUnit::MapPoint), MapMode(MapUnit::MapTwip)).Height()); + aFont.SetFontHeight(o3tl::convert(aFont.GetFontHeight(), o3tl::Length::pt, o3tl::Length::twip)); aFont.SetEmphasisMark( static_cast< FontEmphasisMark >( _xReportControlFormat->getControlTextEmphasis() ) ); aFont.SetRelief( static_cast< FontRelief >( _xReportControlFormat->getCharRelief() ) ); aFont.SetColor( Color(ColorTransparency, _xReportControlFormat->getCharColor()) ); |