summaryrefslogtreecommitdiff
path: root/starmath/source/node.cxx
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2022-11-03 21:36:26 +0200
committerMike Kaganski <mike.kaganski@collabora.com>2022-11-04 05:32:27 +0100
commita37a979107a8643136ff3733b5b350b6b1be2bb7 (patch)
tree0e8cdf06b166177426bc51d18ccc97494ec5e43b /starmath/source/node.cxx
parent5efb023c27e693654b09c45894a6f4a50f3d950e (diff)
Use o3tl::convert in Math
... and use our standard definition of pt. Change-Id: I5a162b137360210335b84de33606dc7404cfc2de Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142204 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'starmath/source/node.cxx')
-rw-r--r--starmath/source/node.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/starmath/source/node.cxx b/starmath/source/node.cxx
index 421c9e03955e..7b7f331bbf10 100644
--- a/starmath/source/node.cxx
+++ b/starmath/source/node.cxx
@@ -135,8 +135,8 @@ void SmNode::SetFontSize(const Fraction &rSize, FontSizeType nType)
if (!(Flags() & FontChangeMask::Size))
{
- Fraction aVal (SmPtsTo100th_mm(rSize.GetNumerator()),
- rSize.GetDenominator());
+ constexpr auto md = o3tl::getConversionMulDiv(o3tl::Length::pt, o3tl::Length::mm100);
+ Fraction aVal (Fraction(md.first, md.second) * rSize);
tools::Long nHeight = static_cast<tools::Long>(aVal);
aFntSize = GetFont().GetFontSize();
@@ -168,7 +168,7 @@ void SmNode::SetFontSize(const Fraction &rSize, FontSizeType nType)
}
// check the requested size against maximum value
- static int const nMaxVal = SmPtsTo100th_mm(128);
+ constexpr int nMaxVal = o3tl::convert(128, o3tl::Length::pt, o3tl::Length::mm100);
if (aFntSize.Height() > nMaxVal)
aFntSize.setHeight( nMaxVal );