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 /sfx2 | |
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 'sfx2')
-rw-r--r-- | sfx2/source/control/unoctitm.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/view/ipclient.cxx | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx index 235812a239ea..3d3bfd430c4f 100644 --- a/sfx2/source/control/unoctitm.cxx +++ b/sfx2/source/control/unoctitm.cxx @@ -1236,7 +1236,7 @@ static void InterceptLOKStateChangeEvent(sal_uInt16 nSID, SfxViewFrame* pViewFra { float nScaleValue = 1000.0; nValue *= nScaleValue; - sal_Int32 nConvertedValue = OutputDevice::LogicToLogic(nValue, MapUnit::MapTwip, MapUnit::MapInch); + sal_Int32 nConvertedValue = o3tl::convert(nValue, o3tl::Length::twip, o3tl::Length::in); aBuffer.append(nConvertedValue / nScaleValue); } } diff --git a/sfx2/source/view/ipclient.cxx b/sfx2/source/view/ipclient.cxx index 3c40c7bdf4a6..7484033b2808 100644 --- a/sfx2/source/view/ipclient.cxx +++ b/sfx2/source/view/ipclient.cxx @@ -342,7 +342,7 @@ void SAL_CALL SfxInPlaceClient_Impl::activatingInplace() if (m_pClient->GetEditWin()) { if (m_pClient->GetEditWin()->GetMapMode().GetMapUnit() == MapUnit::Map100thMM) - aRect = OutputDevice::LogicToLogic(aRect, MapMode(MapUnit::Map100thMM), MapMode(MapUnit::MapTwip)); + aRect = o3tl::convert(aRect, o3tl::Length::mm100, o3tl::Length::twip); } OString str = aRect.toString() + ", \"INPLACE\""; |