diff options
author | David Tardon <dtardon@redhat.com> | 2014-10-16 15:30:32 +0200 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2014-10-16 17:44:44 +0200 |
commit | 582ef22d3e8e30ffd58f092d37ffda30bd07bd9e (patch) | |
tree | 80c42b34da7e7ee05843b572f7311b3c230de9dd /starmath/inc | |
parent | ada4862afc3227b04c12960ded761db24f61257e (diff) |
fdo#84854 it seems long is not enough on 32 bit
Fraction used BigInt internally for computations, rational does nothing
like that.
Change-Id: I3e9b25074f979bc291208f7c6362c3c40eb77ff5
Diffstat (limited to 'starmath/inc')
-rw-r--r-- | starmath/inc/node.hxx | 12 | ||||
-rw-r--r-- | starmath/inc/utility.hxx | 18 | ||||
-rw-r--r-- | starmath/inc/view.hxx | 2 |
3 files changed, 16 insertions, 16 deletions
diff --git a/starmath/inc/node.hxx b/starmath/inc/node.hxx index 93ed6210fcb4..10bd3eb9c22a 100644 --- a/starmath/inc/node.hxx +++ b/starmath/inc/node.hxx @@ -134,8 +134,8 @@ public: SmFace & GetFont() { return aFace; }; void SetFont(const SmFace &rFace); - void SetFontSize(const boost::rational<long> &rRelSize, sal_uInt16 nType); - void SetSize(const boost::rational<long> &rScale); + void SetFontSize(const boost::rational<sal_Int64> &rRelSize, sal_uInt16 nType); + void SetSize(const boost::rational<sal_Int64> &rScale); virtual void Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell); virtual void PrepareAttributes(); @@ -1240,18 +1240,18 @@ public: class SmFontNode : public SmStructureNode { sal_uInt16 nSizeType; - boost::rational<long> aFontSize; + boost::rational<sal_Int64> aFontSize; public: SmFontNode(const SmToken &rNodeToken) : SmStructureNode(NFONT, rNodeToken) { nSizeType = FNTSIZ_MULTIPLY; - aFontSize = boost::rational<long>(1L); + aFontSize = boost::rational<sal_Int64>(1L); } - void SetSizeParameter(const boost::rational<long> &rValue, sal_uInt16 nType); - const boost::rational<long> & GetSizeParameter() const {return aFontSize;} + void SetSizeParameter(const boost::rational<sal_Int64> &rValue, sal_uInt16 nType); + const boost::rational<sal_Int64> & GetSizeParameter() const {return aFontSize;} const sal_uInt16& GetSizeType() const {return nSizeType;} virtual void Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell) SAL_OVERRIDE; diff --git a/starmath/inc/utility.hxx b/starmath/inc/utility.hxx index 8cb9254004f8..4ef2b9ffa610 100644 --- a/starmath/inc/utility.hxx +++ b/starmath/inc/utility.hxx @@ -41,27 +41,27 @@ 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 boost::rational<sal_Int64> &rNumPts) + // as above but with argument 'rNumPts' as 'boost::rational<sal_Int64>' { - boost::rational<long> aTmp (254000L, 7227L); + boost::rational<sal_Int64> aTmp (254000L, 7227L); return boost::rational_cast<long>(aTmp * rNumPts); } -inline boost::rational<long> Sm100th_mmToPts(long nNum100th_mm) +inline boost::rational<sal_Int64> 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); + boost::rational<sal_Int64> aTmp (7227L, 254000L); + return aTmp *= boost::rational<sal_Int64>(nNum100th_mm); } -inline long SmRoundFraction(const boost::rational<long> &rFrac) +inline long SmRoundFraction(const boost::rational<sal_Int64> &rFrac) { - SAL_WARN_IF( rFrac <= boost::rational<long>(), "starmath", "Ooops..." ); + SAL_WARN_IF( rFrac <= boost::rational<sal_Int64>(), "starmath", "Ooops..." ); return (rFrac.numerator() + rFrac.denominator() / 2) / rFrac.denominator(); } @@ -109,7 +109,7 @@ public: SmFace & operator = (const SmFace &rFace); }; -SmFace & operator *= (SmFace &rFace, const boost::rational<long> &rFrac); +SmFace & operator *= (SmFace &rFace, const boost::rational<sal_Int64> &rFrac); diff --git a/starmath/inc/view.hxx b/starmath/inc/view.hxx index b23572e2d1e9..a9f3bb3a703b 100644 --- a/starmath/inc/view.hxx +++ b/starmath/inc/view.hxx @@ -276,7 +276,7 @@ protected: virtual void InnerResizePixel(const Point &rOfs, const Size &rSize) SAL_OVERRIDE; virtual void OuterResizePixel(const Point &rOfs, const Size &rSize) SAL_OVERRIDE; virtual void QueryObjAreaPixel( Rectangle& rRect ) const SAL_OVERRIDE; - virtual void SetZoomFactor( const boost::rational<long> &rX, const boost::rational<long> &rY ) SAL_OVERRIDE; + virtual void SetZoomFactor( const boost::rational<sal_Int64> &rX, const boost::rational<sal_Int64> &rY ) SAL_OVERRIDE; public: TYPEINFO_OVERRIDE(); |