summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorNoel <noelgrandin@gmail.com>2020-11-11 18:08:40 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-11-12 07:37:38 +0100
commit1397a1c8e4995b0dd336478e564880fe8ad91d1d (patch)
tree41a4cf915bb52d453e6eb5a57c15b8718d847874 /svx
parent48b667a7e7d25f835f95df89162a7849d6972531 (diff)
remove BigInt::operator tools::Long()
which was introduced in commit adf0738d2dbfa742d0e9ef130954fb4638a8e90d Author: Noel Grandin <noel.grandin@collabora.co.uk> Date: Wed Jan 3 14:25:15 2018 +0200 long->sal_Int32 in BigInt presumably to make the conversion easier. Instead just fix the call-sites to select a better conversion, BigInt only returns 32-bits of precision anyway. Change-Id: I2e4354bcfded01763fe3312a715ef37800297876 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105602 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/svdraw/svdattr.cxx2
-rw-r--r--svx/source/svdraw/svdedtv1.cxx8
-rw-r--r--svx/source/svdraw/svdobj.cxx8
-rw-r--r--svx/source/svdraw/svdotxdr.cxx8
-rw-r--r--svx/source/svdraw/svdtrans.cxx2
-rw-r--r--svx/source/svdraw/svdxcgv.cxx4
-rw-r--r--svx/source/xoutdev/xattr.cxx2
7 files changed, 17 insertions, 17 deletions
diff --git a/svx/source/svdraw/svdattr.cxx b/svx/source/svdraw/svdattr.cxx
index 2e007ea7d513..58aa365e02ae 100644
--- a/svx/source/svdraw/svdattr.cxx
+++ b/svx/source/svdraw/svdattr.cxx
@@ -855,7 +855,7 @@ void SdrMetricItem::ScaleMetrics(tools::Long nMul, tools::Long nDiv)
aVal*=nMul;
aVal+=nDiv/2; // to round accurately
aVal/=nDiv;
- SetValue(tools::Long(aVal));
+ SetValue(sal_Int32(aVal));
}
}
diff --git a/svx/source/svdraw/svdedtv1.cxx b/svx/source/svdraw/svdedtv1.cxx
index 0beba3a215aa..5f98c816c65f 100644
--- a/svx/source/svdraw/svdedtv1.cxx
+++ b/svx/source/svdraw/svdedtv1.cxx
@@ -131,10 +131,10 @@ void SdrEditView::SetMarkedObjRect(const tools::Rectangle& rRect)
} else {
t=0; b=h1;
}
- aR1.SetLeft(tools::Long(l) );
- aR1.SetRight(tools::Long(r) );
- aR1.SetTop(tools::Long(t) );
- aR1.SetBottom(tools::Long(b) );
+ aR1.SetLeft(sal_Int32(l) );
+ aR1.SetRight(sal_Int32(r) );
+ aR1.SetTop(sal_Int32(t) );
+ aR1.SetBottom(sal_Int32(b) );
aR1.Move(x1,y1);
}
pO->SetSnapRect(aR1);
diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx
index 638c590a52cd..6b2db29caf7d 100644
--- a/svx/source/svdraw/svdobj.cxx
+++ b/svx/source/svdraw/svdobj.cxx
@@ -1236,12 +1236,12 @@ tools::Rectangle SdrObject::ImpDragCalcRect(const SdrDragStat& rDrag) const
if (bEcke) { // corner point handles
bool bUseX=(aXFact<aYFact) != bBigOrtho;
if (bUseX) {
- tools::Long nNeed=tools::Long(BigInt(nHgt0)*BigInt(nXMul)/BigInt(nXDiv));
+ tools::Long nNeed=sal_Int32(BigInt(nHgt0)*BigInt(nXMul)/BigInt(nXDiv));
if (bYNeg) nNeed=-nNeed;
if (bTop) aTmpRect.SetTop(aTmpRect.Bottom()-nNeed );
if (bBtm) aTmpRect.SetBottom(aTmpRect.Top()+nNeed );
} else {
- tools::Long nNeed=tools::Long(BigInt(nWdt0)*BigInt(nYMul)/BigInt(nYDiv));
+ tools::Long nNeed=sal_Int32(BigInt(nWdt0)*BigInt(nYMul)/BigInt(nYDiv));
if (bXNeg) nNeed=-nNeed;
if (bLft) aTmpRect.SetLeft(aTmpRect.Right()-nNeed );
if (bRgt) aTmpRect.SetRight(aTmpRect.Left()+nNeed );
@@ -1249,13 +1249,13 @@ tools::Rectangle SdrObject::ImpDragCalcRect(const SdrDragStat& rDrag) const
} else { // apex handles
if ((bLft || bRgt) && nXDiv!=0) {
tools::Long nHgt0b=aRect.Bottom()-aRect.Top();
- tools::Long nNeed=tools::Long(BigInt(nHgt0b)*BigInt(nXMul)/BigInt(nXDiv));
+ tools::Long nNeed=sal_Int32(BigInt(nHgt0b)*BigInt(nXMul)/BigInt(nXDiv));
aTmpRect.AdjustTop( -((nNeed-nHgt0b)/2) );
aTmpRect.SetBottom(aTmpRect.Top()+nNeed );
}
if ((bTop || bBtm) && nYDiv!=0) {
tools::Long nWdt0b=aRect.Right()-aRect.Left();
- tools::Long nNeed=tools::Long(BigInt(nWdt0b)*BigInt(nYMul)/BigInt(nYDiv));
+ tools::Long nNeed=sal_Int32(BigInt(nWdt0b)*BigInt(nYMul)/BigInt(nYDiv));
aTmpRect.AdjustLeft( -((nNeed-nWdt0b)/2) );
aTmpRect.SetRight(aTmpRect.Left()+nNeed );
}
diff --git a/svx/source/svdraw/svdotxdr.cxx b/svx/source/svdraw/svdotxdr.cxx
index 86adbdac2daa..429f30df1106 100644
--- a/svx/source/svdraw/svdotxdr.cxx
+++ b/svx/source/svdraw/svdotxdr.cxx
@@ -113,12 +113,12 @@ tools::Rectangle SdrTextObj::ImpDragCalcRect(const SdrDragStat& rDrag) const
if (bEcke) { // corner point handles
bool bUseX=(aXFact<aYFact) != bBigOrtho;
if (bUseX) {
- tools::Long nNeed=tools::Long(BigInt(nHgt0)*BigInt(nXMul)/BigInt(nXDiv));
+ tools::Long nNeed=sal_Int32(BigInt(nHgt0)*BigInt(nXMul)/BigInt(nXDiv));
if (bYNeg) nNeed=-nNeed;
if (bTop) aTmpRect.SetTop(aTmpRect.Bottom()-nNeed );
if (bBtm) aTmpRect.SetBottom(aTmpRect.Top()+nNeed );
} else {
- tools::Long nNeed=tools::Long(BigInt(nWdt0)*BigInt(nYMul)/BigInt(nYDiv));
+ tools::Long nNeed=sal_Int32(BigInt(nWdt0)*BigInt(nYMul)/BigInt(nYDiv));
if (bXNeg) nNeed=-nNeed;
if (bLft) aTmpRect.SetLeft(aTmpRect.Right()-nNeed );
if (bRgt) aTmpRect.SetRight(aTmpRect.Left()+nNeed );
@@ -126,13 +126,13 @@ tools::Rectangle SdrTextObj::ImpDragCalcRect(const SdrDragStat& rDrag) const
} else { // apex handles
if ((bLft || bRgt) && nXDiv!=0) {
tools::Long nHgt0b=maRect.Bottom()-maRect.Top();
- tools::Long nNeed=tools::Long(BigInt(nHgt0b)*BigInt(nXMul)/BigInt(nXDiv));
+ tools::Long nNeed=sal_Int32(BigInt(nHgt0b)*BigInt(nXMul)/BigInt(nXDiv));
aTmpRect.AdjustTop( -((nNeed-nHgt0b)/2) );
aTmpRect.SetBottom(aTmpRect.Top()+nNeed );
}
if ((bTop || bBtm) && nYDiv!=0) {
tools::Long nWdt0b=maRect.Right()-maRect.Left();
- tools::Long nNeed=tools::Long(BigInt(nWdt0b)*BigInt(nYMul)/BigInt(nYDiv));
+ tools::Long nNeed=sal_Int32(BigInt(nWdt0b)*BigInt(nYMul)/BigInt(nYDiv));
aTmpRect.AdjustLeft( -((nNeed-nWdt0b)/2) );
aTmpRect.SetRight(aTmpRect.Left()+nNeed );
}
diff --git a/svx/source/svdraw/svdtrans.cxx b/svx/source/svdraw/svdtrans.cxx
index f225e3d5d6b6..a098606ada05 100644
--- a/svx/source/svdraw/svdtrans.cxx
+++ b/svx/source/svdraw/svdtrans.cxx
@@ -568,7 +568,7 @@ tools::Long BigMulDiv(tools::Long nVal, tools::Long nMul, tools::Long nDiv)
if(nDiv)
{
aVal/=nDiv;
- return tools::Long(aVal);
+ return sal_Int32(aVal);
}
return 0x7fffffff;
}
diff --git a/svx/source/svdraw/svdxcgv.cxx b/svx/source/svdraw/svdxcgv.cxx
index 21d0451e7f3c..e658f0f4d1b2 100644
--- a/svx/source/svdraw/svdxcgv.cxx
+++ b/svx/source/svdraw/svdxcgv.cxx
@@ -402,8 +402,8 @@ void SdrExchangeView::ImpPasteObject(SdrObject* pObj, SdrObjList& rLst, const Po
nSizX *= aDstFr.GetDenominator();
nSizY *= double(aMapFact.Y() * rMap.GetScaleY());
nSizY /= aDstFr.GetNumerator();
- tools::Long xs=nSizX;
- tools::Long ys=nSizY;
+ tools::Long xs=sal_Int32(nSizX);
+ tools::Long ys=sal_Int32(nSizY);
Point aPos(rCenter.X()-xs/2,rCenter.Y()-ys/2);
tools::Rectangle aR(aPos.X(),aPos.Y(),aPos.X()+xs,aPos.Y()+ys);
pObj->SetLogicRect(aR);
diff --git a/svx/source/xoutdev/xattr.cxx b/svx/source/xoutdev/xattr.cxx
index f8b532ab554e..072448f7121c 100644
--- a/svx/source/xoutdev/xattr.cxx
+++ b/svx/source/xoutdev/xattr.cxx
@@ -103,7 +103,7 @@ static tools::Long ScaleMetricValue( tools::Long nVal, tools::Long nMul, tools::
aVal/=nDiv;
- return tools::Long( aVal );
+ return sal_Int32( aVal );
}
NameOrIndex::NameOrIndex(sal_uInt16 _nWhich, sal_Int32 nIndex) :