summaryrefslogtreecommitdiffstats
path: root/extensions
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2021-08-10 08:10:19 +0900
committerTomaž Vajngerl <quikee@gmail.com>2021-08-11 06:41:17 +0200
commitfa339b3adb53300ae68913bed87e18caf9f2e262 (patch)
treee3aed1bb38664cfe343a6d7f0803d2312c86c76a /extensions
parentThere is no LANGUAGE_ENGLISH {en} locale but LANGUAGE_ENGLISH_US {en-US} (diff)
downloadcore-fa339b3adb53300ae68913bed87e18caf9f2e262.tar.gz
core-fa339b3adb53300ae68913bed87e18caf9f2e262.zip
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 'extensions')
-rw-r--r--extensions/source/propctrlr/fontdialog.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/extensions/source/propctrlr/fontdialog.cxx b/extensions/source/propctrlr/fontdialog.cxx
index 0e4b11be2896..89e6fb80e635 100644
--- a/extensions/source/propctrlr/fontdialog.cxx
+++ b/extensions/source/propctrlr/fontdialog.cxx
@@ -218,7 +218,8 @@ namespace pcr
// build SfxItems with the values
SvxFontItem aFontItem(static_cast<FontFamily>(nFontFamily), aFontName, aFontStyleName, PITCH_DONTKNOW, nFontCharset, CFID_FONT);
- nFontHeight = static_cast<float>(OutputDevice::LogicToLogic(Size(0, static_cast<sal_Int32>(nFontHeight)), MapMode(MapUnit::MapPoint), MapMode(MapUnit::MapTwip)).Height());
+ nFontHeight = static_cast<float>(o3tl::convert(nFontHeight, o3tl::Length::pt, o3tl::Length::twip));
+
SvxFontHeightItem aSvxFontHeightItem(static_cast<sal_uInt32>(nFontHeight),100,CFID_HEIGHT);
FontWeight eWeight=vcl::unohelper::ConvertFontWeight(nFontWeight);
@@ -319,7 +320,7 @@ namespace pcr
const SvxFontHeightItem& rSvxFontHeightItem =
static_cast<const SvxFontHeightItem&>(_rSet.Get(CFID_HEIGHT));
- float nHeight = static_cast<float>(OutputDevice::LogicToLogic(Size(0, rSvxFontHeightItem.GetHeight()), MapMode(MapUnit::MapTwip), MapMode(MapUnit::MapPoint)).Height());
+ float nHeight = static_cast<float>(o3tl::convert(rSvxFontHeightItem.GetHeight(), o3tl::Length::twip, o3tl::Length::pt));
lcl_pushBackPropertyValue( _out_properties, PROPERTY_FONT_HEIGHT,makeAny(nHeight));
}