diff options
Diffstat (limited to 'starmath/inc/utility.hxx')
-rw-r--r-- | starmath/inc/utility.hxx | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/starmath/inc/utility.hxx b/starmath/inc/utility.hxx index 8cb9254004f8..304c10c7e841 100644 --- a/starmath/inc/utility.hxx +++ b/starmath/inc/utility.hxx @@ -23,7 +23,7 @@ #include <vcl/fixed.hxx> #include <vcl/combobox.hxx> #include <vcl/lstbox.hxx> -#include <tools/rational.hxx> +#include <tools/fract.hxx> #include <deque> @@ -41,28 +41,28 @@ inline long SmPtsTo100th_mm(long nNumPts) } -inline long SmPtsTo100th_mm(const boost::rational<long> &rNumPts) - // as above but with argument 'rNumPts' as 'boost::rational<long>' +inline long SmPtsTo100th_mm(const Fraction &rNumPts) + // as above but with argument 'rNumPts' as 'Fraction' { - boost::rational<long> aTmp (254000L, 7227L); - return boost::rational_cast<long>(aTmp * rNumPts); + Fraction aTmp (254000L, 7227L); + return aTmp *= rNumPts; } -inline boost::rational<long> Sm100th_mmToPts(long nNum100th_mm) +inline Fraction Sm100th_mmToPts(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..." ); - boost::rational<long> aTmp (7227L, 254000L); - return aTmp *= boost::rational<long>(nNum100th_mm); + Fraction aTmp (7227L, 254000L); + return aTmp *= Fraction(nNum100th_mm); } -inline long SmRoundFraction(const boost::rational<long> &rFrac) +inline long SmRoundFraction(const Fraction &rFrac) { - SAL_WARN_IF( rFrac <= boost::rational<long>(), "starmath", "Ooops..." ); - return (rFrac.numerator() + rFrac.denominator() / 2) / rFrac.denominator(); + SAL_WARN_IF( rFrac <= Fraction(), "starmath", "Ooops..." ); + return (rFrac.GetNumerator() + rFrac.GetDenominator() / 2) / rFrac.GetDenominator(); } @@ -109,7 +109,7 @@ public: SmFace & operator = (const SmFace &rFace); }; -SmFace & operator *= (SmFace &rFace, const boost::rational<long> &rFrac); +SmFace & operator *= (SmFace &rFace, const Fraction &rFrac); |