diff options
author | Michael Stahl <mstahl@redhat.com> | 2015-07-29 13:51:49 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2015-07-29 13:58:43 +0200 |
commit | 00269d39f655bb0ecb38c043a9516b4faefe6708 (patch) | |
tree | 631f3ed20065b4a40ce960d78b0b44c8a67c34af /svx | |
parent | f08ffc15e21ec60e587825de2450b4d31e88871a (diff) |
svx: remove duplicate "Kuerzen" function
Change-Id: I319ba12684398bcdfcd8d8ede1648e1d213e75a7
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/svdraw/svddrgmt.cxx | 2 | ||||
-rw-r--r-- | svx/source/svdraw/svdoole2.cxx | 4 | ||||
-rw-r--r-- | svx/source/svdraw/svdtrans.cxx | 33 |
3 files changed, 3 insertions, 36 deletions
diff --git a/svx/source/svdraw/svddrgmt.cxx b/svx/source/svdraw/svddrgmt.cxx index 52cce9c28376..aa445ded01f0 100644 --- a/svx/source/svdraw/svddrgmt.cxx +++ b/svx/source/svdraw/svddrgmt.cxx @@ -2422,7 +2422,7 @@ void SdrDragShear::MoveSdrDrag(const Point& rPnt) bResize=true; double nCos=cos(nTmpAngle*nPi180); aNeuFact=nCos; - Kuerzen(aFact,10); // three decimals should be enough + aFact.ReduceInaccurate(10); // three decimals should be enough } if (nNewAngle>8900) diff --git a/svx/source/svdraw/svdoole2.cxx b/svx/source/svdraw/svdoole2.cxx index 3dff9dd4cca8..b0988d8e3c23 100644 --- a/svx/source/svdraw/svdoole2.cxx +++ b/svx/source/svdraw/svdoole2.cxx @@ -2225,8 +2225,8 @@ bool SdrOle2Obj::CalculateNewScaling( Fraction& aScaleWidth, Fraction& aScaleHei aScaleHeight = Fraction(aSize.Height(), aObjAreaSize.Height() ); // reduce to 10 binary digits - Kuerzen(aScaleHeight, 10); - Kuerzen(aScaleWidth, 10); + aScaleHeight.ReduceInaccurate(10); + aScaleWidth.ReduceInaccurate(10); return true; } diff --git a/svx/source/svdraw/svdtrans.cxx b/svx/source/svdraw/svdtrans.cxx index 476b4be808e4..424cb91892d7 100644 --- a/svx/source/svdraw/svdtrans.cxx +++ b/svx/source/svdraw/svdtrans.cxx @@ -584,39 +584,6 @@ long BigMulDiv(long nVal, long nMul, long nDiv) return 0x7fffffff; } -void Kuerzen(Fraction& rF, unsigned nDigits) -{ - sal_Int32 nMul=rF.GetNumerator(); - sal_Int32 nDiv=rF.GetDenominator(); - bool bNeg = false; - if (nMul<0) { nMul=-nMul; bNeg=!bNeg; } - if (nDiv<0) { nDiv=-nDiv; bNeg=!bNeg; } - if (nMul==0 || nDiv==0) return; - sal_uInt32 a; - a=sal_uInt32(nMul); unsigned nMulZ=0; // count leading zeros - while (a<0x00800000) { nMulZ+=8; a<<=8; } - while (a<0x80000000) { nMulZ++; a<<=1; } - a=sal_uInt32(nDiv); unsigned nDivZ=0; // count leading zeros - while (a<0x00800000) { nDivZ+=8; a<<=8; } - while (a<0x80000000) { nDivZ++; a<<=1; } - // count the number of digits - int nMulDigits=32-nMulZ; - int nDivDigits=32-nDivZ; - // count how many decimal places can be removed - int nMulWeg=nMulDigits-nDigits; if (nMulWeg<0) nMulWeg=0; - int nDivWeg=nDivDigits-nDigits; if (nDivWeg<0) nDivWeg=0; - int nWeg=std::min(nMulWeg,nDivWeg); - nMul>>=nWeg; - nDiv>>=nWeg; - if (nMul==0 || nDiv==0) { - DBG_WARNING("Math error after canceling decimal places."); - return; - } - if (bNeg) nMul=-nMul; - rF=Fraction(nMul,nDiv); -} - - // How many eU units fit into a mm, respectively an inch? // Or: How many mm, respectively inches, are there in an eU (and then give me the inverse) |