diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2022-11-03 21:36:26 +0200 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2022-11-04 07:33:41 +0100 |
commit | 8548e3caa8ed6d4e77d136e1b8d3c3b18cf074bb (patch) | |
tree | e05dc9f564fb0f788a355e375eb81ebfc1917d63 /starmath/inc/utility.hxx | |
parent | 807888b849187eaf5d1c0e4a064f66702180a8e9 (diff) |
Use o3tl::convert in Mathcp-22.05.8-1
... 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>
(cherry picked from commit a37a979107a8643136ff3733b5b350b6b1be2bb7)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142208
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Diffstat (limited to 'starmath/inc/utility.hxx')
-rw-r--r-- | starmath/inc/utility.hxx | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/starmath/inc/utility.hxx b/starmath/inc/utility.hxx index ee504017038a..c0b473264532 100644 --- a/starmath/inc/utility.hxx +++ b/starmath/inc/utility.hxx @@ -27,35 +27,6 @@ #include <tools/fract.hxx> #include <deque> -inline tools::Long SmPtsTo100th_mm(tools::Long nNumPts) - // returns the length (in 100th of mm) that corresponds to the length - // 'nNumPts' (in units points). - // 72.27 [pt] = 1 [inch] = 2,54 [cm] = 2540 [100th of mm]. - // result is being rounded to the nearest integer. -{ - SAL_WARN_IF( nNumPts < 0, "starmath", "Ooops..." ); - // broken into multiple and fraction of 'nNumPts' to reduce chance - // of overflow - // (7227 / 2) is added in order to round to the nearest integer - return 35 * nNumPts + (nNumPts * 1055L + (7227 / 2)) / 7227L; -} - - -inline Fraction Sm100th_mmToPts(tools::Long nNum100th_mm) - // returns the length (in points) that corresponds to the length - // 'nNum100th_mm' (in 100th of mm). -{ - SAL_WARN_IF( nNum100th_mm < 0, "starmath", "Ooops..." ); - return Fraction(7227L, 254000L) * Fraction(nNum100th_mm); -} - - -inline tools::Long SmRoundFraction(const Fraction &rFrac) -{ - SAL_WARN_IF( rFrac <= Fraction(), "starmath", "Ooops..." ); - return (rFrac.GetNumerator() + rFrac.GetDenominator() / 2) / rFrac.GetDenominator(); -} - class SmViewShell; SmViewShell * SmGetActiveView(); |