From 4fbd63860500b2db76df4d5aedbe5e3aa31fac69 Mon Sep 17 00:00:00 2001 From: Noel Date: Mon, 12 Oct 2020 09:52:12 +0200 Subject: switching long to a 64-bit type on 64-bit windows (*) create a rewriting plugin to do most of the work, heavily based on the fakebool plugin (*) but there are still a number of "long"s in the codebase that will need to be done by hand (*) the plugin needs lots of handholding, due to needing to add #include and update macros Change-Id: I8184d7000ca482c0469514bb73178c3a1123b1e9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104203 Tested-by: Jenkins Reviewed-by: Noel Grandin --- svx/source/svdraw/sdrpagewindow.cxx | 16 ++--- svx/source/svdraw/svdattr.cxx | 8 +-- svx/source/svdraw/svddrag.cxx | 14 ++-- svx/source/svdraw/svddrgm1.hxx | 14 ++-- svx/source/svdraw/svddrgmt.cxx | 54 +++++++-------- svx/source/svdraw/svdedtv1.cxx | 134 ++++++++++++++++++------------------ svx/source/svdraw/svdedxv.cxx | 8 +-- svx/source/svdraw/svdfmtf.cxx | 14 ++-- svx/source/svdraw/svdglev.cxx | 2 +- svx/source/svdraw/svdglue.cxx | 44 ++++++------ svx/source/svdraw/svdhdl.cxx | 6 +- svx/source/svdraw/svdmodel.cxx | 16 ++--- svx/source/svdraw/svdmrkv.cxx | 24 +++---- svx/source/svdraw/svdoashp.cxx | 62 ++++++++--------- svx/source/svdraw/svdobj.cxx | 78 ++++++++++----------- svx/source/svdraw/svdocapt.cxx | 10 +-- svx/source/svdraw/svdocirc.cxx | 74 ++++++++++---------- svx/source/svdraw/svdoedge.cxx | 100 +++++++++++++-------------- svx/source/svdraw/svdograf.cxx | 16 ++--- svx/source/svdraw/svdogrp.cxx | 32 ++++----- svx/source/svdraw/svdomeas.cxx | 124 ++++++++++++++++----------------- svx/source/svdraw/svdomedia.cxx | 4 +- svx/source/svdraw/svdoole2.cxx | 20 +++--- svx/source/svdraw/svdopath.cxx | 124 ++++++++++++++++----------------- svx/source/svdraw/svdorect.cxx | 14 ++-- svx/source/svdraw/svdotext.cxx | 74 ++++++++++---------- svx/source/svdraw/svdotxat.cxx | 16 ++--- svx/source/svdraw/svdotxdr.cxx | 24 +++---- svx/source/svdraw/svdotxed.cxx | 12 ++-- svx/source/svdraw/svdotxtr.cxx | 24 +++---- svx/source/svdraw/svdovirt.cxx | 12 ++-- svx/source/svdraw/svdpagv.cxx | 44 ++++++------ svx/source/svdraw/svdpntv.cxx | 10 +-- svx/source/svdraw/svdpoev.cxx | 2 +- svx/source/svdraw/svdsnpv.cxx | 46 ++++++------- svx/source/svdraw/svdtrans.cxx | 110 ++++++++++++++--------------- svx/source/svdraw/svdview.cxx | 4 +- svx/source/svdraw/svdxcgv.cxx | 4 +- 38 files changed, 697 insertions(+), 697 deletions(-) (limited to 'svx/source/svdraw') diff --git a/svx/source/svdraw/sdrpagewindow.cxx b/svx/source/svdraw/sdrpagewindow.cxx index 0b0ea0536945..c3230b12285d 100644 --- a/svx/source/svdraw/sdrpagewindow.cxx +++ b/svx/source/svdraw/sdrpagewindow.cxx @@ -440,10 +440,10 @@ void SdrPageWindow::InvalidatePageWindow(const basegfx::B2DRange& rRange) } const tools::Rectangle aVCLDiscreteRectangle( - static_cast(floor(aDiscreteRange.getMinX())), - static_cast(floor(aDiscreteRange.getMinY())), - static_cast(ceil(aDiscreteRange.getMaxX())), - static_cast(ceil(aDiscreteRange.getMaxY()))); + static_cast(floor(aDiscreteRange.getMinX())), + static_cast(floor(aDiscreteRange.getMinY())), + static_cast(ceil(aDiscreteRange.getMaxX())), + static_cast(ceil(aDiscreteRange.getMaxY()))); const bool bWasMapModeEnabled(rWindow.IsMapModeEnabled()); rWindow.EnableMapMode(false); @@ -456,10 +456,10 @@ void SdrPageWindow::InvalidatePageWindow(const basegfx::B2DRange& rRange) // that the drawinglayer units are 100ths of mm, so they are easy to // convert to twips const tools::Rectangle aRect100thMM( - static_cast(floor(rRange.getMinX())), - static_cast(floor(rRange.getMinY())), - static_cast(ceil(rRange.getMaxX())), - static_cast(ceil(rRange.getMaxY()))); + static_cast(floor(rRange.getMinX())), + static_cast(floor(rRange.getMinY())), + static_cast(ceil(rRange.getMaxX())), + static_cast(ceil(rRange.getMaxY()))); const tools::Rectangle aRectTwips = OutputDevice::LogicToLogic(aRect100thMM, MapMode(MapUnit::Map100thMM), MapMode(MapUnit::MapTwip)); diff --git a/svx/source/svdraw/svdattr.cxx b/svx/source/svdraw/svdattr.cxx index 158a1ab762b4..2e007ea7d513 100644 --- a/svx/source/svdraw/svdattr.cxx +++ b/svx/source/svdraw/svdattr.cxx @@ -848,21 +848,21 @@ bool SdrMetricItem::HasMetrics() const return true; } -void SdrMetricItem::ScaleMetrics(long nMul, long nDiv) +void SdrMetricItem::ScaleMetrics(tools::Long nMul, tools::Long nDiv) { if (GetValue()!=0) { BigInt aVal(GetValue()); aVal*=nMul; aVal+=nDiv/2; // to round accurately aVal/=nDiv; - SetValue(long(aVal)); + SetValue(tools::Long(aVal)); } } bool SdrMetricItem::GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString& rText, const IntlWrapper&) const { - long nValue=GetValue(); + tools::Long nValue=GetValue(); SdrFormatter aFmt(eCoreMetric,ePresMetric); rText = aFmt.GetStr(nValue); rText += " " + SdrFormatter::GetUnitStr(ePresMetric); @@ -1247,7 +1247,7 @@ bool SdrTextAniAmountItem::HasMetrics() const return GetValue()>0; } -void SdrTextAniAmountItem::ScaleMetrics(long nMul, long nDiv) +void SdrTextAniAmountItem::ScaleMetrics(tools::Long nMul, tools::Long nDiv) { if (GetValue()>0) { BigInt aVal(GetValue()); diff --git a/svx/source/svdraw/svddrag.cxx b/svx/source/svdraw/svddrag.cxx index 381a8def5f66..0c785dc67426 100644 --- a/svx/source/svdraw/svddrag.cxx +++ b/svx/source/svdraw/svddrag.cxx @@ -86,9 +86,9 @@ void SdrDragStat::PrevPoint() bool SdrDragStat::CheckMinMoved(const Point& rPnt) { if (!bMinMoved) { - long dx=rPnt.X()-GetPrev().X(); if (dx<0) dx=-dx; - long dy=rPnt.Y()-GetPrev().Y(); if (dy<0) dy=-dy; - if (dx>=long(nMinMov) || dy>=long(nMinMov)) + tools::Long dx=rPnt.X()-GetPrev().X(); if (dx<0) dx=-dx; + tools::Long dy=rPnt.Y()-GetPrev().Y(); if (dy<0) dy=-dy; + if (dx>=tools::Long(nMinMov) || dy>=tools::Long(nMinMov)) bMinMoved=true; } return bMinMoved; @@ -96,8 +96,8 @@ bool SdrDragStat::CheckMinMoved(const Point& rPnt) Fraction SdrDragStat::GetXFact() const { - long nMul=mvPnts.back().X()-aRef1.X(); - long nDiv=GetPrev().X()-aRef1.X(); + tools::Long nMul=mvPnts.back().X()-aRef1.X(); + tools::Long nDiv=GetPrev().X()-aRef1.X(); if (nDiv==0) nDiv=1; if (bHorFixed) { nMul=1; nDiv=1; } return Fraction(nMul,nDiv); @@ -105,8 +105,8 @@ Fraction SdrDragStat::GetXFact() const Fraction SdrDragStat::GetYFact() const { - long nMul=mvPnts.back().Y()-aRef1.Y(); - long nDiv=GetPrev().Y()-aRef1.Y(); + tools::Long nMul=mvPnts.back().Y()-aRef1.Y(); + tools::Long nDiv=GetPrev().Y()-aRef1.Y(); if (nDiv==0) nDiv=1; if (bVerFixed) { nMul=1; nDiv=1; } return Fraction(nMul,nDiv); diff --git a/svx/source/svdraw/svddrgm1.hxx b/svx/source/svdraw/svddrgm1.hxx index 8a0fcca1a745..25c1a5af126a 100644 --- a/svx/source/svdraw/svddrgm1.hxx +++ b/svx/source/svdraw/svddrgm1.hxx @@ -49,8 +49,8 @@ class SdrDragRotate : public SdrDragMethod private: double nSin; double nCos; - long nAngle0; - long nAngle; + tools::Long nAngle0; + tools::Long nAngle; bool bRight; public: @@ -70,8 +70,8 @@ class SdrDragShear : public SdrDragMethod { private: Fraction aFact; - long nAngle0; - long nAngle; + tools::Long nAngle0; + tools::Long nAngle; double nTan; bool bVertical; // contort vertically bool bResize; // shear and resize @@ -95,7 +95,7 @@ class SdrDragMirror : public SdrDragMethod { private: Point aDif; - long nAngle; + tools::Long nAngle; bool bMirrored; bool bSide0; @@ -159,8 +159,8 @@ private: bool bUpr; bool bLwr; bool bAtCenter; - long nAngle; - long nMarkSize; + tools::Long nAngle; + tools::Long nMarkSize; SdrCrookMode eMode; // helpers for applyCurrentTransformationToPolyPolygon diff --git a/svx/source/svdraw/svddrgmt.cxx b/svx/source/svdraw/svddrgmt.cxx index 22c70944d2bd..6f6ac53a11fa 100644 --- a/svx/source/svdraw/svddrgmt.cxx +++ b/svx/source/svdraw/svddrgmt.cxx @@ -1011,8 +1011,8 @@ void SdrDragMovHdl::MoveSdrDrag(const Point& rNoSnapPnt) if (!DragStat().IsNoSnap()) { - long nBestXSnap=0; - long nBestYSnap=0; + tools::Long nBestXSnap=0; + tools::Long nBestYSnap=0; bool bXSnapped=false; bool bYSnapped=false; Point aDif(aPnt-DragStat().GetStart()); @@ -1042,7 +1042,7 @@ void SdrDragMovHdl::MoveSdrDrag(const Point& rNoSnapPnt) else { if (!DragStat().IsNoSnap()) SnapPos(aPnt); - long nSA=0; + tools::Long nSA=0; if (getSdrDragView().IsAngleSnapEnabled()) nSA=getSdrDragView().GetSnapAngle(); @@ -1068,8 +1068,8 @@ void SdrDragMovHdl::MoveSdrDrag(const Point& rNoSnapPnt) if (pH!=nullptr) { Point aRef(pH->GetPos()); - long nAngle=NormAngle36000(GetAngle(aPnt-aRef)); - long nNewAngle=nAngle; + tools::Long nAngle=NormAngle36000(GetAngle(aPnt-aRef)); + tools::Long nNewAngle=nAngle; nNewAngle+=nSA/2; nNewAngle/=nSA; nNewAngle*=nSA; @@ -1550,8 +1550,8 @@ void SdrDragMove::MoveSdrDrag(const Point& rNoSnapPnt_) bYSnapped=false; Point aNoSnapPnt(rNoSnapPnt_); const tools::Rectangle& aSR=GetMarkedRect(); - long nMovedx=aNoSnapPnt.X()-DragStat().GetStart().X(); - long nMovedy=aNoSnapPnt.Y()-DragStat().GetStart().Y(); + tools::Long nMovedx=aNoSnapPnt.X()-DragStat().GetStart().X(); + tools::Long nMovedy=aNoSnapPnt.Y()-DragStat().GetStart().Y(); Point aLO(aSR.TopLeft()); aLO.AdjustX(nMovedx ); aLO.AdjustY(nMovedy ); Point aRU(aSR.BottomRight()); aRU.AdjustX(nMovedx ); aRU.AdjustY(nMovedy ); Point aLU(aLO.X(),aRU.Y()); @@ -1891,10 +1891,10 @@ void SdrDragResize::MoveSdrDrag(const Point& rNoSnapPnt) } } - long nXDiv=aStart.X()-aRef.X(); if (nXDiv==0) nXDiv=1; - long nYDiv=aStart.Y()-aRef.Y(); if (nYDiv==0) nYDiv=1; - long nXMul=aPnt.X()-aRef.X(); - long nYMul=aPnt.Y()-aRef.Y(); + tools::Long nXDiv=aStart.X()-aRef.X(); if (nXDiv==0) nXDiv=1; + tools::Long nYDiv=aStart.Y()-aRef.Y(); if (nYDiv==0) nYDiv=1; + tools::Long nXMul=aPnt.X()-aRef.X(); + tools::Long nYMul=aPnt.Y()-aRef.Y(); if (nXDiv<0) { @@ -2117,8 +2117,8 @@ void SdrDragRotate::MoveSdrDrag(const Point& rPnt_) if (!DragStat().CheckMinMoved(aPnt)) return; - long nNewAngle=NormAngle36000(GetAngle(aPnt-DragStat().GetRef1())-nAngle0); - long nSA=0; + tools::Long nNewAngle=NormAngle36000(GetAngle(aPnt-DragStat().GetRef1())-nAngle0); + tools::Long nSA=0; if (getSdrDragView().IsAngleSnapEnabled()) nSA=getSdrDragView().GetSnapAngle(); @@ -2280,7 +2280,7 @@ void SdrDragShear::MoveSdrDrag(const Point& rPnt) return; bResize=!getSdrDragView().IsOrtho(); - long nSA=0; + tools::Long nSA=0; if (getSdrDragView().IsAngleSnapEnabled()) nSA=getSdrDragView().GetSnapAngle(); @@ -2304,7 +2304,7 @@ void SdrDragShear::MoveSdrDrag(const Point& rPnt) Point aRef(DragStat().GetRef1()); Point aDif(aPnt-aRef); - long nNewAngle=0; + tools::Long nNewAngle=0; if (bSlant) { @@ -2359,7 +2359,7 @@ void SdrDragShear::MoveSdrDrag(const Point& rPnt) if (bSlant) { // calculate resize for slant // when angle snapping is activated, disable 89 degree limit - long nTmpAngle=nNewAngle; + tools::Long nTmpAngle=nNewAngle; if (bUpSideDown) nNewAngle-=18000; if (bNeg) nTmpAngle=-nTmpAngle; bResize=true; @@ -2480,7 +2480,7 @@ SdrDragMirror::SdrDragMirror(SdrDragView& rNewView) bool SdrDragMirror::ImpCheckSide(const Point& rPnt) const { - long nAngle1=GetAngle(rPnt-DragStat().GetRef1()); + tools::Long nAngle1=GetAngle(rPnt-DragStat().GetRef1()); nAngle1-=nAngle; nAngle1=NormAngle36000(nAngle1); @@ -3118,8 +3118,8 @@ void SdrDragCrook::MoveSdrDrag(const Point& rPnt) bAtCenter=true; Fraction aNewFract(1,1); - long dx1=aPnt.X()-aNewCenter.X(); - long dy1=aPnt.Y()-aNewCenter.Y(); + tools::Long dx1=aPnt.X()-aNewCenter.X(); + tools::Long dy1=aPnt.Y()-aNewCenter.Y(); bValid=bVertical ? dx1!=0 : dy1!=0; if (bValid) @@ -3130,25 +3130,25 @@ void SdrDragCrook::MoveSdrDrag(const Point& rPnt) bValid = std::abs(dy1)*100>std::abs(dx1); } - long nNewRad=0; + tools::Long nNewRad=0; nAngle=0; if (bValid) { double a=0; // slope of the radius - long nPntWink=0; + tools::Long nPntWink=0; if (bVertical) { a=static_cast(dy1)/static_cast(dx1); // slope of the radius - nNewRad=(static_cast(dy1*a)+dx1) /2; + nNewRad=(static_cast(dy1*a)+dx1) /2; aNewCenter.AdjustX(nNewRad ); nPntWink=GetAngle(aPnt-aNewCenter); } else { a=static_cast(dx1)/static_cast(dy1); // slope of the radius - nNewRad=(static_cast(dx1*a)+dy1) /2; + nNewRad=(static_cast(dx1*a)+dy1) /2; aNewCenter.AdjustY(nNewRad ); nPntWink=GetAngle(aPnt-aNewCenter)-9000; } @@ -3182,7 +3182,7 @@ void SdrDragCrook::MoveSdrDrag(const Point& rPnt) if (bResize) { - long nMul=static_cast(nUmfang*NormAngle36000(nPntWink)/36000); + tools::Long nMul=static_cast(nUmfang*NormAngle36000(nPntWink)/36000); if (bAtCenter) nMul*=2; @@ -3192,7 +3192,7 @@ void SdrDragCrook::MoveSdrDrag(const Point& rPnt) } else { - nAngle=static_cast((nMarkSize*360/nUmfang)*100)/2; + nAngle=static_cast((nMarkSize*360/nUmfang)*100)/2; if (nAngle==0) bValid=false; @@ -3207,12 +3207,12 @@ void SdrDragCrook::MoveSdrDrag(const Point& rPnt) if (!bValid && bResize) { - long nMul=bVertical ? dy1 : dx1; + tools::Long nMul=bVertical ? dy1 : dx1; if (bLft || bUpr) nMul=-nMul; - long nDiv=nMarkSize; + tools::Long nDiv=nMarkSize; if (bAtCenter) { diff --git a/svx/source/svdraw/svdedtv1.cxx b/svx/source/svdraw/svdedtv1.cxx index 86a3cdd35725..0beba3a215aa 100644 --- a/svx/source/svdraw/svdedtv1.cxx +++ b/svx/source/svdraw/svdedtv1.cxx @@ -82,14 +82,14 @@ void SdrEditView::SetMarkedObjRect(const tools::Rectangle& rRect) tools::Rectangle aR0(GetMarkedObjRect()); DBG_ASSERT(!aR0.IsEmpty(),"SetMarkedObjRect(): GetMarkedObjRect() is empty."); if (aR0.IsEmpty()) return; - long x0=aR0.Left(); - long y0=aR0.Top(); - long w0=aR0.Right()-x0; - long h0=aR0.Bottom()-y0; - long x1=rRect.Left(); - long y1=rRect.Top(); - long w1=rRect.Right()-x1; - long h1=rRect.Bottom()-y1; + tools::Long x0=aR0.Left(); + tools::Long y0=aR0.Top(); + tools::Long w0=aR0.Right()-x0; + tools::Long h0=aR0.Bottom()-y0; + tools::Long x1=rRect.Left(); + tools::Long y1=rRect.Top(); + tools::Long w1=rRect.Right()-x1; + tools::Long h1=rRect.Bottom()-y1; const bool bUndo = IsUndoEnabled(); if( bUndo ) @@ -131,10 +131,10 @@ void SdrEditView::SetMarkedObjRect(const tools::Rectangle& rRect) } else { t=0; b=h1; } - aR1.SetLeft(long(l) ); - aR1.SetRight(long(r) ); - aR1.SetTop(long(t) ); - aR1.SetBottom(long(b) ); + aR1.SetLeft(tools::Long(l) ); + aR1.SetRight(tools::Long(r) ); + aR1.SetTop(tools::Long(t) ); + aR1.SetBottom(tools::Long(b) ); aR1.Move(x1,y1); } pO->SetSnapRect(aR1); @@ -280,9 +280,9 @@ void SdrEditView::ResizeMultMarkedObj(const Point& rRef, EndUndo(); } -long SdrEditView::GetMarkedObjRotate() const +tools::Long SdrEditView::GetMarkedObjRotate() const { - long nRetval(0); + tools::Long nRetval(0); if(GetMarkedObjectCount()) { @@ -295,7 +295,7 @@ long SdrEditView::GetMarkedObjRotate() const return nRetval; } -void SdrEditView::RotateMarkedObj(const Point& rRef, long nAngle, bool bCopy) +void SdrEditView::RotateMarkedObj(const Point& rRef, tools::Long nAngle, bool bCopy) { const bool bUndo = IsUndoEnabled(); if( bUndo ) @@ -431,16 +431,16 @@ void SdrEditView::MirrorMarkedObjVertical() MirrorMarkedObj(aCenter,aPt2); } -long SdrEditView::GetMarkedObjShear() const +tools::Long SdrEditView::GetMarkedObjShear() const { bool b1st=true; bool bOk=true; - long nAngle=0; + tools::Long nAngle=0; const size_t nMarkCount=GetMarkedObjectCount(); for (size_t nm=0; nmGetMarkedSdrObj(); - long nAngle2=pO->GetShearAngle(); + tools::Long nAngle2=pO->GetShearAngle(); if (b1st) nAngle=nAngle2; else if (nAngle2!=nAngle) bOk=false; b1st=false; @@ -451,7 +451,7 @@ long SdrEditView::GetMarkedObjShear() const return nAngle; } -void SdrEditView::ShearMarkedObj(const Point& rRef, long nAngle, bool bVShear, bool bCopy) +void SdrEditView::ShearMarkedObj(const Point& rRef, tools::Long nAngle, bool bVShear, bool bCopy) { const bool bUndo = IsUndoEnabled(); @@ -688,25 +688,25 @@ void SdrEditView::SetNotPersistAttrToMarked(const SfxItemSet& rAttr) tools::Rectangle aAllSnapRect(GetMarkedObjRect()); const SfxPoolItem *pPoolItem=nullptr; if (rAttr.GetItemState(SDRATTR_TRANSFORMREF1X,true,&pPoolItem)==SfxItemState::SET) { - long n=static_cast(pPoolItem)->GetValue(); + tools::Long n=static_cast(pPoolItem)->GetValue(); SetRef1(Point(n,GetRef1().Y())); } if (rAttr.GetItemState(SDRATTR_TRANSFORMREF1Y,true,&pPoolItem)==SfxItemState::SET) { - long n=static_cast(pPoolItem)->GetValue(); + tools::Long n=static_cast(pPoolItem)->GetValue(); SetRef1(Point(GetRef1().X(),n)); } if (rAttr.GetItemState(SDRATTR_TRANSFORMREF2X,true,&pPoolItem)==SfxItemState::SET) { - long n=static_cast(pPoolItem)->GetValue(); + tools::Long n=static_cast(pPoolItem)->GetValue(); SetRef2(Point(n,GetRef2().Y())); } if (rAttr.GetItemState(SDRATTR_TRANSFORMREF2Y,true,&pPoolItem)==SfxItemState::SET) { - long n=static_cast(pPoolItem)->GetValue(); + tools::Long n=static_cast(pPoolItem)->GetValue(); SetRef2(Point(GetRef2().X(),n)); } - long nAllPosX=0; bool bAllPosX=false; - long nAllPosY=0; bool bAllPosY=false; - long nAllWdt=0; bool bAllWdt=false; - long nAllHgt=0; bool bAllHgt=false; + tools::Long nAllPosX=0; bool bAllPosX=false; + tools::Long nAllPosY=0; bool bAllPosY=false; + tools::Long nAllWdt=0; bool bAllWdt=false; + tools::Long nAllHgt=0; bool bAllHgt=false; bool bDoIt=false; if (rAttr.GetItemState(SDRATTR_ALLPOSITIONX,true,&pPoolItem)==SfxItemState::SET) { nAllPosX=static_cast(pPoolItem)->GetValue(); @@ -741,15 +741,15 @@ void SdrEditView::SetNotPersistAttrToMarked(const SfxItemSet& rAttr) ResizeMarkedObj(aAllSnapRect.TopLeft(),Fraction(1,1),aYFact); } if (rAttr.GetItemState(SDRATTR_ROTATEALL,true,&pPoolItem)==SfxItemState::SET) { - long nAngle=static_cast(pPoolItem)->GetValue(); + tools::Long nAngle=static_cast(pPoolItem)->GetValue(); RotateMarkedObj(aAllSnapRect.Center(),nAngle); } if (rAttr.GetItemState(SDRATTR_HORZSHEARALL,true,&pPoolItem)==SfxItemState::SET) { - long nAngle=static_cast(pPoolItem)->GetValue(); + tools::Long nAngle=static_cast(pPoolItem)->GetValue(); ShearMarkedObj(aAllSnapRect.Center(),nAngle); } if (rAttr.GetItemState(SDRATTR_VERTSHEARALL,true,&pPoolItem)==SfxItemState::SET) { - long nAngle=static_cast(pPoolItem)->GetValue(); + tools::Long nAngle=static_cast(pPoolItem)->GetValue(); ShearMarkedObj(aAllSnapRect.Center(),nAngle,true); } @@ -772,10 +772,10 @@ void SdrEditView::MergeNotPersistAttrFromMarked(SfxItemSet& rAttr) const { // TODO: Take into account the origin and PvPos. tools::Rectangle aAllSnapRect(GetMarkedObjRect()); // TODO: change this for PolyPt's and GluePt's!!! - long nAllSnapPosX=aAllSnapRect.Left(); - long nAllSnapPosY=aAllSnapRect.Top(); - long nAllSnapWdt=aAllSnapRect.GetWidth()-1; - long nAllSnapHgt=aAllSnapRect.GetHeight()-1; + tools::Long nAllSnapPosX=aAllSnapRect.Left(); + tools::Long nAllSnapPosY=aAllSnapRect.Top(); + tools::Long nAllSnapWdt=aAllSnapRect.GetWidth()-1; + tools::Long nAllSnapHgt=aAllSnapRect.GetHeight()-1; // TODO: could go into CheckPossibilities bool bMovProtect = false, bMovProtectDC = false; bool bSizProtect = false, bSizProtectDC = false; @@ -783,14 +783,14 @@ void SdrEditView::MergeNotPersistAttrFromMarked(SfxItemSet& rAttr) const bool bVisible = true, bVisibleDC = false; SdrLayerID nLayerId(0); bool bLayerDC=false; - long nSnapPosX=0; bool bSnapPosXDC=false; - long nSnapPosY=0; bool bSnapPosYDC=false; - long nSnapWdt=0; bool bSnapWdtDC=false; - long nSnapHgt=0; bool bSnapHgtDC=false; - long nLogicWdt=0; bool bLogicWdtDC=false,bLogicWdtDiff=false; - long nLogicHgt=0; bool bLogicHgtDC=false,bLogicHgtDiff=false; - long nRotAngle=0; bool bRotAngleDC=false; - long nShrAngle=0; bool bShrAngleDC=false; + tools::Long nSnapPosX=0; bool bSnapPosXDC=false; + tools::Long nSnapPosY=0; bool bSnapPosYDC=false; + tools::Long nSnapWdt=0; bool bSnapWdtDC=false; + tools::Long nSnapHgt=0; bool bSnapHgtDC=false; + tools::Long nLogicWdt=0; bool bLogicWdtDC=false,bLogicWdtDiff=false; + tools::Long nLogicHgt=0; bool bLogicHgtDC=false,bLogicHgtDiff=false; + tools::Long nRotAngle=0; bool bRotAngleDC=false; + tools::Long nShrAngle=0; bool bShrAngleDC=false; tools::Rectangle aSnapRect; tools::Rectangle aLogicRect; const size_t nMarkCount=GetMarkedObjectCount(); @@ -1360,8 +1360,8 @@ SfxItemSet SdrEditView::GetGeoAttrFromMarked() const aRetSet.Put(SfxInt32Item(SID_ATTR_TRANSFORM_POS_Y,aRect.Top())); // size - long nResizeRefX=aRect.Left(); - long nResizeRefY=aRect.Top(); + tools::Long nResizeRefX=aRect.Left(); + tools::Long nResizeRefY=aRect.Top(); if (meDragMode==SdrDragMode::Rotate) { // use rotation axis as a reference for resizing, too nResizeRefX=maRef1.X(); nResizeRefY=maRef1.Y(); @@ -1379,8 +1379,8 @@ SfxItemSet SdrEditView::GetGeoAttrFromMarked() const } // rotation - long nRotateRefX=aRect.Center().X(); - long nRotateRefY=aRect.Center().Y(); + tools::Long nRotateRefX=aRect.Center().X(); + tools::Long nRotateRefY=aRect.Center().Y(); if (meDragMode==SdrDragMode::Rotate) { nRotateRefX=aRotateAxe.X(); nRotateRefY=aRotateAxe.Y(); @@ -1390,8 +1390,8 @@ SfxItemSet SdrEditView::GetGeoAttrFromMarked() const aRetSet.Put(SfxInt32Item(SID_ATTR_TRANSFORM_ROT_Y,nRotateRefY)); // shearing - long nShearRefX=aRect.Left(); - long nShearRefY=aRect.Bottom(); + tools::Long nShearRefX=aRect.Left(); + tools::Long nShearRefY=aRect.Bottom(); if (meDragMode==SdrDragMode::Rotate) { // use rotation axis as a reference for shearing, too nShearRefX=aRotateAxe.X(); nShearRefY=aRotateAxe.Y(); @@ -1444,7 +1444,7 @@ SfxItemSet SdrEditView::GetGeoAttrFromMarked() const } eState=aMarkAttr.GetItemState(SDRATTR_ECKENRADIUS); - long nRadius=aMarkAttr.Get(SDRATTR_ECKENRADIUS).GetValue(); + tools::Long nRadius=aMarkAttr.Get(SDRATTR_ECKENRADIUS).GetValue(); if (eState==SfxItemState::DONTCARE) { aRetSet.InvalidateItem(SDRATTR_ECKENRADIUS); } else if (eState==SfxItemState::SET) { @@ -1523,24 +1523,24 @@ void SdrEditView::SetGeoAttrToMarked(const SfxItemSet& rAttr) GetSdrPageView()->LogicToPagePos(aRect); } - long nOldRotateAngle=GetMarkedObjRotate(); - long nOldShearAngle=GetMarkedObjShear(); + tools::Long nOldRotateAngle=GetMarkedObjRotate(); + tools::Long nOldShearAngle=GetMarkedObjShear(); const SdrMarkList& rMarkList=GetMarkedObjectList(); const size_t nMarkCount=rMarkList.GetMarkCount(); SdrObject* pObj=nullptr; RectPoint eSizePoint=RectPoint::MM; - long nPosDX=0; - long nPosDY=0; - long nSizX=0; - long nSizY=0; - long nRotateAngle=0; + tools::Long nPosDX=0; + tools::Long nPosDY=0; + tools::Long nSizX=0; + tools::Long nSizY=0; + tools::Long nRotateAngle=0; bool bModeIsRotate(meDragMode == SdrDragMode::Rotate); - long nRotateX(0); - long nRotateY(0); - long nOldRotateX(0); - long nOldRotateY(0); + tools::Long nRotateX(0); + tools::Long nRotateY(0); + tools::Long nOldRotateX(0); + tools::Long nOldRotateY(0); if(bModeIsRotate) { Point aRotateAxe(maRef1); @@ -1554,9 +1554,9 @@ void SdrEditView::SetGeoAttrToMarked(const SfxItemSet& rAttr) nRotateY = nOldRotateY = aRotateAxe.Y(); } - long nShearAngle=0; - long nShearX=0; - long nShearY=0; + tools::Long nShearAngle=0; + tools::Long nShearX=0; + tools::Long nShearY=0; bool bShearVert=false; bool bChgPos=false; @@ -1620,7 +1620,7 @@ void SdrEditView::SetGeoAttrToMarked(const SfxItemSet& rAttr) // shearing if (SfxItemState::SET==rAttr.GetItemState(SID_ATTR_TRANSFORM_SHEAR,true,&pPoolItem)) { - long nNewShearAngle=static_cast(pPoolItem)->GetValue(); + tools::Long nNewShearAngle=static_cast(pPoolItem)->GetValue(); if (nNewShearAngle>SDRMAXSHEAR) nNewShearAngle=SDRMAXSHEAR; if (nNewShearAngle<-SDRMAXSHEAR) nNewShearAngle=-SDRMAXSHEAR; if (nNewShearAngle!=nOldShearAngle) { @@ -1662,7 +1662,7 @@ void SdrEditView::SetGeoAttrToMarked(const SfxItemSet& rAttr) // corner radius if (m_bEdgeRadiusAllowed && SfxItemState::SET==rAttr.GetItemState(SDRATTR_ECKENRADIUS,true,&pPoolItem)) { - long nRadius=static_cast(pPoolItem)->GetValue(); + tools::Long nRadius=static_cast(pPoolItem)->GetValue(); aSetAttr.Put(makeSdrEckenradiusItem(nRadius)); bSetAttr=true; } @@ -1930,8 +1930,8 @@ void SdrEditView::AlignMarkedObjects(SdrHorAlign eHor, SdrVertAlign eVert) pObj->TakeObjInfo(aInfo); if (aInfo.bMoveAllowed && !pObj->IsMoveProtect()) { - long nXMov=0; - long nYMov=0; + tools::Long nXMov=0; + tools::Long nYMov=0; tools::Rectangle aObjRect(pObj->GetSnapRect()); switch (eVert) { diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx index 82c519dcc037..55674f28e8dd 100644 --- a/svx/source/svdraw/svdedxv.cxx +++ b/svx/source/svdraw/svdedxv.cxx @@ -807,9 +807,9 @@ void SdrObjEditView::ImpInvalidateOutlinerView(OutlinerView const& rOutlView) co { // limit xPixRect because of driver problems when pixel coordinates are too far out Size aMaxXY(pWin->GetOutputSizePixel()); - long a(2 * nPixSiz); - long nMaxX(aMaxXY.Width() + a); - long nMaxY(aMaxXY.Height() + a); + tools::Long a(2 * nPixSiz); + tools::Long nMaxX(aMaxXY.Width() + a); + tools::Long nMaxY(aMaxXY.Height() + a); if (aPixRect.Left() < -a) aPixRect.SetLeft(-a); @@ -1718,7 +1718,7 @@ bool SdrObjEditView::IsTextEditHit(const Point& rHit) const { // check if any characters were actually hit Point aPnt(rHit); aPnt -= aEditArea.TopLeft(); - long nHitTol = 2000; + tools::Long nHitTol = 2000; OutputDevice* pRef = pTextEditOutliner->GetRefDevice(); if (pRef) nHitTol = OutputDevice::LogicToLogic(nHitTol, MapUnit::Map100thMM, diff --git a/svx/source/svdraw/svdfmtf.cxx b/svx/source/svdraw/svdfmtf.cxx index b9fdcacbe2ac..278b93c407a1 100644 --- a/svx/source/svdraw/svdfmtf.cxx +++ b/svx/source/svdraw/svdfmtf.cxx @@ -720,7 +720,7 @@ void ImpSdrGDIMetaFileImport::DoAction(MetaRoundRectAction const & rAct) *mpModel, rAct.GetRect()); SetAttributes(pRect); - long nRad=(rAct.GetHorzRound()+rAct.GetVertRound())/2; + tools::Long nRad=(rAct.GetHorzRound()+rAct.GetVertRound())/2; if (nRad!=0) { SfxItemSet aSet(*mpLineAttr->GetPool(), svl::Items{}); aSet.Put(SdrMetricItem(SDRATTR_ECKENRADIUS, nRad)); @@ -742,8 +742,8 @@ void ImpSdrGDIMetaFileImport::DoAction(MetaEllipseAction const & rAct) void ImpSdrGDIMetaFileImport::DoAction(MetaArcAction const & rAct) { Point aCenter(rAct.GetRect().Center()); - long nStart=GetAngle(rAct.GetStartPoint()-aCenter); - long nEnd=GetAngle(rAct.GetEndPoint()-aCenter); + tools::Long nStart=GetAngle(rAct.GetStartPoint()-aCenter); + tools::Long nEnd=GetAngle(rAct.GetEndPoint()-aCenter); SdrCircObj* pCirc = new SdrCircObj( *mpModel, SdrCircKind::Arc, @@ -755,8 +755,8 @@ void ImpSdrGDIMetaFileImport::DoAction(MetaArcAction const & rAct) void ImpSdrGDIMetaFileImport::DoAction(MetaPieAction const & rAct) { Point aCenter(rAct.GetRect().Center()); - long nStart=GetAngle(rAct.GetStartPoint()-aCenter); - long nEnd=GetAngle(rAct.GetEndPoint()-aCenter); + tools::Long nStart=GetAngle(rAct.GetStartPoint()-aCenter); + tools::Long nEnd=GetAngle(rAct.GetEndPoint()-aCenter); SdrCircObj* pCirc = new SdrCircObj( *mpModel, SdrCircKind::Section, @@ -770,8 +770,8 @@ void ImpSdrGDIMetaFileImport::DoAction(MetaPieAction const & rAct) void ImpSdrGDIMetaFileImport::DoAction(MetaChordAction const & rAct) { Point aCenter(rAct.GetRect().Center()); - long nStart=GetAngle(rAct.GetStartPoint()-aCenter); - long nEnd=GetAngle(rAct.GetEndPoint()-aCenter); + tools::Long nStart=GetAngle(rAct.GetStartPoint()-aCenter); + tools::Long nEnd=GetAngle(rAct.GetEndPoint()-aCenter); SdrCircObj* pCirc = new SdrCircObj( *mpModel, SdrCircKind::Cut, diff --git a/svx/source/svdraw/svdglev.cxx b/svx/source/svdraw/svdglev.cxx index 9d1f19c558cf..370563d8be87 100644 --- a/svx/source/svdraw/svdglev.cxx +++ b/svx/source/svdraw/svdglev.cxx @@ -383,7 +383,7 @@ static void ImpRotate(Point& rPt, const void* p1, const void* /*p2*/, const void RotatePoint(rPt,*static_cast(p1),*static_cast(p3),*static_cast(p4)); } -void SdrGlueEditView::RotateMarkedGluePoints(const Point& rRef, long nAngle, bool bCopy) +void SdrGlueEditView::RotateMarkedGluePoints(const Point& rRef, tools::Long nAngle, bool bCopy) { ForceUndirtyMrkPnt(); OUString aStr(SvxResId(STR_EditRotate)); diff --git a/svx/source/svdraw/svdglue.cxx b/svx/source/svdraw/svdglue.cxx index a662b99bfe0b..0d3db7f8d57d 100644 --- a/svx/source/svdraw/svdglue.cxx +++ b/svx/source/svdraw/svdglue.cxx @@ -63,10 +63,10 @@ Point SdrGluePoint::GetAbsolutePos(const SdrObject& rObj) const default: break; } if (!bNoPercent) { - long nXMul=aSnap.Right()-aSnap.Left(); - long nYMul=aSnap.Bottom()-aSnap.Top(); - long nXDiv=10000; - long nYDiv=10000; + tools::Long nXMul=aSnap.Right()-aSnap.Left(); + tools::Long nYMul=aSnap.Bottom()-aSnap.Top(); + tools::Long nXDiv=10000; + tools::Long nYDiv=10000; if (nXMul!=nXDiv) { aPt.setX( aPt.X() * nXMul ); aPt.setX( aPt.X() / nXDiv ); @@ -107,12 +107,12 @@ void SdrGluePoint::SetAbsolutePos(const Point& rNewPos, const SdrObject& rObj) } aPt-=aOfs; if (!bNoPercent) { - long nXMul=aSnap.Right()-aSnap.Left(); - long nYMul=aSnap.Bottom()-aSnap.Top(); + tools::Long nXMul=aSnap.Right()-aSnap.Left(); + tools::Long nYMul=aSnap.Bottom()-aSnap.Top(); if (nXMul==0) nXMul=1; if (nYMul==0) nYMul=1; - long nXDiv=10000; - long nYDiv=10000; + tools::Long nXDiv=10000; + tools::Long nYDiv=10000; if (nXMul!=nXDiv) { aPt.setX( aPt.X() * nXDiv ); aPt.setX( aPt.X() / nXMul ); @@ -125,7 +125,7 @@ void SdrGluePoint::SetAbsolutePos(const Point& rNewPos, const SdrObject& rObj) aPos=aPt; } -long SdrGluePoint::GetAlignAngle() const +tools::Long SdrGluePoint::GetAlignAngle() const { if (nAlign == (SdrAlign::HORZ_CENTER|SdrAlign::VERT_CENTER)) return 0; // Invalid! @@ -148,7 +148,7 @@ long SdrGluePoint::GetAlignAngle() const return 0; } -void SdrGluePoint::SetAlignAngle(long nAngle) +void SdrGluePoint::SetAlignAngle(tools::Long nAngle) { nAngle=NormAngle36000(nAngle); if (nAngle>=33750 || nAngle<2250) nAlign=SdrAlign::HORZ_RIGHT |SdrAlign::VERT_CENTER; @@ -161,7 +161,7 @@ void SdrGluePoint::SetAlignAngle(long nAngle) else if (nAngle<33750) nAlign=SdrAlign::HORZ_RIGHT |SdrAlign::VERT_BOTTOM; } -long SdrGluePoint::EscDirToAngle(SdrEscapeDirection nEsc) +tools::Long SdrGluePoint::EscDirToAngle(SdrEscapeDirection nEsc) { switch (nEsc) { case SdrEscapeDirection::RIGHT : return 0; @@ -173,7 +173,7 @@ long SdrGluePoint::EscDirToAngle(SdrEscapeDirection nEsc) return 0; } -SdrEscapeDirection SdrGluePoint::EscAngleToDir(long nAngle) +SdrEscapeDirection SdrGluePoint::EscAngleToDir(tools::Long nAngle) { nAngle=NormAngle36000(nAngle); if (nAngle>=31500 || nAngle<4500) @@ -186,7 +186,7 @@ SdrEscapeDirection SdrGluePoint::EscAngleToDir(long nAngle) return SdrEscapeDirection::BOTTOM; } -void SdrGluePoint::Rotate(const Point& rRef, long nAngle, double sn, double cs, const SdrObject* pObj) +void SdrGluePoint::Rotate(const Point& rRef, tools::Long nAngle, double sn, double cs, const SdrObject* pObj) { Point aPt(pObj!=nullptr ? GetAbsolutePos(*pObj) : GetPos()); RotatePoint(aPt,rRef,sn,cs); @@ -206,14 +206,14 @@ void SdrGluePoint::Rotate(const Point& rRef, long nAngle, double sn, double cs, if (pObj!=nullptr) SetAbsolutePos(aPt,*pObj); else SetPos(aPt); } -void SdrGluePoint::Mirror(const Point& rRef1, const Point& rRef2, long nAngle, const SdrObject* pObj) +void SdrGluePoint::Mirror(const Point& rRef1, const Point& rRef2, tools::Long nAngle, const SdrObject* pObj) { Point aPt(pObj!=nullptr ? GetAbsolutePos(*pObj) : GetPos()); MirrorPoint(aPt,rRef1,rRef2); // mirror reference edge if(nAlign != (SdrAlign::HORZ_CENTER|SdrAlign::VERT_CENTER)) { - long nAW=GetAlignAngle(); + tools::Long nAW=GetAlignAngle(); nAW+=2*(nAngle-nAW); SetAlignAngle(nAW); } @@ -221,22 +221,22 @@ void SdrGluePoint::Mirror(const Point& rRef1, const Point& rRef2, long nAngle, c SdrEscapeDirection nEscDir0=nEscDir; SdrEscapeDirection nEscDir1=SdrEscapeDirection::SMART; if (nEscDir0&SdrEscapeDirection::LEFT) { - long nEW=EscDirToAngle(SdrEscapeDirection::LEFT); + tools::Long nEW=EscDirToAngle(SdrEscapeDirection::LEFT); nEW+=2*(nAngle-nEW); nEscDir1|=EscAngleToDir(nEW); } if (nEscDir0&SdrEscapeDirection::TOP) { - long nEW=EscDirToAngle(SdrEscapeDirection::TOP); + tools::Long nEW=EscDirToAngle(SdrEscapeDirection::TOP); nEW+=2*(nAngle-nEW); nEscDir1|=EscAngleToDir(nEW); } if (nEscDir0&SdrEscapeDirection::RIGHT) { - long nEW=EscDirToAngle(SdrEscapeDirection::RIGHT); + tools::Long nEW=EscDirToAngle(SdrEscapeDirection::RIGHT); nEW+=2*(nAngle-nEW); nEscDir1|=EscAngleToDir(nEW); } if (nEscDir0&SdrEscapeDirection::BOTTOM) { - long nEW=EscDirToAngle(SdrEscapeDirection::BOTTOM); + tools::Long nEW=EscDirToAngle(SdrEscapeDirection::BOTTOM); nEW+=2*(nAngle-nEW); nEscDir1|=EscAngleToDir(nEW); } @@ -361,7 +361,7 @@ void SdrGluePointList::SetReallyAbsolute(bool bOn, const SdrObject& rObj) xGP->SetReallyAbsolute(bOn,rObj); } -void SdrGluePointList::Rotate(const Point& rRef, long nAngle, double sn, double cs, const SdrObject* pObj) +void SdrGluePointList::Rotate(const Point& rRef, tools::Long nAngle, double sn, double cs, const SdrObject* pObj) { for (auto& xGP : aList) xGP->Rotate(rRef,nAngle,sn,cs,pObj); @@ -370,11 +370,11 @@ void SdrGluePointList::Rotate(const Point& rRef, long nAngle, double sn, double void SdrGluePointList::Mirror(const Point& rRef1, const Point& rRef2, const SdrObject* pObj) { Point aPt(rRef2); aPt-=rRef1; - long nAngle=GetAngle(aPt); + tools::Long nAngle=GetAngle(aPt); Mirror(rRef1,rRef2,nAngle,pObj); } -void SdrGluePointList::Mirror(const Point& rRef1, const Point& rRef2, long nAngle, const SdrObject* pObj) +void SdrGluePointList::Mirror(const Point& rRef1, const Point& rRef2, tools::Long nAngle, const SdrObject* pObj) { for (auto& xGP : aList) xGP->Mirror(rRef1,rRef2,nAngle,pObj); diff --git a/svx/source/svdraw/svdhdl.cxx b/svx/source/svdraw/svdhdl.cxx index 001fe3580b86..99aae2aeddd9 100644 --- a/svx/source/svdraw/svdhdl.cxx +++ b/svx/source/svdraw/svdhdl.cxx @@ -327,7 +327,7 @@ void SdrHdl::SetMoveOutside( bool bMoveOutside ) } } -void SdrHdl::SetRotationAngle(long n) +void SdrHdl::SetRotationAngle(tools::Long n) { if(nRotationAngle != n) { @@ -966,7 +966,7 @@ PointerStyle SdrHdl::GetPointer() const } else { // When resizing rotated rectangles, rotate the mouse cursor slightly, too if (bSize && nRotationAngle!=0) { - long nHdlAngle=0; + tools::Long nHdlAngle=0; switch (eKind) { case SdrHdlKind::LowerRight: nHdlAngle=31500; break; case SdrHdlKind::Lower: nHdlAngle=27000; break; @@ -1706,7 +1706,7 @@ bool ImpEdgeHdl::IsHorzDrag() const } else if (eEdgeKind==SdrEdgeKind::ThreeLines) { - long nAngle=nObjHdlNum==2 ? rInfo.nAngle1 : rInfo.nAngle2; + tools::Long nAngle=nObjHdlNum==2 ? rInfo.nAngle1 : rInfo.nAngle2; return nAngle==0 || nAngle==18000; } return false; diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx index 81b5dbaad0c4..e45aacaca197 100644 --- a/svx/source/svdraw/svdmodel.cxx +++ b/svx/source/svdraw/svdmodel.cxx @@ -949,7 +949,7 @@ void SdrModel::ImpSetUIUnit() // may need to be changed in the future, too if(1 != nMul || 1 != nDiv) { - const Fraction aTemp(static_cast< long >(nMul), static_cast< long >(nDiv)); + const Fraction aTemp(static_cast< tools::Long >(nMul), static_cast< tools::Long >(nDiv)); nMul = aTemp.GetNumerator(); nDiv = aTemp.GetDenominator(); } @@ -1080,7 +1080,7 @@ OUString SdrModel::GetUnitString(FieldUnit eUnit) } } -OUString SdrModel::GetMetricString(long nVal, bool bNoUnitChars, sal_Int32 nNumDigits) const +OUString SdrModel::GetMetricString(tools::Long nVal, bool bNoUnitChars, sal_Int32 nNumDigits) const { // #i22167# // change to double precision usage to not lose decimal places @@ -1202,7 +1202,7 @@ OUString SdrModel::GetMetricString(long nVal, bool bNoUnitChars, sal_Int32 nNumD return aBuf.makeStringAndClear(); } -OUString SdrModel::GetAngleString(long nAngle) +OUString SdrModel::GetAngleString(tools::Long nAngle) { bool bNeg = nAngle < 0; @@ -1587,7 +1587,7 @@ void SdrModel::Merge(SdrModel& rSourceModel, // get the drawing pages if (bInsPages) { sal_uInt16 nSourcePos=nFirstPageNum; - sal_uInt16 nMergeCount=sal_uInt16(std::abs(static_cast(static_cast(nFirstPageNum)-nLastPageNum))+1); + sal_uInt16 nMergeCount=sal_uInt16(std::abs(static_cast(static_cast(nFirstPageNum)-nLastPageNum))+1); if (nDestPos>GetPageCount()) nDestPos=GetPageCount(); while (nMergeCount>0) { @@ -1695,10 +1695,10 @@ void SdrModel::setUnoModel( const css::uno::Reference< css::uno::XInterface >& x void SdrModel::adaptSizeAndBorderForAllPages( const Size& /*rNewSize*/, - long /*nLeft*/, - long /*nRight*/, - long /*nUpper*/, - long /*nLower*/) + tools::Long /*nLeft*/, + tools::Long /*nRight*/, + tools::Long /*nUpper*/, + tools::Long /*nLower*/) { // base implementation does currently nothing. It may be added if needed, // but we are on SdrModel level here, thus probably have not enough information diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx index 82c5695fead4..5e528e5947db 100644 --- a/svx/source/svdraw/svdmrkv.cxx +++ b/svx/source/svdraw/svdmrkv.cxx @@ -738,7 +738,7 @@ void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle const & rRect, const S { SdrMark* pM = GetSdrMarkByIndex(0); SdrObject* pO = pM->GetMarkedSdrObj(); - long nRotAngle = pO->GetRotateAngle(); + tools::Long nRotAngle = pO->GetRotateAngle(); // true if we are dealing with a RotGrfFlyFrame // (SwVirtFlyDrawObj with a SwGrfNode) bool bWriterGraphic = pO->HasLimitedRotation(); @@ -1497,11 +1497,11 @@ void SdrMarkView::ForceRefToMarked() case SdrDragMode::Mirror: { // first calculate the length of the axis of reflection - long nOutMin=0; - long nOutMax=0; - long nMinLen=0; - long nObjDst=0; - long nOutHgt=0; + tools::Long nOutMin=0; + tools::Long nOutMax=0; + tools::Long nMinLen=0; + tools::Long nObjDst=0; + tools::Long nOutHgt=0; OutputDevice* pOut=GetFirstOutputDevice(); if (pOut!=nullptr) { // minimum length: 50 pixels @@ -1510,7 +1510,7 @@ void SdrMarkView::ForceRefToMarked() nObjDst=pOut->PixelToLogic(Size(0,20)).Height(); // MinY/MaxY // margin = minimum length = 10 pixels - long nDst=pOut->PixelToLogic(Size(0,10)).Height(); + tools::Long nDst=pOut->PixelToLogic(Size(0,10)).Height(); nOutMin=-pOut->GetMapMode().GetOrigin().Y(); nOutMax=pOut->GetOutputSize().Height()-1+nOutMin; nOutMin+=nDst; @@ -1524,18 +1524,18 @@ void SdrMarkView::ForceRefToMarked() } nOutHgt=nOutMax-nOutMin; // otherwise minimum length = 1/4 OutHgt - long nTemp=nOutHgt/4; + tools::Long nTemp=nOutHgt/4; if (nTemp>nMinLen) nMinLen=nTemp; } tools::Rectangle aR(GetMarkedObjBoundRect()); Point aCenter(aR.Center()); - long nMarkHgt=aR.GetHeight()-1; - long nHgt=nMarkHgt+nObjDst*2; // 20 pixels overlapping above and below + tools::Long nMarkHgt=aR.GetHeight()-1; + tools::Long nHgt=nMarkHgt+nObjDst*2; // 20 pixels overlapping above and below if (nHgtnOutHgt) nMinLen=nOutHgt; // TODO: maybe shorten this a little diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx index 8728c67a9b2c..4413d3d700fb 100644 --- a/svx/source/svdraw/svdoashp.cxx +++ b/svx/source/svdraw/svdoashp.cxx @@ -1381,10 +1381,10 @@ void SdrObjCustomShape::AdaptTextMinSize() if(GetTextBounds(aTextBound)) { - const long nHDist(GetTextLeftDistance() + GetTextRightDistance()); - const long nVDist(GetTextUpperDistance() + GetTextLowerDistance()); - const long nTWdt(std::max(long(0), static_cast(aTextBound.GetWidth() - 1 - nHDist))); - const long nTHgt(std::max(long(0), static_cast(aTextBound.GetHeight() - 1 - nVDist))); + const tools::Long nHDist(GetTextLeftDistance() + GetTextRightDistance()); + const tools::Long nVDist(GetTextUpperDistance() + GetTextLowerDistance()); + const tools::Long nTWdt(std::max(tools::Long(0), static_cast(aTextBound.GetWidth() - 1 - nHDist))); + const tools::Long nTHgt(std::max(tools::Long(0), static_cast(aTextBound.GetHeight() - 1 - nVDist))); aSet.Put(makeSdrTextMinFrameWidthItem(nTWdt)); aSet.Put(makeSdrTextMinFrameHeightItem(nTHgt)); @@ -1528,7 +1528,7 @@ void SdrObjCustomShape::NbcResize( const Point& rRef, const Fraction& rxFact, co InvalidateRenderGeometry(); } -void SdrObjCustomShape::NbcRotate( const Point& rRef, long nAngle, double sn, double cs ) +void SdrObjCustomShape::NbcRotate( const Point& rRef, tools::Long nAngle, double sn, double cs ) { bool bMirroredX = IsMirroredX(); bool bMirroredY = IsMirroredY(); @@ -1545,7 +1545,7 @@ void SdrObjCustomShape::NbcRotate( const Point& rRef, long nAngle, double sn, do aGeo.nRotationAngle = 0; // resetting aGeo data aGeo.RecalcSinCos(); - long nW = static_cast( fObjectRotation * 100 ); // applying our object rotation + tools::Long nW = static_cast( fObjectRotation * 100 ); // applying our object rotation if ( bMirroredX ) nW = 36000 - nW; if ( bMirroredY ) @@ -1578,8 +1578,8 @@ void SdrObjCustomShape::NbcMirror( const Point& rRef1, const Point& rRef2 ) // TTTT: Fix for old mirroring, can be removed again in aw080 // storing horizontal and vertical flipping without modifying the rotate angle // decompose other flipping to rotation and MirrorX. - long ndx = rRef2.X()-rRef1.X(); - long ndy = rRef2.Y()-rRef1.Y(); + tools::Long ndx = rRef2.X()-rRef1.X(); + tools::Long ndy = rRef2.Y()-rRef1.Y(); if(!ndx) // MirroredX { @@ -1601,7 +1601,7 @@ void SdrObjCustomShape::NbcMirror( const Point& rRef1, const Point& rRef2 ) SdrTextObj::NbcMirror( rRef1, rRef2 ); // update fObjectRotation - long nTextObjRotation = aGeo.nRotationAngle; + tools::Long nTextObjRotation = aGeo.nRotationAngle; double fAngle = nTextObjRotation; fAngle /= 100.0; @@ -1620,18 +1620,18 @@ void SdrObjCustomShape::NbcMirror( const Point& rRef1, const Point& rRef2 ) InvalidateRenderGeometry(); } -void SdrObjCustomShape::Shear( const Point& rRef, long nAngle, double tn, bool bVShear ) +void SdrObjCustomShape::Shear( const Point& rRef, tools::Long nAngle, double tn, bool bVShear ) { SdrTextObj::Shear( rRef, nAngle, tn, bVShear ); InvalidateRenderGeometry(); } -void SdrObjCustomShape::NbcShear( const Point& rRef, long nAngle, double tn, bool bVShear ) +void SdrObjCustomShape::NbcShear( const Point& rRef, tools::Long nAngle, double tn, bool bVShear ) { // TTTT: Fix for old mirroring, can be removed again in aw080 SdrTextObj::NbcShear(rRef,nAngle,tn,bVShear); // updating fObjectRotation - long nTextObjRotation = aGeo.nRotationAngle; + tools::Long nTextObjRotation = aGeo.nRotationAngle; double fAngle = nTextObjRotation; fAngle /= 100.0; if (IsMirroredX()) @@ -1719,7 +1719,7 @@ void SdrObjCustomShape::ImpCheckCustomGluePointsAreAdded() bool bMirroredX = IsMirroredX(); bool bMirroredY = IsMirroredY(); - long nShearAngle = aGeo.nShearAngle; + tools::Long nShearAngle = aGeo.nShearAngle; double fTan = aGeo.nTan; if ( aGeo.nRotationAngle || nShearAngle || bMirroredX || bMirroredY ) @@ -2229,8 +2229,8 @@ bool SdrObjCustomShape::AdjustTextFrameWidthAndHeight(tools::Rectangle& rR, bool if ( bWdtGrow || bHgtGrow ) { tools::Rectangle aR0(rR); - long nHgt=0,nMinHgt=0,nMaxHgt=0; - long nWdt=0,nMinWdt=0,nMaxWdt=0; + tools::Long nHgt=0,nMinHgt=0,nMaxHgt=0; + tools::Long nWdt=0,nMinWdt=0,nMaxWdt=0; Size aSiz(rR.GetSize()); aSiz.AdjustWidth( -1 ); aSiz.AdjustHeight( -1 ); Size aMaxSiz(100000,100000); Size aTmpSiz(getSdrModelFromSdrObject().GetMaxObjSize()); @@ -2252,8 +2252,8 @@ bool SdrObjCustomShape::AdjustTextFrameWidthAndHeight(tools::Rectangle& rR, bool if (nMinHgt<=0) nMinHgt=1; aSiz.setHeight(nMaxHgt ); } - long nHDist=GetTextLeftDistance()+GetTextRightDistance(); - long nVDist=GetTextUpperDistance()+GetTextLowerDistance(); + tools::Long nHDist=GetTextLeftDistance()+GetTextRightDistance(); + tools::Long nVDist=GetTextUpperDistance()+GetTextLowerDistance(); aSiz.AdjustWidth( -nHDist ); aSiz.AdjustHeight( -nVDist ); if ( aSiz.Width() < 2 ) @@ -2319,8 +2319,8 @@ bool SdrObjCustomShape::AdjustTextFrameWidthAndHeight(tools::Rectangle& rR, bool nHgt+=nVDist; if ( nHgt < 1 ) nHgt = 1; // nVDist may also be negative - long nWdtGrow = nWdt-(rR.Right()-rR.Left()); - long nHgtGrow = nHgt-(rR.Bottom()-rR.Top()); + tools::Long nWdtGrow = nWdt-(rR.Right()-rR.Left()); + tools::Long nHgtGrow = nHgt-(rR.Bottom()-rR.Top()); if ( nWdtGrow == 0 ) bWdtGrow = false; if ( nHgtGrow == 0 ) @@ -2336,7 +2336,7 @@ bool SdrObjCustomShape::AdjustTextFrameWidthAndHeight(tools::Rectangle& rR, bool rR.AdjustLeft( -nWdtGrow ); else { - long nWdtGrow2=nWdtGrow/2; + tools::Long nWdtGrow2=nWdtGrow/2; rR.AdjustLeft( -nWdtGrow2 ); rR.SetRight(rR.Left()+nWdt ); } @@ -2350,7 +2350,7 @@ bool SdrObjCustomShape::AdjustTextFrameWidthAndHeight(tools::Rectangle& rR, bool rR.AdjustTop( -nHgtGrow ); else { - long nHgtGrow2=nHgtGrow/2; + tools::Long nHgtGrow2=nHgtGrow/2; rR.AdjustTop( -nHgtGrow2 ); rR.SetBottom(rR.Top()+nHgt ); } @@ -2495,10 +2495,10 @@ void SdrObjCustomShape::TakeTextEditArea(Size* pPaperMin, Size* pPaperMax, tools SdrTextHorzAdjust eHAdj(GetTextHorizontalAdjust()); SdrTextVertAdjust eVAdj(GetTextVerticalAdjust()); - long nMinWdt = GetMinTextFrameWidth(); - long nMinHgt = GetMinTextFrameHeight(); - long nMaxWdt = GetMaxTextFrameWidth(); - long nMaxHgt = GetMaxTextFrameHeight(); + tools::Long nMinWdt = GetMinTextFrameWidth(); + tools::Long nMinHgt = GetMinTextFrameHeight(); + tools::Long nMaxWdt = GetMaxTextFrameWidth(); + tools::Long nMaxHgt = GetMaxTextFrameHeight(); if (nMinWdt<1) nMinWdt=1; if (nMinHgt<1) nMinHgt=1; if ( nMaxWdt == 0 || nMaxWdt > aMaxSiz.Width() ) @@ -2529,14 +2529,14 @@ void SdrObjCustomShape::TakeTextEditArea(Size* pPaperMin, Size* pPaperMax, tools { *pViewMin = aViewInit; - long nXFree = aAnkSiz.Width() - aPaperMin.Width(); + tools::Long nXFree = aAnkSiz.Width() - aPaperMin.Width(); if ( eHAdj == SDRTEXTHORZADJUST_LEFT ) pViewMin->AdjustRight( -nXFree ); else if ( eHAdj == SDRTEXTHORZADJUST_RIGHT ) pViewMin->AdjustLeft(nXFree ); else { pViewMin->AdjustLeft(nXFree / 2 ); pViewMin->SetRight( pViewMin->Left() + aPaperMin.Width() ); } - long nYFree = aAnkSiz.Height() - aPaperMin.Height(); + tools::Long nYFree = aAnkSiz.Height() - aPaperMin.Height(); if ( eVAdj == SDRTEXTVERTADJUST_TOP ) pViewMin->AdjustBottom( -nYFree ); else if ( eVAdj == SDRTEXTVERTADJUST_BOTTOM ) @@ -2605,8 +2605,8 @@ void SdrObjCustomShape::TakeTextRect( SdrOutliner& rOutliner, tools::Rectangle& sal_Int32 nMaxAutoPaperWidth = 1000000; sal_Int32 nMaxAutoPaperHeight= 1000000; - long nAnkWdt=aAnkRect.GetWidth(); - long nAnkHgt=aAnkRect.GetHeight(); + tools::Long nAnkWdt=aAnkRect.GetWidth(); + tools::Long nAnkHgt=aAnkRect.GetHeight(); if (GetMergedItem(SDRATTR_TEXT_WORDWRAP).GetValue()) { @@ -2700,7 +2700,7 @@ void SdrObjCustomShape::TakeTextRect( SdrOutliner& rOutliner, tools::Rectangle& if (eHAdj==SDRTEXTHORZADJUST_CENTER || eHAdj==SDRTEXTHORZADJUST_RIGHT) { - long nFreeWdt=aAnkRect.GetWidth()-aTextSiz.Width(); + tools::Long nFreeWdt=aAnkRect.GetWidth()-aTextSiz.Width(); if (eHAdj==SDRTEXTHORZADJUST_CENTER) aTextPos.AdjustX(nFreeWdt/2 ); if (eHAdj==SDRTEXTHORZADJUST_RIGHT) @@ -2708,7 +2708,7 @@ void SdrObjCustomShape::TakeTextRect( SdrOutliner& rOutliner, tools::Rectangle& } if (eVAdj==SDRTEXTVERTADJUST_CENTER || eVAdj==SDRTEXTVERTADJUST_BOTTOM) { - long nFreeHgt=aAnkRect.GetHeight()-aTextSiz.Height(); + tools::Long nFreeHgt=aAnkRect.GetHeight()-aTextSiz.Height(); if (eVAdj==SDRTEXTVERTADJUST_CENTER) aTextPos.AdjustY(nFreeHgt/2 ); if (eVAdj==SDRTEXTVERTADJUST_BOTTOM) diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx index 05cbd9ca3b88..90ae586775ef 100644 --- a/svx/source/svdraw/svdobj.cxx +++ b/svx/source/svdraw/svdobj.cxx @@ -894,10 +894,10 @@ void SdrObject::RecalcBoundRect() if(!aRange.isEmpty()) { aOutRect = tools::Rectangle( - static_cast(floor(aRange.getMinX())), - static_cast(floor(aRange.getMinY())), - static_cast(ceil(aRange.getMaxX())), - static_cast(ceil(aRange.getMaxY()))); + static_cast(floor(aRange.getMinX())), + static_cast(floor(aRange.getMinY())), + static_cast(ceil(aRange.getMaxX())), + static_cast(ceil(aRange.getMaxY()))); return; } } @@ -1059,7 +1059,7 @@ void SdrObject::ImpForcePlusData() pPlusData.reset( new SdrObjPlusData ); } -OUString SdrObject::GetMetrStr(long nVal) const +OUString SdrObject::GetMetrStr(tools::Long nVal) const { return getSdrModelFromSdrObject().GetMetricString(nVal); } @@ -1215,12 +1215,12 @@ tools::Rectangle SdrObject::ImpDragCalcRect(const SdrDragStat& rDrag) const if (bTop) aTmpRect.SetTop(aPos.Y() ); if (bBtm) aTmpRect.SetBottom(aPos.Y() ); if (bOrtho) { // Ortho - long nWdt0=aRect.Right() -aRect.Left(); - long nHgt0=aRect.Bottom()-aRect.Top(); - long nXMul=aTmpRect.Right() -aTmpRect.Left(); - long nYMul=aTmpRect.Bottom()-aTmpRect.Top(); - long nXDiv=nWdt0; - long nYDiv=nHgt0; + tools::Long nWdt0=aRect.Right() -aRect.Left(); + tools::Long nHgt0=aRect.Bottom()-aRect.Top(); + tools::Long nXMul=aTmpRect.Right() -aTmpRect.Left(); + tools::Long nYMul=aTmpRect.Bottom()-aTmpRect.Top(); + tools::Long nXDiv=nWdt0; + tools::Long nYDiv=nHgt0; bool bXNeg=(nXMul<0)!=(nXDiv<0); bool bYNeg=(nYMul<0)!=(nYDiv<0); nXMul=std::abs(nXMul); @@ -1236,26 +1236,26 @@ tools::Rectangle SdrObject::ImpDragCalcRect(const SdrDragStat& rDrag) const if (bEcke) { // corner point handles bool bUseX=(aXFact(pPoolItem)->GetValue(); + tools::Long n=static_cast(pPoolItem)->GetValue(); aNewSnap.Move(n,0); } if (rAttr.GetItemState(SDRATTR_MOVEY,true,&pPoolItem)==SfxItemState::SET) { - long n=static_cast(pPoolItem)->GetValue(); + tools::Long n=static_cast(pPoolItem)->GetValue(); aNewSnap.Move(0,n); } if (rAttr.GetItemState(SDRATTR_ONEPOSITIONX,true,&pPoolItem)==SfxItemState::SET) { - long n=static_cast(pPoolItem)->GetValue(); + tools::Long n=static_cast(pPoolItem)->GetValue(); aNewSnap.Move(n-aNewSnap.Left(),0); } if (rAttr.GetItemState(SDRATTR_ONEPOSITIONY,true,&pPoolItem)==SfxItemState::SET) { - long n=static_cast(pPoolItem)->GetValue(); + tools::Long n=static_cast(pPoolItem)->GetValue(); aNewSnap.Move(0,n-aNewSnap.Top()); } if (rAttr.GetItemState(SDRATTR_ONESIZEWIDTH,true,&pPoolItem)==SfxItemState::SET) { - long n=static_cast(pPoolItem)->GetValue(); + tools::Long n=static_cast(pPoolItem)->GetValue(); aNewSnap.SetRight(aNewSnap.Left()+n ); } if (rAttr.GetItemState(SDRATTR_ONESIZEHEIGHT,true,&pPoolItem)==SfxItemState::SET) { - long n=static_cast(pPoolItem)->GetValue(); + tools::Long n=static_cast(pPoolItem)->GetValue(); aNewSnap.SetBottom(aNewSnap.Top()+n ); } if (aNewSnap!=rSnap) { @@ -1988,7 +1988,7 @@ void SdrObject::NbcApplyNotPersistAttr(const SfxItemSet& rAttr) } if (rAttr.GetItemState(SDRATTR_SHEARANGLE,true,&pPoolItem)==SfxItemState::SET) { - long n=static_cast(pPoolItem)->GetValue(); + tools::Long n=static_cast(pPoolItem)->GetValue(); n-=GetShearAngle(); if (n!=0) { double nTan = tan(n * F_PI18000); @@ -1996,7 +1996,7 @@ void SdrObject::NbcApplyNotPersistAttr(const SfxItemSet& rAttr) } } if (rAttr.GetItemState(SDRATTR_ROTATEANGLE,true,&pPoolItem)==SfxItemState::SET) { - long n=static_cast(pPoolItem)->GetValue(); + tools::Long n=static_cast(pPoolItem)->GetValue(); n-=GetRotateAngle(); if (n!=0) { double nSin = sin(n * F_PI18000); @@ -2005,18 +2005,18 @@ void SdrObject::NbcApplyNotPersistAttr(const SfxItemSet& rAttr) } } if (rAttr.GetItemState(SDRATTR_ROTATEONE,true,&pPoolItem)==SfxItemState::SET) { - long n=static_cast(pPoolItem)->GetValue(); + tools::Long n=static_cast(pPoolItem)->GetValue(); double nSin = sin(n * F_PI18000); double nCos = cos(n * F_PI18000); NbcRotate(aRef1,n,nSin,nCos); } if (rAttr.GetItemState(SDRATTR_HORZSHEARONE,true,&pPoolItem)==SfxItemState::SET) { - long n=static_cast(pPoolItem)->GetValue(); + tools::Long n=static_cast(pPoolItem)->GetValue(); double nTan = tan(n * F_PI18000); NbcShear(aRef1,n,nTan,false); } if (rAttr.GetItemState(SDRATTR_VERTSHEARONE,true,&pPoolItem)==SfxItemState::SET) { - long n=static_cast(pPoolItem)->GetValue(); + tools::Long n=static_cast(pPoolItem)->GetValue(); double nTan = tan(n * F_PI18000); NbcShear(aRef1,n,nTan,true); } @@ -2071,11 +2071,11 @@ void SdrObject::NbcApplyNotPersistAttr(const SfxItemSet& rAttr) } tools::Rectangle aNewLogic(rLogic); if (rAttr.GetItemState(SDRATTR_LOGICSIZEWIDTH,true,&pPoolItem)==SfxItemState::SET) { - long n=static_cast(pPoolItem)->GetValue(); + tools::Long n=static_cast(pPoolItem)->GetValue(); aNewLogic.SetRight(aNewLogic.Left()+n ); } if (rAttr.GetItemState(SDRATTR_LOGICSIZEHEIGHT,true,&pPoolItem)==SfxItemState::SET) { - long n=static_cast(pPoolItem)->GetValue(); + tools::Long n=static_cast(pPoolItem)->GetValue(); aNewLogic.SetBottom(aNewLogic.Top()+n ); } if (aNewLogic!=rLogic) { @@ -2227,7 +2227,7 @@ void SdrObject::SetGlueReallyAbsolute(bool bOn) } } -void SdrObject::NbcRotateGluePoints(const Point& rRef, long nAngle, double sn, double cs) +void SdrObject::NbcRotateGluePoints(const Point& rRef, tools::Long nAngle, double sn, double cs) { // First a const call to see whether there are any glue points. // Force const call! diff --git a/svx/source/svdraw/svdocapt.cxx b/svx/source/svdraw/svdocapt.cxx index b6c3168f6cbb..29819052cdb4 100644 --- a/svx/source/svdraw/svdocapt.cxx +++ b/svx/source/svdraw/svdocapt.cxx @@ -63,10 +63,10 @@ class ImpCaptParams { public: SdrCaptionType eType; - long nGap; - long nEscRel; - long nEscAbs; - long nLineLen; + tools::Long nGap; + tools::Long nEscRel; + tools::Long nEscAbs; + tools::Long nLineLen; SdrCaptionEscDir eEscDir; bool bFitLineLen; bool bEscRel; @@ -86,7 +86,7 @@ public: void ImpCaptParams::CalcEscPos(const Point& rTailPt, const tools::Rectangle& rRect, Point& rPt, EscDir& rDir) const { Point aTl(rTailPt); // copy locally for performance reasons - long nX,nY; + tools::Long nX,nY; if (bEscRel) { nX=rRect.Right()-rRect.Left(); nX=BigMulDiv(nX,nEscRel,10000); diff --git a/svx/source/svdraw/svdocirc.cxx b/svx/source/svdraw/svdocirc.cxx index 3b46192aec35..ec8b177550f0 100644 --- a/svx/source/svdraw/svdocirc.cxx +++ b/svx/source/svdraw/svdocirc.cxx @@ -50,12 +50,12 @@ using namespace com::sun::star; -static Point GetAnglePnt(const tools::Rectangle& rR, long nAngle) +static Point GetAnglePnt(const tools::Rectangle& rR, tools::Long nAngle) { Point aCenter(rR.Center()); - long nWdt=rR.Right()-rR.Left(); - long nHgt=rR.Bottom()-rR.Top(); - long nMaxRad=(std::max(nWdt,nHgt)+1) /2; + tools::Long nWdt=rR.Right()-rR.Left(); + tools::Long nHgt=rR.Bottom()-rR.Top(); + tools::Long nMaxRad=(std::max(nWdt,nHgt)+1) /2; double a; a = nAngle * F_PI18000; Point aRetval(FRound(cos(a)*nMaxRad),-FRound(sin(a)*nMaxRad)); @@ -142,11 +142,11 @@ SdrCircObj::SdrCircObj( SdrModel& rSdrModel, SdrCircKind eNewKind, const tools::Rectangle& rRect, - long nNewStartWink, - long nNewEndWink) + tools::Long nNewStartWink, + tools::Long nNewEndWink) : SdrRectObj(rSdrModel, rRect) { - long nAngleDif=nNewEndWink-nNewStartWink; + tools::Long nAngleDif=nNewEndWink-nNewStartWink; nStartAngle=NormAngle36000(nNewStartWink); nEndAngle=NormAngle36000(nNewEndWink); if (nAngleDif==36000) nEndAngle+=nAngleDif; // full circle @@ -230,7 +230,7 @@ bool SdrCircObj::PaintNeedsXPolyCirc() const return bNeed; } -basegfx::B2DPolygon SdrCircObj::ImpCalcXPolyCirc(const SdrCircKind eCircleKind, const tools::Rectangle& rRect1, long nStart, long nEnd) const +basegfx::B2DPolygon SdrCircObj::ImpCalcXPolyCirc(const SdrCircKind eCircleKind, const tools::Rectangle& rRect1, tools::Long nStart, tools::Long nEnd) const { const basegfx::B2DRange aRange = vcl::unotools::b2DRectangleFromRectangle(rRect1); basegfx::B2DPolygon aCircPolygon; @@ -398,10 +398,10 @@ struct ImpCircUser : public SdrDragStatUserData tools::Rectangle aR; Point aCenter; Point aP1; - long nHgt; - long nWdt; - long nStart; - long nEnd; + tools::Long nHgt; + tools::Long nWdt; + tools::Long nStart; + tools::Long nEnd; public: ImpCircUser() @@ -538,8 +538,8 @@ bool SdrCircObj::applySpecialDrag(SdrDragStat& rDrag) aPt -= maRect.Center(); - long nWdt = maRect.Right() - maRect.Left(); - long nHgt = maRect.Bottom() - maRect.Top(); + tools::Long nWdt = maRect.Right() - maRect.Left(); + tools::Long nHgt = maRect.Bottom() - maRect.Top(); if(nWdt>=nHgt) { @@ -550,11 +550,11 @@ bool SdrCircObj::applySpecialDrag(SdrDragStat& rDrag) aPt.setX(BigMulDiv(aPt.X(),nHgt,nWdt) ); } - long nAngle=NormAngle36000(GetAngle(aPt)); + tools::Long nAngle=NormAngle36000(GetAngle(aPt)); if (rDrag.GetView() && rDrag.GetView()->IsAngleSnapEnabled()) { - long nSA=rDrag.GetView()->GetSnapAngle(); + tools::Long nSA=rDrag.GetView()->GetSnapAngle(); if (nSA!=0) { @@ -661,7 +661,7 @@ void ImpCircUser::SetCreateParams(SdrDragStat const & rStat) } nStart=NormAngle36000(GetAngle(aP)); if (rStat.GetView()!=nullptr && rStat.GetView()->IsAngleSnapEnabled()) { - long nSA=rStat.GetView()->GetSnapAngle(); + tools::Long nSA=rStat.GetView()->GetSnapAngle(); if (nSA!=0) { // angle snapping nStart+=nSA/2; nStart/=nSA; @@ -683,7 +683,7 @@ void ImpCircUser::SetCreateParams(SdrDragStat const & rStat) } nEnd=NormAngle36000(GetAngle(aP)); if (rStat.GetView()!=nullptr && rStat.GetView()->IsAngleSnapEnabled()) { - long nSA=rStat.GetView()->GetSnapAngle(); + tools::Long nSA=rStat.GetView()->GetSnapAngle(); if (nSA!=0) { // angle snapping nEnd+=nSA/2; nEnd/=nSA; @@ -831,7 +831,7 @@ void SdrCircObj::NbcMove(const Size& aSiz) void SdrCircObj::NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) { - long nAngle0=aGeo.nRotationAngle; + tools::Long nAngle0=aGeo.nRotationAngle; bool bNoShearRota=(aGeo.nRotationAngle==0 && aGeo.nShearAngle==0); SdrTextObj::NbcResize(rRef,xFact,yFact); bNoShearRota|=(aGeo.nRotationAngle==0 && aGeo.nShearAngle==0); @@ -843,12 +843,12 @@ void SdrCircObj::NbcResize(const Point& rRef, const Fraction& xFact, const Fract // That, however, is pretty bad (because of forced "hard" formatting). // Alternatively, we could implement a bMirrored flag (maybe even // a more general one, e. g. for mirrored text, ...). - long nS0=nStartAngle; - long nE0=nEndAngle; + tools::Long nS0=nStartAngle; + tools::Long nE0=nEndAngle; if (bNoShearRota) { // the RectObj already mirrors at VMirror because of a 180deg rotation if (! (bXMirr && bYMirr)) { - long nTmp=nS0; + tools::Long nTmp=nS0; nS0=18000-nE0; nE0=18000-nTmp; } @@ -857,12 +857,12 @@ void SdrCircObj::NbcResize(const Point& rRef, const Fraction& xFact, const Fract nS0+=nAngle0; nE0+=nAngle0; if (bXMirr) { - long nTmp=nS0; + tools::Long nTmp=nS0; nS0=18000-nE0; nE0=18000-nTmp; } if (bYMirr) { - long nTmp=nS0; + tools::Long nTmp=nS0; nS0=-nE0; nE0=-nTmp; } @@ -870,7 +870,7 @@ void SdrCircObj::NbcResize(const Point& rRef, const Fraction& xFact, const Fract nE0-=aGeo.nRotationAngle; } } - long nAngleDif=nE0-nS0; + tools::Long nAngleDif=nE0-nS0; nStartAngle=NormAngle36000(nS0); nEndAngle =NormAngle36000(nE0); if (nAngleDif==36000) nEndAngle+=nAngleDif; // full circle @@ -880,7 +880,7 @@ void SdrCircObj::NbcResize(const Point& rRef, const Fraction& xFact, const Fract ImpSetCircInfoToAttr(); } -void SdrCircObj::NbcShear(const Point& rRef, long nAngle, double tn, bool bVShear) +void SdrCircObj::NbcShear(const Point& rRef, tools::Long nAngle, double tn, bool bVShear) { SdrTextObj::NbcShear(rRef,nAngle,tn,bVShear); SetXPolyDirty(); @@ -894,9 +894,9 @@ void SdrCircObj::NbcMirror(const Point& rRef1, const Point& rRef2) Point aTmpPt2; if (bFreeMirr) { // some preparations for using an arbitrary axis of reflection Point aCenter(maRect.Center()); - long nWdt=maRect.GetWidth()-1; - long nHgt=maRect.GetHeight()-1; - long nMaxRad=(std::max(nWdt,nHgt)+1) /2; + tools::Long nWdt=maRect.GetWidth()-1; + tools::Long nHgt=maRect.GetHeight()-1; + tools::Long nMaxRad=(std::max(nWdt,nHgt)+1) /2; double a; // starting point a = nStartAngle * F_PI18000; @@ -939,7 +939,7 @@ void SdrCircObj::NbcMirror(const Point& rRef1, const Point& rRef2) // because it's mirrored, the angles are swapped, too nStartAngle=GetAngle(aTmpPt2); nEndAngle =GetAngle(aTmpPt1); - long nAngleDif=nEndAngle-nStartAngle; + tools::Long nAngleDif=nEndAngle-nStartAngle; nStartAngle=NormAngle36000(nStartAngle); nEndAngle =NormAngle36000(nEndAngle); if (nAngleDif==36000) nEndAngle+=nAngleDif; // full circle @@ -985,8 +985,8 @@ void SdrCircObj::TakeUnrotatedSnapRect(tools::Rectangle& rRect) const if (meCircleKind!=SdrCircKind::Full) { const Point aPntStart(GetAnglePnt(maRect,nStartAngle)); const Point aPntEnd(GetAnglePnt(maRect,nEndAngle)); - long a=nStartAngle; - long e=nEndAngle; + tools::Long a=nStartAngle; + tools::Long e=nEndAngle; rRect.SetLeft(maRect.Right() ); rRect.SetRight(maRect.Left() ); rRect.SetTop(maRect.Bottom() ); @@ -1020,7 +1020,7 @@ void SdrCircObj::TakeUnrotatedSnapRect(tools::Rectangle& rRect) const if (aGeo.nShearAngle==0) return; - long nDst=FRound((rRect.Bottom()-rRect.Top())*aGeo.nTan); + tools::Long nDst=FRound((rRect.Bottom()-rRect.Top())*aGeo.nTan); if (aGeo.nShearAngle>0) { Point aRef(rRect.TopLeft()); rRect.AdjustLeft( -nDst ); @@ -1046,10 +1046,10 @@ void SdrCircObj::NbcSetSnapRect(const tools::Rectangle& rRect) { if (aGeo.nRotationAngle!=0 || aGeo.nShearAngle!=0 || meCircleKind!=SdrCircKind::Full) { tools::Rectangle aSR0(GetSnapRect()); - long nWdt0=aSR0.Right()-aSR0.Left(); - long nHgt0=aSR0.Bottom()-aSR0.Top(); - long nWdt1=rRect.Right()-rRect.Left(); - long nHgt1=rRect.Bottom()-rRect.Top(); + tools::Long nWdt0=aSR0.Right()-aSR0.Left(); + tools::Long nHgt0=aSR0.Bottom()-aSR0.Top(); + tools::Long nWdt1=rRect.Right()-rRect.Left(); + tools::Long nHgt1=rRect.Bottom()-rRect.Top(); NbcResize(maSnapRect.TopLeft(),Fraction(nWdt1,nWdt0),Fraction(nHgt1,nHgt0)); NbcMove(Size(rRect.Left()-aSR0.Left(),rRect.Top()-aSR0.Top())); } else { diff --git a/svx/source/svdraw/svdoedge.cxx b/svx/source/svdraw/svdoedge.cxx index 757760a6fd88..0e16e33b41c2 100644 --- a/svx/source/svdraw/svdoedge.cxx +++ b/svx/source/svdraw/svdoedge.cxx @@ -119,14 +119,14 @@ bool SdrEdgeInfoRec::ImpIsHorzLine(SdrEdgeLineCode eLineCode, const XPolygon& rX return bHorz; } -void SdrEdgeInfoRec::ImpSetLineOffset(SdrEdgeLineCode eLineCode, const XPolygon& rXP, long nVal) +void SdrEdgeInfoRec::ImpSetLineOffset(SdrEdgeLineCode eLineCode, const XPolygon& rXP, tools::Long nVal) { Point& rPt=ImpGetLineOffsetPoint(eLineCode); if (ImpIsHorzLine(eLineCode,rXP)) rPt.setY(nVal ); else rPt.setX(nVal ); } -long SdrEdgeInfoRec::ImpGetLineOffset(SdrEdgeLineCode eLineCode, const XPolygon& rXP) const +tools::Long SdrEdgeInfoRec::ImpGetLineOffset(SdrEdgeLineCode eLineCode, const XPolygon& rXP) const { const Point& rPt = const_cast(this)->ImpGetLineOffsetPoint(eLineCode); if (ImpIsHorzLine(eLineCode,rXP)) @@ -599,14 +599,14 @@ SdrEscapeDirection SdrEdgeObj::ImpCalcEscAngle(SdrObject const * pObj, const Poi { if (pObj==nullptr) return SdrEscapeDirection::ALL; tools::Rectangle aR(pObj->GetSnapRect()); - long dxl=rPt.X()-aR.Left(); - long dyo=rPt.Y()-aR.Top(); - long dxr=aR.Right()-rPt.X(); - long dyu=aR.Bottom()-rPt.Y(); + tools::Long dxl=rPt.X()-aR.Left(); + tools::Long dyo=rPt.Y()-aR.Top(); + tools::Long dxr=aR.Right()-rPt.X(); + tools::Long dyu=aR.Bottom()-rPt.Y(); bool bxMitt=std::abs(dxl-dxr)<2; bool byMitt=std::abs(dyo-dyu)<2; - long dx=std::min(dxl,dxr); - long dy=std::min(dyo,dyu); + tools::Long dx=std::min(dxl,dxr); + tools::Long dy=std::min(dyo,dyu); bool bDiag=std::abs(dx-dy)<2; if (bxMitt && byMitt) return SdrEscapeDirection::ALL; // in the center if (bDiag) { // diagonally @@ -633,7 +633,7 @@ SdrEscapeDirection SdrEdgeObj::ImpCalcEscAngle(SdrObject const * pObj, const Poi } } -XPolygon SdrEdgeObj::ImpCalcObjToCenter(const Point& rStPt, long nEscAngle, const tools::Rectangle& rRect, const Point& rMeeting) +XPolygon SdrEdgeObj::ImpCalcObjToCenter(const Point& rStPt, tools::Long nEscAngle, const tools::Rectangle& rRect, const Point& rMeeting) { XPolygon aXP; aXP.Insert(XPOLY_APPEND,rStPt,PolyFlags::Normal); @@ -804,10 +804,10 @@ XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const XPolygon& rTrack0, SdrObjConnection& nEsc2=aGP2.GetEscDir(); if (nEsc2==SdrEscapeDirection::SMART) nEsc2=ImpCalcEscAngle(rCon2.pObj,aPt2-rCon2.aObjOfs); } - for (long nA1=0; nA1<36000; nA1+=9000) + for (tools::Long nA1=0; nA1<36000; nA1+=9000) { SdrEscapeDirection nE1 = nA1==0 ? SdrEscapeDirection::RIGHT : nA1==9000 ? SdrEscapeDirection::TOP : nA1==18000 ? SdrEscapeDirection::LEFT : nA1==27000 ? SdrEscapeDirection::BOTTOM : SdrEscapeDirection::SMART; - for (long nA2=0; nA2<36000; nA2+=9000) + for (tools::Long nA2=0; nA2<36000; nA2+=9000) { SdrEscapeDirection nE2 = nA2==0 ? SdrEscapeDirection::RIGHT : nA2==9000 ? SdrEscapeDirection::TOP : nA2==18000 ? SdrEscapeDirection::LEFT : nA2==27000 ? SdrEscapeDirection::BOTTOM : SdrEscapeDirection::SMART; if ((nEsc1&nE1) && (nEsc2&nE2)) @@ -835,8 +835,8 @@ XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const XPolygon& rTrack0, SdrObjConnection& return aBestXP; } -XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const Point& rPt1, long nAngle1, const tools::Rectangle& rBoundRect1, const tools::Rectangle& rBewareRect1, - const Point& rPt2, long nAngle2, const tools::Rectangle& rBoundRect2, const tools::Rectangle& rBewareRect2, +XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const Point& rPt1, tools::Long nAngle1, const tools::Rectangle& rBoundRect1, const tools::Rectangle& rBewareRect1, + const Point& rPt2, tools::Long nAngle2, const tools::Rectangle& rBoundRect2, const tools::Rectangle& rBewareRect2, sal_uIntPtr* pnQuality, SdrEdgeInfoRec* pInfo) const { SdrEdgeKind eKind=GetObjectItem(SDRATTR_EDGEKIND).GetValue(); @@ -890,7 +890,7 @@ XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const Point& rPt1, long nAngle1, const too if (bLks2) aXP[2].setX(aBewareRect2.Left() ); //-=500; if (bUnt2) aXP[2].setY(aBewareRect2.Bottom() ); //+=500; if (pnQuality!=nullptr) { - long nQ=std::abs(aXP[1].X()-aXP[0].X())+std::abs(aXP[1].Y()-aXP[0].Y()); + tools::Long nQ=std::abs(aXP[1].X()-aXP[0].X())+std::abs(aXP[1].Y()-aXP[0].Y()); nQ+=std::abs(aXP[2].X()-aXP[1].X())+std::abs(aXP[2].Y()-aXP[1].Y()); nQ+=std::abs(aXP[3].X()-aXP[2].X())+std::abs(aXP[3].Y()-aXP[2].Y()); *pnQuality=nQ; @@ -917,8 +917,8 @@ XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const Point& rPt1, long nAngle1, const too Point aC2(aBewareRect2.Center()); if (aBewareRect1.Left()<=aBewareRect2.Right() && aBewareRect1.Right()>=aBewareRect2.Left()) { // overlapping on the x axis - long n1=std::max(aBewareRect1.Left(),aBewareRect2.Left()); - long n2=std::min(aBewareRect1.Right(),aBewareRect2.Right()); + tools::Long n1=std::max(aBewareRect1.Left(),aBewareRect2.Left()); + tools::Long n2=std::min(aBewareRect1.Right(),aBewareRect2.Right()); aMeeting.setX((n1+n2+1)/2 ); } else { // otherwise the center point of the empty space @@ -930,8 +930,8 @@ XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const Point& rPt1, long nAngle1, const too } if (aBewareRect1.Top()<=aBewareRect2.Bottom() && aBewareRect1.Bottom()>=aBewareRect2.Top()) { // overlapping on the x axis - long n1=std::max(aBewareRect1.Top(),aBewareRect2.Top()); - long n2=std::min(aBewareRect1.Bottom(),aBewareRect2.Bottom()); + tools::Long n1=std::max(aBewareRect1.Top(),aBewareRect2.Top()); + tools::Long n2=std::min(aBewareRect1.Bottom(),aBewareRect2.Bottom()); aMeeting.setY((n1+n2+1)/2 ); } else { // otherwise the center point of the empty space @@ -945,10 +945,10 @@ XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const Point& rPt1, long nAngle1, const too // 1. both go into the same direction // 2. both go into opposite directions // 3. one is vertical, the other is horizontal - long nXMin=std::min(aBewareRect1.Left(),aBewareRect2.Left()); - long nXMax=std::max(aBewareRect1.Right(),aBewareRect2.Right()); - long nYMin=std::min(aBewareRect1.Top(),aBewareRect2.Top()); - long nYMax=std::max(aBewareRect1.Bottom(),aBewareRect2.Bottom()); + tools::Long nXMin=std::min(aBewareRect1.Left(),aBewareRect2.Left()); + tools::Long nXMax=std::max(aBewareRect1.Right(),aBewareRect2.Right()); + tools::Long nYMin=std::min(aBewareRect1.Top(),aBewareRect2.Top()); + tools::Long nYMax=std::max(aBewareRect1.Bottom(),aBewareRect2.Bottom()); bool bBewareOverlap=aBewareRect1.Right()>aBewareRect2.Left() && aBewareRect1.Left()aBewareRect2.Top() && aBewareRect1.Top()=2) { // check exit angle again Point aP1(aXP1[1]); aP1-=aXP1[0]; Point aP2(aXP1[nPointCount-2]); aP2-=aXP1[nPointCount-1]; - long nAng1=0; if (aP1.X()<0) nAng1=18000; if (aP1.Y()>0) nAng1=27000; + tools::Long nAng1=0; if (aP1.X()<0) nAng1=18000; if (aP1.Y()>0) nAng1=27000; if (aP1.Y()<0) nAng1=9000; if (aP1.X()!=0 && aP1.Y()!=0) nAng1=1; // slant?! - long nAng2=0; if (aP2.X()<0) nAng2=18000; if (aP2.Y()>0) nAng2=27000; + tools::Long nAng2=0; if (aP2.X()<0) nAng2=18000; if (aP2.Y()>0) nAng2=27000; if (aP2.Y()<0) nAng2=9000; if (aP2.X()!=0 && aP2.Y()!=0) nAng2=1; // slant?! if (nAng1!=nAngle1) nIntersections++; @@ -1474,10 +1474,10 @@ XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const Point& rPt1, long nAngle1, const too Point* pPt2=&aXP1[1]; Point* pPt3=&aXP1[nPointCount-2]; Point* pPt4=&aXP1[nPointCount-1]; - long dx1=pPt2->X()-pPt1->X(); - long dy1=pPt2->Y()-pPt1->Y(); - long dx2=pPt3->X()-pPt4->X(); - long dy2=pPt3->Y()-pPt4->Y(); + tools::Long dx1=pPt2->X()-pPt1->X(); + tools::Long dy1=pPt2->Y()-pPt1->Y(); + tools::Long dx2=pPt3->X()-pPt4->X(); + tools::Long dy2=pPt3->Y()-pPt4->Y(); if (cForm=='L') { // nPointCount==3 aXP1.SetFlags(1,PolyFlags::Control); Point aPt3(*pPt2); @@ -1502,10 +1502,10 @@ XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const Point& rPt1, long nAngle1, const too if (nPointCount==5) { // add a control point before and after center Point aCenter(aXP1[2]); - long dx1b=aCenter.X()-aXP1[1].X(); - long dy1b=aCenter.Y()-aXP1[1].Y(); - long dx2b=aCenter.X()-aXP1[3].X(); - long dy2b=aCenter.Y()-aXP1[3].Y(); + tools::Long dx1b=aCenter.X()-aXP1[1].X(); + tools::Long dy1b=aCenter.Y()-aXP1[1].Y(); + tools::Long dx2b=aCenter.X()-aXP1[3].X(); + tools::Long dy2b=aCenter.Y()-aXP1[3].Y(); aXP1.Insert(2,aCenter,PolyFlags::Control); aXP1.SetFlags(3,PolyFlags::Symmetric); aXP1.Insert(4,aCenter,PolyFlags::Control); @@ -1521,8 +1521,8 @@ XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const Point& rPt1, long nAngle1, const too Point aPt2b(aXP1[3]); aXP1.Insert(2,aPt1b,PolyFlags::Control); aXP1.Insert(5,aPt2b,PolyFlags::Control); - long dx=aPt1b.X()-aPt2b.X(); - long dy=aPt1b.Y()-aPt2b.Y(); + tools::Long dx=aPt1b.X()-aPt2b.X(); + tools::Long dy=aPt1b.Y()-aPt2b.Y(); aXP1[3].AdjustX( -(dx/2) ); aXP1[3].AdjustY( -(dy/2) ); aXP1.SetFlags(3,PolyFlags::Symmetric); @@ -2256,10 +2256,10 @@ void SdrEdgeObj::NbcSetSnapRect(const tools::Rectangle& rRect) } else { - long nMulX = rRect.Right() - rRect.Left(); - long nDivX = aOld.Right() - aOld.Left(); - long nMulY = rRect.Bottom() - rRect.Top(); - long nDivY = aOld.Bottom() - aOld.Top(); + tools::Long nMulX = rRect.Right() - rRect.Left(); + tools::Long nDivX = aOld.Right() - aOld.Left(); + tools::Long nMulY = rRect.Bottom() - rRect.Top(); + tools::Long nDivY = aOld.Bottom() - aOld.Top(); if ( nDivX == 0 ) { nMulX = 1; nDivX = 1; } if ( nDivY == 0 ) { nMulY = 1; nDivY = 1; } Fraction aX(nMulX, nDivX); @@ -2292,7 +2292,7 @@ void SdrEdgeObj::NbcResize(const Point& rRefPnt, const Fraction& aXFact, const F } // #i54102# added rotation support -void SdrEdgeObj::NbcRotate(const Point& rRef, long nAngle, double sn, double cs) +void SdrEdgeObj::NbcRotate(const Point& rRef, tools::Long nAngle, double sn, double cs) { if(bEdgeTrackUserDefined) { @@ -2354,7 +2354,7 @@ void SdrEdgeObj::NbcMirror(const Point& rRef1, const Point& rRef2) } // #i54102# added shear support -void SdrEdgeObj::NbcShear(const Point& rRef, long nAngle, double tn, bool bVShear) +void SdrEdgeObj::NbcShear(const Point& rRef, tools::Long nAngle, double tn, bool bVShear) { if(bEdgeTrackUserDefined) { diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx index 9d719839334d..3bea3d14b642 100644 --- a/svx/source/svdraw/svdograf.cxx +++ b/svx/source/svdraw/svdograf.cxx @@ -431,12 +431,12 @@ Size SdrGrafObj::getOriginalSize() const if (aGrafInfo.IsCropped()) { - const long aCroppedTop(OutputDevice::LogicToLogic(aGrafInfo.GetTopCrop(), getSdrModelFromSdrObject().GetScaleUnit(), GetGrafPrefMapMode().GetMapUnit())); - const long aCroppedBottom(OutputDevice::LogicToLogic(aGrafInfo.GetBottomCrop(), getSdrModelFromSdrObject().GetScaleUnit(), GetGrafPrefMapMode().GetMapUnit())); - const long aCroppedLeft(OutputDevice::LogicToLogic(aGrafInfo.GetLeftCrop(), getSdrModelFromSdrObject().GetScaleUnit(), GetGrafPrefMapMode().GetMapUnit())); - const long aCroppedRight(OutputDevice::LogicToLogic(aGrafInfo.GetRightCrop(), getSdrModelFromSdrObject().GetScaleUnit(), GetGrafPrefMapMode().GetMapUnit())); - const long aCroppedWidth(aSize.getWidth() - aCroppedLeft + aCroppedRight); - const long aCroppedHeight(aSize.getHeight() - aCroppedTop + aCroppedBottom); + const tools::Long aCroppedTop(OutputDevice::LogicToLogic(aGrafInfo.GetTopCrop(), getSdrModelFromSdrObject().GetScaleUnit(), GetGrafPrefMapMode().GetMapUnit())); + const tools::Long aCroppedBottom(OutputDevice::LogicToLogic(aGrafInfo.GetBottomCrop(), getSdrModelFromSdrObject().GetScaleUnit(), GetGrafPrefMapMode().GetMapUnit())); + const tools::Long aCroppedLeft(OutputDevice::LogicToLogic(aGrafInfo.GetLeftCrop(), getSdrModelFromSdrObject().GetScaleUnit(), GetGrafPrefMapMode().GetMapUnit())); + const tools::Long aCroppedRight(OutputDevice::LogicToLogic(aGrafInfo.GetRightCrop(), getSdrModelFromSdrObject().GetScaleUnit(), GetGrafPrefMapMode().GetMapUnit())); + const tools::Long aCroppedWidth(aSize.getWidth() - aCroppedLeft + aCroppedRight); + const tools::Long aCroppedHeight(aSize.getHeight() - aCroppedTop + aCroppedBottom); aSize = Size ( aCroppedWidth, aCroppedHeight); } @@ -1078,13 +1078,13 @@ void SdrGrafObj::AdjustToMaxRect( const tools::Rectangle& rMaxRect, bool bShrink // Scale graphic to page size if ( fGrfWH < fWinWH ) { - aSize.setWidth( static_cast(aMaxSize.Height() * fGrfWH) ); + aSize.setWidth( static_cast(aMaxSize.Height() * fGrfWH) ); aSize.setHeight( aMaxSize.Height() ); } else if ( fGrfWH > 0.F ) { aSize.setWidth( aMaxSize.Width() ); - aSize.setHeight( static_cast(aMaxSize.Width() / fGrfWH) ); + aSize.setHeight( static_cast(aMaxSize.Width() / fGrfWH) ); } aPos = rMaxRect.Center(); diff --git a/svx/source/svdraw/svdogrp.cxx b/svx/source/svdraw/svdogrp.cxx index 75b548231df3..7c32abb35cc0 100644 --- a/svx/source/svdraw/svdogrp.cxx +++ b/svx/source/svdraw/svdogrp.cxx @@ -301,9 +301,9 @@ bool SdrObjGroup::BegCreate(SdrDragStat& /*rStat*/) } -long SdrObjGroup::GetRotateAngle() const +tools::Long SdrObjGroup::GetRotateAngle() const { - long nRetval(0); + tools::Long nRetval(0); if(0 != GetObjCount()) { @@ -316,9 +316,9 @@ long SdrObjGroup::GetRotateAngle() const } -long SdrObjGroup::GetShearAngle(bool /*bVertical*/) const +tools::Long SdrObjGroup::GetShearAngle(bool /*bVertical*/) const { - long nRetval(0); + tools::Long nRetval(0); if(0 != GetObjCount()) { @@ -334,10 +334,10 @@ long SdrObjGroup::GetShearAngle(bool /*bVertical*/) const void SdrObjGroup::NbcSetSnapRect(const tools::Rectangle& rRect) { tools::Rectangle aOld(GetSnapRect()); - long nMulX=rRect.Right()-rRect.Left(); - long nDivX=aOld.Right()-aOld.Left(); - long nMulY=rRect.Bottom()-rRect.Top(); - long nDivY=aOld.Bottom()-aOld.Top(); + tools::Long nMulX=rRect.Right()-rRect.Left(); + tools::Long nDivX=aOld.Right()-aOld.Left(); + tools::Long nMulY=rRect.Bottom()-rRect.Top(); + tools::Long nDivY=aOld.Bottom()-aOld.Top(); if (nDivX==0) { nMulX=1; nDivX=1; } if (nDivY==0) { nMulY=1; nDivY=1; } if (nMulX!=nDivX || nMulY!=nDivY) { @@ -415,7 +415,7 @@ void SdrObjGroup::NbcResize(const Point& rRef, const Fraction& xFact, const Frac } -void SdrObjGroup::NbcRotate(const Point& rRef, long nAngle, double sn, double cs) +void SdrObjGroup::NbcRotate(const Point& rRef, tools::Long nAngle, double sn, double cs) { SetGlueReallyAbsolute(true); RotatePoint(aRefPoint,rRef,sn,cs); @@ -449,7 +449,7 @@ void SdrObjGroup::NbcMirror(const Point& rRef1, const Point& rRef2) } -void SdrObjGroup::NbcShear(const Point& rRef, long nAngle, double tn, bool bVShear) +void SdrObjGroup::NbcShear(const Point& rRef, tools::Long nAngle, double tn, bool bVShear) { SetGlueReallyAbsolute(true); ShearPoint(aRefPoint,rRef,tn); @@ -493,10 +493,10 @@ void SdrObjGroup::SetSnapRect(const tools::Rectangle& rRect) } else { - long nMulX=rRect.Right()-rRect.Left(); - long nDivX=aOld.Right()-aOld.Left(); - long nMulY=rRect.Bottom()-rRect.Top(); - long nDivY=aOld.Bottom()-aOld.Top(); + tools::Long nMulX=rRect.Right()-rRect.Left(); + tools::Long nDivX=aOld.Right()-aOld.Left(); + tools::Long nMulY=rRect.Bottom()-rRect.Top(); + tools::Long nDivY=aOld.Bottom()-aOld.Top(); if (nDivX==0) { nMulX=1; nDivX=1; } if (nDivY==0) { nMulY=1; nDivY=1; } if (nMulX!=nDivX || nMulY!=nDivY) { @@ -612,7 +612,7 @@ void SdrObjGroup::Resize(const Point& rRef, const Fraction& xFact, const Fractio } -void SdrObjGroup::Rotate(const Point& rRef, long nAngle, double sn, double cs) +void SdrObjGroup::Rotate(const Point& rRef, tools::Long nAngle, double sn, double cs) { if (nAngle==0) return; @@ -675,7 +675,7 @@ void SdrObjGroup::Mirror(const Point& rRef1, const Point& rRef2) } -void SdrObjGroup::Shear(const Point& rRef, long nAngle, double tn, bool bVShear) +void SdrObjGroup::Shear(const Point& rRef, tools::Long nAngle, double tn, bool bVShear) { if (nAngle==0) return; diff --git a/svx/source/svdraw/svdomeas.cxx b/svx/source/svdraw/svdomeas.cxx index 04547ef87c16..30f9e32ee482 100644 --- a/svx/source/svdraw/svdomeas.cxx +++ b/svx/source/svdraw/svdomeas.cxx @@ -254,16 +254,16 @@ struct ImpMeasureRec : public SdrDragStatUserData Point aPt2; css::drawing::MeasureTextHorzPos eWantTextHPos; css::drawing::MeasureTextVertPos eWantTextVPos; - long nLineDist; - long nHelplineOverhang; - long nHelplineDist; - long nHelpline1Len; - long nHelpline2Len; + tools::Long nLineDist; + tools::Long nHelplineOverhang; + tools::Long nHelplineDist; + tools::Long nHelpline1Len; + tools::Long nHelpline2Len; bool bBelowRefEdge; bool bTextRota90; bool bTextUpsideDown; bool bTextAutoAngle; - long nTextAutoAngleView; + tools::Long nTextAutoAngleView; }; namespace { @@ -284,21 +284,21 @@ struct ImpMeasurePoly ImpLineRec aHelpline1; ImpLineRec aHelpline2; Size aTextSize; - long nLineLen; - long nLineAngle; - long nTextAngle; - long nHlpAngle; + tools::Long nLineLen; + tools::Long nLineAngle; + tools::Long nTextAngle; + tools::Long nHlpAngle; double nLineSin; double nLineCos; sal_uInt16 nMainlineCnt; css::drawing::MeasureTextHorzPos eUsedTextHPos; css::drawing::MeasureTextVertPos eUsedTextVPos; - long nLineWdt2; // half the line width - long nArrow1Len; // length of 1st arrowhead; for Center, use only half - long nArrow2Len; // length of 2nd arrowhead; for Center, use only half - long nArrow1Wdt; // width of 1st arrow - long nArrow2Wdt; // width of 2nd arrow - long nShortLineLen; // line length, if PfeileAussen (arrowheads on the outside) + tools::Long nLineWdt2; // half the line width + tools::Long nArrow1Len; // length of 1st arrowhead; for Center, use only half + tools::Long nArrow2Len; // length of 2nd arrowhead; for Center, use only half + tools::Long nArrow1Wdt; // width of 1st arrow + tools::Long nArrow2Wdt; // width of 2nd arrow + tools::Long nShortLineLen; // line length, if PfeileAussen (arrowheads on the outside) bool bAutoUpsideDown; // UpsideDown via automation bool bBreakedLine; }; @@ -323,12 +323,12 @@ void SdrMeasureObj::ImpTakeAttr(ImpMeasureRec& rRec) const rRec.nTextAutoAngleView=static_cast(rSet.Get(SDRATTR_MEASURETEXTAUTOANGLEVIEW)).GetValue(); } -static long impGetLineStartEndDistance(const basegfx::B2DPolyPolygon& rPolyPolygon, long nNewWidth, bool bCenter) +static tools::Long impGetLineStartEndDistance(const basegfx::B2DPolyPolygon& rPolyPolygon, tools::Long nNewWidth, bool bCenter) { const basegfx::B2DRange aPolygonRange(rPolyPolygon.getB2DRange()); const double fOldWidth(std::max(aPolygonRange.getWidth(), 1.0)); const double fScale(static_cast(nNewWidth) / fOldWidth); - long nHeight(basegfx::fround(aPolygonRange.getHeight() * fScale)); + tools::Long nHeight(basegfx::fround(aPolygonRange.getHeight() * fScale)); if(bCenter) { @@ -348,14 +348,14 @@ void SdrMeasureObj::ImpCalcGeometrics(const ImpMeasureRec& rRec, ImpMeasurePoly& rPol.nLineLen=GetLen(aDelt); rPol.nLineWdt2=0; - long nArrow1Len=0; bool bArrow1Center=false; - long nArrow2Len=0; bool bArrow2Center=false; - long nArrow1Wdt=0; - long nArrow2Wdt=0; + tools::Long nArrow1Len=0; bool bArrow1Center=false; + tools::Long nArrow2Len=0; bool bArrow2Center=false; + tools::Long nArrow1Wdt=0; + tools::Long nArrow2Wdt=0; rPol.nArrow1Wdt=0; rPol.nArrow2Wdt=0; - long nArrowNeed=0; - long nShortLen=0; + tools::Long nArrowNeed=0; + tools::Long nShortLen=0; bool bPfeileAussen = false; const SfxItemSet& rSet = GetObjectItemSet(); @@ -399,12 +399,12 @@ void SdrMeasureObj::ImpCalcGeometrics(const ImpMeasureRec& rRec, ImpMeasurePoly& rPol.bBreakedLine=bBrkLine; if (rPol.eUsedTextHPos==css::drawing::MeasureTextHorzPos_AUTO) { // if text is too wide, push it outside bool bOutside = false; - long nNeedSiz=!rRec.bTextRota90 ? rPol.aTextSize.Width() : rPol.aTextSize.Height(); + tools::Long nNeedSiz=!rRec.bTextRota90 ? rPol.aTextSize.Width() : rPol.aTextSize.Height(); if (nNeedSiz>rPol.nLineLen) bOutside = true; // text doesn't fit in between if (bBrkLine) { if (nNeedSiz+nArrowNeed>rPol.nLineLen) bPfeileAussen = true; // text fits in between, if arrowheads are on the outside } else { - long nSmallNeed=nArrow1Len+nArrow2Len+(nArrow1Wdt+nArrow2Wdt)/2/4; + tools::Long nSmallNeed=nArrow1Len+nArrow2Len+(nArrow1Wdt+nArrow2Wdt)/2/4; if (nNeedSiz+nSmallNeed>rPol.nLineLen) bPfeileAussen = true; // text fits in between, if arrowheads are on the outside } rPol.eUsedTextHPos=bOutside ? css::drawing::MeasureTextHorzPos_LEFTOUTSIDE : css::drawing::MeasureTextHorzPos_INSIDE; @@ -428,7 +428,7 @@ void SdrMeasureObj::ImpCalcGeometrics(const ImpMeasureRec& rRec, ImpMeasurePoly& rPol.bAutoUpsideDown=false; if (rRec.bTextAutoAngle) { - long nTmpAngle=NormAngle36000(rPol.nTextAngle-rRec.nTextAutoAngleView); + tools::Long nTmpAngle=NormAngle36000(rPol.nTextAngle-rRec.nTextAutoAngleView); if (nTmpAngle>=18000) { rPol.nTextAngle+=18000; rPol.bAutoUpsideDown=true; @@ -447,18 +447,18 @@ void SdrMeasureObj::ImpCalcGeometrics(const ImpMeasureRec& rRec, ImpMeasurePoly& nHlpCos=-nHlpCos; } - long nLineDist=rRec.nLineDist; - long nOverhang=rRec.nHelplineOverhang; - long nHelplineDist=rRec.nHelplineDist; + tools::Long nLineDist=rRec.nLineDist; + tools::Long nOverhang=rRec.nHelplineOverhang; + tools::Long nHelplineDist=rRec.nHelplineDist; - long dx= FRound(nLineDist*nHlpCos); - long dy=-FRound(nLineDist*nHlpSin); - long dxh1a= FRound((nHelplineDist-rRec.nHelpline1Len)*nHlpCos); - long dyh1a=-FRound((nHelplineDist-rRec.nHelpline1Len)*nHlpSin); - long dxh1b= FRound((nHelplineDist-rRec.nHelpline2Len)*nHlpCos); - long dyh1b=-FRound((nHelplineDist-rRec.nHelpline2Len)*nHlpSin); - long dxh2= FRound((nLineDist+nOverhang)*nHlpCos); - long dyh2=-FRound((nLineDist+nOverhang)*nHlpSin); + tools::Long dx= FRound(nLineDist*nHlpCos); + tools::Long dy=-FRound(nLineDist*nHlpSin); + tools::Long dxh1a= FRound((nHelplineDist-rRec.nHelpline1Len)*nHlpCos); + tools::Long dyh1a=-FRound((nHelplineDist-rRec.nHelpline1Len)*nHlpSin); + tools::Long dxh1b= FRound((nHelplineDist-rRec.nHelpline2Len)*nHlpCos); + tools::Long dyh1b=-FRound((nHelplineDist-rRec.nHelpline2Len)*nHlpSin); + tools::Long dxh2= FRound((nLineDist+nOverhang)*nHlpCos); + tools::Long dyh2=-FRound((nLineDist+nOverhang)*nHlpSin); // extension line 1 rPol.aHelpline1.aP1=Point(aP1.X()+dxh1a,aP1.Y()+dyh1a); @@ -478,8 +478,8 @@ void SdrMeasureObj::ImpCalcGeometrics(const ImpMeasureRec& rRec, ImpMeasurePoly& rPol.aMainline3=rPol.aMainline1; rPol.nMainlineCnt=1; if (bBrkLine) { - long nNeedSiz=!rRec.bTextRota90 ? rPol.aTextSize.Width() : rPol.aTextSize.Height(); - long nHalfLen=(rPol.nLineLen-nNeedSiz-nArrow1Wdt/4-nArrow2Wdt/4) /2; + tools::Long nNeedSiz=!rRec.bTextRota90 ? rPol.aTextSize.Width() : rPol.aTextSize.Height(); + tools::Long nHalfLen=(rPol.nLineLen-nNeedSiz-nArrow1Wdt/4-nArrow2Wdt/4) /2; rPol.nMainlineCnt=2; rPol.aMainline1.aP2=aMainlinePt1; rPol.aMainline1.aP2.AdjustX(nHalfLen ); @@ -489,9 +489,9 @@ void SdrMeasureObj::ImpCalcGeometrics(const ImpMeasureRec& rRec, ImpMeasurePoly& RotatePoint(rPol.aMainline2.aP1,rPol.aMainline2.aP2,nLineSin,nLineCos); } } else { - long nLen1=nShortLen; // arrowhead's width as line length outside of the arrowhead - long nLen2=nShortLen; - long nTextWdt=rRec.bTextRota90 ? rPol.aTextSize.Height() : rPol.aTextSize.Width(); + tools::Long nLen1=nShortLen; // arrowhead's width as line length outside of the arrowhead + tools::Long nLen2=nShortLen; + tools::Long nTextWdt=rRec.bTextRota90 ? rPol.aTextSize.Height() : rPol.aTextSize.Width(); if (!bBrkLine) { if (rPol.eUsedTextHPos==css::drawing::MeasureTextHorzPos_LEFTOUTSIDE) nLen1=nArrow1Len+nTextWdt; if (rPol.eUsedTextHPos==css::drawing::MeasureTextHorzPos_RIGHTOUTSIDE) nLen2=nArrow2Len+nTextWdt; @@ -616,10 +616,10 @@ void SdrMeasureObj::TakeUnrotatedSnapRect(tools::Rectangle& rRect) const aTextSize2.AdjustHeight(GetTextUpperDistance()+GetTextLowerDistance() ); Point aPt1b(aMPol.aMainline1.aP1); - long nLen=aMPol.nLineLen; - long nLWdt=aMPol.nLineWdt2; - long nArr1Len=aMPol.nArrow1Len; - long nArr2Len=aMPol.nArrow2Len; + tools::Long nLen=aMPol.nLineLen; + tools::Long nLWdt=aMPol.nLineWdt2; + tools::Long nArr1Len=aMPol.nArrow1Len; + tools::Long nArr2Len=aMPol.nArrow2Len; if (aMPol.bBreakedLine) { // In the case of a dashed line and Outside, the text should be // placed next to the line at the arrowhead instead of directly @@ -878,7 +878,7 @@ OUString SdrMeasureObj::getSpecialDragComment(const SdrDragStat& /*rDrag*/) cons void SdrMeasureObj::ImpEvalDrag(ImpMeasureRec& rRec, const SdrDragStat& rDrag) const { - long nLineAngle=GetAngle(rRec.aPt2-rRec.aPt1); + tools::Long nLineAngle=GetAngle(rRec.aPt2-rRec.aPt1); double a = nLineAngle * F_PI18000; double nSin=sin(a); double nCos=cos(a); @@ -909,19 +909,19 @@ void SdrMeasureObj::ImpEvalDrag(ImpMeasureRec& rRec, const SdrDragStat& rDrag) c Point aMov(rMov); Point aFix(bAnf ? rRec.aPt2 : rRec.aPt1); if (bOrtho) { - long ndx0=aMov.X()-aFix.X(); - long ndy0=aMov.Y()-aFix.Y(); + tools::Long ndx0=aMov.X()-aFix.X(); + tools::Long ndy0=aMov.Y()-aFix.Y(); bool bHLin=ndy0==0; bool bVLin=ndx0==0; if (!bHLin || !bVLin) { // else aPt1==aPt2 - long ndx=aPt.X()-aFix.X(); - long ndy=aPt.Y()-aFix.Y(); + tools::Long ndx=aPt.X()-aFix.X(); + tools::Long ndy=aPt.Y()-aFix.Y(); double nXFact=0; if (!bVLin) nXFact=static_cast(ndx)/static_cast(ndx0); double nYFact=0; if (!bHLin) nYFact=static_cast(ndy)/static_cast(ndy0); bool bHor=bHLin || (!bVLin && (nXFact>nYFact) ==bBigOrtho); bool bVer=bVLin || (!bHLin && (nXFact<=nYFact)==bBigOrtho); - if (bHor) ndy=long(ndy0*nXFact); - if (bVer) ndx=long(ndx0*nYFact); + if (bHor) ndy=tools::Long(ndy0*nXFact); + if (bVer) ndx=tools::Long(ndx0*nYFact); aPt=aFix; aPt.AdjustX(ndx ); aPt.AdjustY(ndy ); @@ -930,7 +930,7 @@ void SdrMeasureObj::ImpEvalDrag(ImpMeasureRec& rRec, const SdrDragStat& rDrag) c rMov=aPt; } break; case 4: case 5: { - long nVal0=rRec.nLineDist; + tools::Long nVal0=rRec.nLineDist; RotatePoint(aPt,(nHdlNum==4 ? aPt1 : aPt2),nSin,-nCos); rRec.nLineDist=aPt.Y()- (nHdlNum==4 ? aPt1.Y() : aPt2.Y()); if (bBelow) rRec.nLineDist=-rRec.nLineDist; @@ -1016,16 +1016,16 @@ void SdrMeasureObj::NbcResize(const Point& rRef, const Fraction& xFact, const Fr SetTextDirty(); } -void SdrMeasureObj::NbcRotate(const Point& rRef, long nAngle, double sn, double cs) +void SdrMeasureObj::NbcRotate(const Point& rRef, tools::Long nAngle, double sn, double cs) { SdrTextObj::NbcRotate(rRef,nAngle,sn,cs); - long nLen0=GetLen(aPt2-aPt1); + tools::Long nLen0=GetLen(aPt2-aPt1); RotatePoint(aPt1,rRef,sn,cs); RotatePoint(aPt2,rRef,sn,cs); - long nLen1=GetLen(aPt2-aPt1); + tools::Long nLen1=GetLen(aPt2-aPt1); if (nLen1!=nLen0) { // rounding error! - long dx=aPt2.X()-aPt1.X(); - long dy=aPt2.Y()-aPt1.Y(); + tools::Long dx=aPt2.X()-aPt1.X(); + tools::Long dy=aPt2.Y()-aPt1.Y(); dx=BigMulDiv(dx,nLen0,nLen1); dy=BigMulDiv(dy,nLen0,nLen1); if (rRef==aPt2) { @@ -1047,7 +1047,7 @@ void SdrMeasureObj::NbcMirror(const Point& rRef1, const Point& rRef2) SetRectsDirty(); } -void SdrMeasureObj::NbcShear(const Point& rRef, long nAngle, double tn, bool bVShear) +void SdrMeasureObj::NbcShear(const Point& rRef, tools::Long nAngle, double tn, bool bVShear) { SdrTextObj::NbcShear(rRef,nAngle,tn,bVShear); ShearPoint(aPt1,rRef,tn,bVShear); @@ -1056,7 +1056,7 @@ void SdrMeasureObj::NbcShear(const Point& rRef, long nAngle, double tn, bool bVS SetTextDirty(); } -long SdrMeasureObj::GetRotateAngle() const +tools::Long SdrMeasureObj::GetRotateAngle() const { return GetAngle(aPt2-aPt1); } diff --git a/svx/source/svdraw/svdomedia.cxx b/svx/source/svdraw/svdomedia.cxx index 54ad20798a45..19f04554a246 100644 --- a/svx/source/svdraw/svdomedia.cxx +++ b/svx/source/svdraw/svdomedia.cxx @@ -186,13 +186,13 @@ void SdrMediaObj::AdjustToMaxRect( const tools::Rectangle& rMaxRect, bool bShrin // scale graphic to page size if ( fGrfWH < fWinWH ) { - aSize.setWidth( static_cast(aMaxSize.Height() * fGrfWH) ); + aSize.setWidth( static_cast(aMaxSize.Height() * fGrfWH) ); aSize.setHeight( aMaxSize.Height() ); } else if ( fGrfWH > 0.F ) { aSize.setWidth( aMaxSize.Width() ); - aSize.setHeight( static_cast(aMaxSize.Width() / fGrfWH) ); + aSize.setHeight( static_cast(aMaxSize.Width() / fGrfWH) ); } aPos = rMaxRect.Center(); diff --git a/svx/source/svdraw/svdoole2.cxx b/svx/source/svdraw/svdoole2.cxx index 13f905ac2301..83267133ac55 100644 --- a/svx/source/svdraw/svdoole2.cxx +++ b/svx/source/svdraw/svdoole2.cxx @@ -180,8 +180,8 @@ tools::Rectangle SdrLightEmbeddedClient_Impl::impl_getScaledRect_nothrow() const { tools::Rectangle aLogicRect( mpObj->GetLogicRect() ); // apply scaling to object area and convert to pixels - aLogicRect.SetSize( Size( long( aLogicRect.GetWidth() * m_aScaleWidth), - long( aLogicRect.GetHeight() * m_aScaleHeight) ) ); + aLogicRect.SetSize( Size( tools::Long( aLogicRect.GetWidth() * m_aScaleWidth), + tools::Long( aLogicRect.GetHeight() * m_aScaleHeight) ) ); return aLogicRect; } @@ -259,8 +259,8 @@ void SAL_CALL SdrLightEmbeddedClient_Impl::notifyEvent( const document::EventObj aVisArea.SetSize( Size( aSz.Width, aSz.Height ) ); aVisArea = OutputDevice::LogicToLogic(aVisArea, MapMode(aObjMapUnit), MapMode(aContainerMapUnit)); - Size aScaledSize( static_cast< long >( m_aScaleWidth * Fraction( aVisArea.GetWidth() ) ), - static_cast< long >( m_aScaleHeight * Fraction( aVisArea.GetHeight() ) ) ); + Size aScaledSize( static_cast< tools::Long >( m_aScaleWidth * Fraction( aVisArea.GetWidth() ) ), + static_cast< tools::Long >( m_aScaleHeight * Fraction( aVisArea.GetHeight() ) ) ); tools::Rectangle aLogicRect( mpObj->GetLogicRect() ); // react to the change if the difference is bigger than one pixel @@ -500,8 +500,8 @@ void SAL_CALL SdrLightEmbeddedClient_Impl::changedPlacement( const awt::Rectangl //SfxBooleanFlagGuard aGuard( m_bResizeNoScale, true ); // new size of the object area without scaling - Size aNewObjSize( long( aNewLogicRect.GetWidth() / m_aScaleWidth ), - long( aNewLogicRect.GetHeight() / m_aScaleHeight ) ); + Size aNewObjSize( tools::Long( aNewLogicRect.GetWidth() / m_aScaleWidth ), + tools::Long( aNewLogicRect.GetHeight() / m_aScaleHeight ) ); // now remove scaling from new placement and keep this at the new object area aNewLogicRect.SetSize( aNewObjSize ); @@ -1488,8 +1488,8 @@ void SdrOle2Obj::ImpSetVisAreaSize() // objects' visual area. The scaling will not change, but it might exist already and must // be used in calculations MapUnit aMapUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( mpImpl->mxObjRef->getMapUnit( GetAspect() ) ); - Size aVisSize( static_cast( Fraction( maRect.GetWidth() ) / aScaleWidth ), - static_cast( Fraction( maRect.GetHeight() ) / aScaleHeight ) ); + Size aVisSize( static_cast( Fraction( maRect.GetWidth() ) / aScaleWidth ), + static_cast( Fraction( maRect.GetHeight() ) / aScaleHeight ) ); aVisSize = OutputDevice::LogicToLogic( aVisSize, @@ -1508,8 +1508,8 @@ void SdrOle2Obj::ImpSetVisAreaSize() {} tools::Rectangle aAcceptedVisArea; - aAcceptedVisArea.SetSize( Size( static_cast( Fraction( long( aSz.Width ) ) * aScaleWidth ), - static_cast( Fraction( long( aSz.Height ) ) * aScaleHeight ) ) ); + aAcceptedVisArea.SetSize( Size( static_cast( Fraction( tools::Long( aSz.Width ) ) * aScaleWidth ), + static_cast( Fraction( tools::Long( aSz.Height ) ) * aScaleHeight ) ) ); if (aVisSize != aAcceptedVisArea.GetSize()) { // server changed VisArea to its liking and the VisArea is different than the suggested one diff --git a/svx/source/svdraw/svdopath.cxx b/svx/source/svdraw/svdopath.cxx index f197462c76ab..2ba5f7436781 100644 --- a/svx/source/svdraw/svdopath.cxx +++ b/svx/source/svdraw/svdopath.cxx @@ -238,9 +238,9 @@ struct ImpPathCreateUser : public SdrDragStatUserData Point aRectP1; Point aRectP2; Point aRectP3; - long nCircRadius; - long nCircStAngle; - long nCircRelAngle; + tools::Long nCircRadius; + tools::Long nCircStAngle; + tools::Long nCircRelAngle; bool bBezier; bool bBezHasCtrl0; bool bCircle; @@ -266,7 +266,7 @@ public: void CalcCircle(const Point& rP1, const Point& rP2, const Point& rDir, SdrView const * pView); XPolygon GetCirclePoly() const; void CalcLine(const Point& rP1, const Point& rP2, const Point& rDir, SdrView const * pView); - static Point CalcLine(const Point& rCsr, long nDirX, long nDirY, SdrView const * pView); + static Point CalcLine(const Point& rCsr, tools::Long nDirX, tools::Long nDirY, SdrView const * pView); XPolygon GetLinePoly() const; void CalcRect(const Point& rP1, const Point& rP2, const Point& rDir, SdrView const * pView); XPolygon GetRectPoly() const; @@ -308,17 +308,17 @@ XPolygon ImpPathCreateUser::GetBezierPoly() const void ImpPathCreateUser::CalcCircle(const Point& rP1, const Point& rP2, const Point& rDir, SdrView const * pView) { - long nTangAngle=GetAngle(rDir); + tools::Long nTangAngle=GetAngle(rDir); aCircStart=rP1; aCircEnd=rP2; aCircCenter=rP1; - long dx=rP2.X()-rP1.X(); - long dy=rP2.Y()-rP1.Y(); - long dAngle=GetAngle(Point(dx,dy))-nTangAngle; + tools::Long dx=rP2.X()-rP1.X(); + tools::Long dy=rP2.Y()-rP1.Y(); + tools::Long dAngle=GetAngle(Point(dx,dy))-nTangAngle; dAngle=NormAngle36000(dAngle); - long nTmpAngle=NormAngle36000(9000-dAngle); + tools::Long nTmpAngle=NormAngle36000(9000-dAngle); bool bRet=nTmpAngle!=9000 && nTmpAngle!=27000; - long nRad=0; + tools::Long nRad=0; if (bRet) { double cs = cos(nTmpAngle * F_PI18000); double nR=static_cast(GetLen(Point(dx,dy)))/cs/2; @@ -337,7 +337,7 @@ void ImpPathCreateUser::CalcCircle(const Point& rP1, const Point& rP2, const Poi } bAngleSnap=pView!=nullptr && pView->IsAngleSnapEnabled(); if (bAngleSnap) { - long nSA=pView->GetSnapAngle(); + tools::Long nSA=pView->GetSnapAngle(); if (nSA!=0) { // angle snapping bool bNeg=nCircRelAngle<0; if (bNeg) nCircRelAngle=-nCircRelAngle; @@ -378,21 +378,21 @@ XPolygon ImpPathCreateUser::GetCirclePoly() const } } -Point ImpPathCreateUser::CalcLine(const Point& aCsr, long nDirX, long nDirY, SdrView const * pView) +Point ImpPathCreateUser::CalcLine(const Point& aCsr, tools::Long nDirX, tools::Long nDirY, SdrView const * pView) { - long x=aCsr.X(); - long y=aCsr.Y(); + tools::Long x=aCsr.X(); + tools::Long y=aCsr.Y(); bool bHLin=nDirY==0; bool bVLin=nDirX==0; if (bHLin) y=0; else if (bVLin) x=0; else { - long x1=BigMulDiv(y,nDirX,nDirY); - long y1=y; - long x2=x; - long y2=BigMulDiv(x,nDirY,nDirX); - long l1=std::abs(x1)+std::abs(y1); - long l2=std::abs(x2)+std::abs(y2); + tools::Long x1=BigMulDiv(y,nDirX,nDirY); + tools::Long y1=y; + tools::Long x2=x; + tools::Long y2=BigMulDiv(x,nDirY,nDirX); + tools::Long l1=std::abs(x1)+std::abs(y1); + tools::Long l2=std::abs(x2)+std::abs(y2); if ((l1<=l2) != (pView!=nullptr && pView->IsBigOrtho())) { x=x1; y=y1; } else { @@ -409,10 +409,10 @@ void ImpPathCreateUser::CalcLine(const Point& rP1, const Point& rP2, const Point bLine90=false; if (rP1==rP2 || (rDir.X()==0 && rDir.Y()==0)) { bLine=false; return; } Point aTmpPt(rP2-rP1); - long nDirX=rDir.X(); - long nDirY=rDir.Y(); - Point aP1(CalcLine(aTmpPt, nDirX, nDirY,pView)); aP1-=aTmpPt; long nQ1=std::abs(aP1.X())+std::abs(aP1.Y()); - Point aP2(CalcLine(aTmpPt, nDirY,-nDirX,pView)); aP2-=aTmpPt; long nQ2=std::abs(aP2.X())+std::abs(aP2.Y()); + tools::Long nDirX=rDir.X(); + tools::Long nDirY=rDir.Y(); + Point aP1(CalcLine(aTmpPt, nDirX, nDirY,pView)); aP1-=aTmpPt; tools::Long nQ1=std::abs(aP1.X())+std::abs(aP1.Y()); + Point aP2(CalcLine(aTmpPt, nDirY,-nDirX,pView)); aP2-=aTmpPt; tools::Long nQ2=std::abs(aP2.X())+std::abs(aP2.Y()); if (pView!=nullptr && pView->IsOrtho()) nQ1=0; // Ortho turns off at right angle bLine90=nQ1>2*nQ2; if (!bLine90) { // smooth transition @@ -438,18 +438,18 @@ void ImpPathCreateUser::CalcRect(const Point& rP1, const Point& rP2, const Point aRectP3=rP2; if (rP1==rP2 || (rDir.X()==0 && rDir.Y()==0)) { bRect=false; return; } Point aTmpPt(rP2-rP1); - long nDirX=rDir.X(); - long nDirY=rDir.Y(); - long x=aTmpPt.X(); - long y=aTmpPt.Y(); + tools::Long nDirX=rDir.X(); + tools::Long nDirY=rDir.Y(); + tools::Long x=aTmpPt.X(); + tools::Long y=aTmpPt.Y(); bool bHLin=nDirY==0; bool bVLin=nDirX==0; if (bHLin) y=0; else if (bVLin) x=0; else { y=BigMulDiv(x,nDirY,nDirX); - long nHypLen=aTmpPt.Y()-y; - long nTangAngle=-GetAngle(rDir); + tools::Long nHypLen=aTmpPt.Y()-y; + tools::Long nTangAngle=-GetAngle(rDir); // sin=g/h, g=h*sin double a = nTangAngle * F_PI18000; double sn=sin(a); @@ -461,21 +461,21 @@ void ImpPathCreateUser::CalcRect(const Point& rP1, const Point& rP2, const Point aRectP2.AdjustX(x ); aRectP2.AdjustY(y ); if (pView!=nullptr && pView->IsOrtho()) { - long dx1=aRectP2.X()-aRectP1.X(); long dx1a=std::abs(dx1); - long dy1=aRectP2.Y()-aRectP1.Y(); long dy1a=std::abs(dy1); - long dx2=aRectP3.X()-aRectP2.X(); long dx2a=std::abs(dx2); - long dy2=aRectP3.Y()-aRectP2.Y(); long dy2a=std::abs(dy2); + tools::Long dx1=aRectP2.X()-aRectP1.X(); tools::Long dx1a=std::abs(dx1); + tools::Long dy1=aRectP2.Y()-aRectP1.Y(); tools::Long dy1a=std::abs(dy1); + tools::Long dx2=aRectP3.X()-aRectP2.X(); tools::Long dx2a=std::abs(dx2); + tools::Long dy2=aRectP3.Y()-aRectP2.Y(); tools::Long dy2a=std::abs(dy2); bool b1MoreThan2=dx1a+dy1a>dx2a+dy2a; if (b1MoreThan2 != pView->IsBigOrtho()) { - long xtemp=dy2a-dx1a; if (dx1<0) xtemp=-xtemp; - long ytemp=dx2a-dy1a; if (dy1<0) ytemp=-ytemp; + tools::Long xtemp=dy2a-dx1a; if (dx1<0) xtemp=-xtemp; + tools::Long ytemp=dx2a-dy1a; if (dy1<0) ytemp=-ytemp; aRectP2.AdjustX(xtemp ); aRectP2.AdjustY(ytemp ); aRectP3.AdjustX(xtemp ); aRectP3.AdjustY(ytemp ); } else { - long xtemp=dy1a-dx2a; if (dx2<0) xtemp=-xtemp; - long ytemp=dx1a-dy2a; if (dy2<0) ytemp=-ytemp; + tools::Long xtemp=dy1a-dx2a; if (dx2<0) xtemp=-xtemp; + tools::Long ytemp=dx1a-dy2a; if (dy2<0) ytemp=-ytemp; aRectP3.AdjustX(xtemp ); aRectP3.AdjustY(ytemp ); } @@ -675,20 +675,20 @@ bool ImpPathForDragAndCreate::movePathDrag( SdrDragStat& rDrag ) const } if (nPnt1!=0xFFFF && !bPrevIsControl) { Point aPnt1=mpSdrPathDragData->aXP[nPnt1]; - long ndx0=aPnt.X()-aPnt1.X(); - long ndy0=aPnt.Y()-aPnt1.Y(); + tools::Long ndx0=aPnt.X()-aPnt1.X(); + tools::Long ndy0=aPnt.Y()-aPnt1.Y(); bool bHLin=ndy0==0; bool bVLin=ndx0==0; if (!bHLin || !bVLin) { - long ndx=aPos.X()-aPnt1.X(); - long ndy=aPos.Y()-aPnt1.Y(); + tools::Long ndx=aPos.X()-aPnt1.X(); + tools::Long ndy=aPos.Y()-aPnt1.Y(); bPnt1=true; double nXFact=0; if (!bVLin) nXFact=static_cast(ndx)/static_cast(ndx0); double nYFact=0; if (!bHLin) nYFact=static_cast(ndy)/static_cast(ndy0); bool bHor=bHLin || (!bVLin && (nXFact>nYFact) ==bBigOrtho); bool bVer=bVLin || (!bHLin && (nXFact<=nYFact)==bBigOrtho); - if (bHor) ndy=long(ndy0*nXFact); - if (bVer) ndx=long(ndx0*nYFact); + if (bHor) ndy=tools::Long(ndy0*nXFact); + if (bVer) ndx=tools::Long(ndx0*nYFact); aNewPos1=aPnt1; aNewPos1.AdjustX(ndx ); aNewPos1.AdjustY(ndy ); @@ -696,20 +696,20 @@ bool ImpPathForDragAndCreate::movePathDrag( SdrDragStat& rDrag ) const } if (nPnt2!=0xFFFF && !bNextIsControl) { Point aPnt2=mpSdrPathDragData->aXP[nPnt2]; - long ndx0=aPnt.X()-aPnt2.X(); - long ndy0=aPnt.Y()-aPnt2.Y(); + tools::Long ndx0=aPnt.X()-aPnt2.X(); + tools::Long ndy0=aPnt.Y()-aPnt2.Y(); bool bHLin=ndy0==0; bool bVLin=ndx0==0; if (!bHLin || !bVLin) { - long ndx=aPos.X()-aPnt2.X(); - long ndy=aPos.Y()-aPnt2.Y(); + tools::Long ndx=aPos.X()-aPnt2.X(); + tools::Long ndy=aPos.Y()-aPnt2.Y(); bPnt2=true; double nXFact=0; if (!bVLin) nXFact=static_cast(ndx)/static_cast(ndx0); double nYFact=0; if (!bHLin) nYFact=static_cast(ndy)/static_cast(ndy0); bool bHor=bHLin || (!bVLin && (nXFact>nYFact) ==bBigOrtho); bool bVer=bVLin || (!bHLin && (nXFact<=nYFact)==bBigOrtho); - if (bHor) ndy=long(ndy0*nXFact); - if (bVer) ndx=long(ndx0*nYFact); + if (bHor) ndy=tools::Long(ndy0*nXFact); + if (bVer) ndx=tools::Long(ndx0*nYFact); aNewPos2=aPnt2; aNewPos2.AdjustX(ndx ); aNewPos2.AdjustY(ndy ); @@ -736,11 +736,11 @@ bool ImpPathForDragAndCreate::movePathDrag( SdrDragStat& rDrag ) const { Point aPt(mpSdrPathDragData->aXP[nNextPnt]); aPt-=rDrag.GetNow(); - long nAngle1=GetAngle(aPt); + tools::Long nAngle1=GetAngle(aPt); aPt=rDrag.GetNow(); aPt-=mpSdrPathDragData->aXP[nPrevPnt]; - long nAngle2=GetAngle(aPt); - long nDiff=nAngle1-nAngle2; + tools::Long nAngle2=GetAngle(aPt); + tools::Long nDiff=nAngle1-nAngle2; nDiff=std::abs(nDiff); mpSdrPathDragData->bEliminate=nDiff<=rDrag.GetView()->GetEliminatePolyPointLimitAngle(); if (mpSdrPathDragData->bEliminate) { // adapt position, Smooth is true for the ends @@ -1305,15 +1305,15 @@ bool ImpPathForDragAndCreate::MovCreate(SdrDragStat& rStat) if (pU->nBezierStartPoint>nCurrentPoint) pU->nBezierStartPoint=nCurrentPoint; if (rStat.IsMouseDown() && nCurrentPoint>0) { // don't allow two consecutive points to occupy too similar positions - long nMinDist=1; + tools::Long nMinDist=1; if (pView!=nullptr) nMinDist=pView->GetFreeHandMinDistPix(); if (pOut!=nullptr) nMinDist=pOut->PixelToLogic(Size(nMinDist,0)).Width(); if (nMinDist<1) nMinDist=1; Point aPt0(rXPoly[nCurrentPoint-1]); Point aPt1(rStat.GetNow()); - long dx=aPt0.X()-aPt1.X(); if (dx<0) dx=-dx; - long dy=aPt0.Y()-aPt1.Y(); if (dy<0) dy=-dy; + tools::Long dx=aPt0.X()-aPt1.X(); if (dx<0) dx=-dx; + tools::Long dy=aPt0.Y()-aPt1.Y(); if (dy<0) dy=-dy; if (dx0) { Point aRef(rRect.TopLeft()); @@ -272,7 +272,7 @@ basegfx::B2DPolyPolygon SdrRectObj::TakeXorPoly() const void SdrRectObj::RecalcSnapRect() { - long nEckRad=GetEckenradius(); + tools::Long nEckRad=GetEckenradius(); if ((aGeo.nRotationAngle!=0 || aGeo.nShearAngle!=0) && nEckRad!=0) { maSnapRect=GetXPoly().GetBoundRect(); } else { @@ -318,8 +318,8 @@ void SdrRectObj::AddToHdlList(SdrHdlList& rHdlList) const { case 1: // Handle for changing the corner radius { - long a = GetEckenradius(); - long b = std::max(maRect.GetWidth(),maRect.GetHeight())/2; // rounded up, because GetWidth() adds 1 + tools::Long a = GetEckenradius(); + tools::Long b = std::max(maRect.GetWidth(),maRect.GetHeight())/2; // rounded up, because GetWidth() adds 1 if (a>b) a=b; if (a<0) a=0; aPnt=maRect.TopLeft(); @@ -470,13 +470,13 @@ void SdrRectObj::NbcResize(const Point& rRef, const Fraction& xFact, const Fract SetXPolyDirty(); } -void SdrRectObj::NbcRotate(const Point& rRef, long nAngle, double sn, double cs) +void SdrRectObj::NbcRotate(const Point& rRef, tools::Long nAngle, double sn, double cs) { SdrTextObj::NbcRotate(rRef,nAngle,sn,cs); SetXPolyDirty(); } -void SdrRectObj::NbcShear(const Point& rRef, long nAngle, double tn, bool bVShear) +void SdrRectObj::NbcShear(const Point& rRef, tools::Long nAngle, double tn, bool bVShear) { SdrTextObj::NbcShear(rRef,nAngle,tn,bVShear); SetXPolyDirty(); diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx index dfba1f6cf464..8919c5d1c7dd 100644 --- a/svx/source/svdraw/svdotext.cxx +++ b/svx/source/svdraw/svdotext.cxx @@ -459,7 +459,7 @@ void SdrTextObj::handlePageChange(SdrPage* pOldPage, SdrPage* pNewPage) } } -void SdrTextObj::NbcSetEckenradius(long nRad) +void SdrTextObj::NbcSetEckenradius(tools::Long nRad) { SetObjectItem(makeSdrEckenradiusItem(nRad)); } @@ -491,8 +491,8 @@ void SdrTextObj::AdaptTextMinSize() if(bW) { // Set minimum width. - const long nDist = GetTextLeftDistance() + GetTextRightDistance(); - const long nW = std::max(0, maRect.GetWidth() - 1 - nDist); // text width without margins + const tools::Long nDist = GetTextLeftDistance() + GetTextRightDistance(); + const tools::Long nW = std::max(0, maRect.GetWidth() - 1 - nDist); // text width without margins aSet.Put(makeSdrTextMinFrameWidthItem(nW)); @@ -506,8 +506,8 @@ void SdrTextObj::AdaptTextMinSize() if(bH) { // Set Minimum height. - const long nDist = GetTextUpperDistance() + GetTextLowerDistance(); - const long nH = std::max(0, maRect.GetHeight() - 1 - nDist); // text height without margins + const tools::Long nDist = GetTextUpperDistance() + GetTextLowerDistance(); + const tools::Long nH = std::max(0, maRect.GetHeight() - 1 - nDist); // text height without margins aSet.Put(makeSdrTextMinFrameHeightItem(nH)); @@ -585,10 +585,10 @@ void SdrTextObj::TakeUnrotatedSnapRect(tools::Rectangle& rRect) const void SdrTextObj::TakeTextAnchorRect(tools::Rectangle& rAnchorRect) const { - long nLeftDist=GetTextLeftDistance(); - long nRightDist=GetTextRightDistance(); - long nUpperDist=GetTextUpperDistance(); - long nLowerDist=GetTextLowerDistance(); + tools::Long nLeftDist=GetTextLeftDistance(); + tools::Long nRightDist=GetTextRightDistance(); + tools::Long nUpperDist=GetTextUpperDistance(); + tools::Long nLowerDist=GetTextLowerDistance(); tools::Rectangle aAnkRect(maRect); // the rectangle in which we anchor bool bFrame=IsTextFrame(); if (!bFrame) { @@ -643,12 +643,12 @@ void SdrTextObj::TakeTextRect( SdrOutliner& rOutliner, tools::Rectangle& rTextRe if (!bFitToSize && !bContourFrame) { - long nAnkWdt=aAnkRect.GetWidth(); - long nAnkHgt=aAnkRect.GetHeight(); + tools::Long nAnkWdt=aAnkRect.GetWidth(); + tools::Long nAnkHgt=aAnkRect.GetHeight(); if (bFrame) { - long nWdt=nAnkWdt; - long nHgt=nAnkHgt; + tools::Long nWdt=nAnkWdt; + tools::Long nHgt=nAnkHgt; bool bInEditMode = IsInEditMode(); @@ -762,7 +762,7 @@ void SdrTextObj::TakeTextRect( SdrOutliner& rOutliner, tools::Rectangle& rTextRe if (eHAdj==SDRTEXTHORZADJUST_CENTER || eHAdj==SDRTEXTHORZADJUST_RIGHT) { - long nFreeWdt=aAnkRect.GetWidth()-aTextSiz.Width(); + tools::Long nFreeWdt=aAnkRect.GetWidth()-aTextSiz.Width(); if (eHAdj==SDRTEXTHORZADJUST_CENTER) aTextPos.AdjustX(nFreeWdt/2 ); if (eHAdj==SDRTEXTHORZADJUST_RIGHT) @@ -770,7 +770,7 @@ void SdrTextObj::TakeTextRect( SdrOutliner& rOutliner, tools::Rectangle& rTextRe } if (eVAdj==SDRTEXTVERTADJUST_CENTER || eVAdj==SDRTEXTVERTADJUST_BOTTOM) { - long nFreeHgt=aAnkRect.GetHeight()-aTextSiz.Height(); + tools::Long nFreeHgt=aAnkRect.GetHeight()-aTextSiz.Height(); if (eVAdj==SDRTEXTVERTADJUST_CENTER) aTextPos.AdjustY(nFreeHgt/2 ); if (eVAdj==SDRTEXTVERTADJUST_BOTTOM) @@ -852,21 +852,21 @@ void SdrTextObj::ImpSetCharStretching(SdrOutliner& rOutliner, const Size& rTextS } unsigned nLoopCount=0; bool bNoMoreLoop = false; - long nXDiff0=0x7FFFFFFF; - long nWantWdt=rShapeSize.Width(); - long nIsWdt=rTextSize.Width(); + tools::Long nXDiff0=0x7FFFFFFF; + tools::Long nWantWdt=rShapeSize.Width(); + tools::Long nIsWdt=rTextSize.Width(); if (nIsWdt==0) nIsWdt=1; - long nWantHgt=rShapeSize.Height(); - long nIsHgt=rTextSize.Height(); + tools::Long nWantHgt=rShapeSize.Height(); + tools::Long nIsHgt=rTextSize.Height(); if (nIsHgt==0) nIsHgt=1; - long nXTolPl=nWantWdt/100; // tolerance: +1% - long nXTolMi=nWantWdt/25; // tolerance: -4% - long nXCorr =nWantWdt/20; // correction scale: 5% + tools::Long nXTolPl=nWantWdt/100; // tolerance: +1% + tools::Long nXTolMi=nWantWdt/25; // tolerance: -4% + tools::Long nXCorr =nWantWdt/20; // correction scale: 5% - long nX=(nWantWdt*100) /nIsWdt; // calculate X stretching - long nY=(nWantHgt*100) /nIsHgt; // calculate Y stretching + tools::Long nX=(nWantWdt*100) /nIsWdt; // calculate X stretching + tools::Long nY=(nWantHgt*100) /nIsHgt; // calculate Y stretching bool bChkX = true; if (bNoStretching) { // might only be possible proportionally if (nX>nY) { nX=nY; bChkX=false; } @@ -899,14 +899,14 @@ void SdrTextObj::ImpSetCharStretching(SdrOutliner& rOutliner, const Size& rTextS rOutliner.SetGlobalCharStretching(static_cast(nX),static_cast(nY)); nLoopCount++; Size aSiz(rOutliner.CalcTextSize()); - long nXDiff=aSiz.Width()-nWantWdt; + tools::Long nXDiff=aSiz.Width()-nWantWdt; rFitXCorrection=Fraction(nWantWdt,aSiz.Width()); if (((nXDiff>=nXTolMi || !bChkX) && nXDiff<=nXTolPl) || nXDiff==nXDiff0) { bNoMoreLoop = true; } else { // correct stretching factors - long nMul=nWantWdt; - long nDiv=aSiz.Width(); + tools::Long nMul=nWantWdt; + tools::Long nDiv=aSiz.Width(); if (std::abs(nXDiff)<=2*nXCorr) { if (nMul>nDiv) nDiv+=(nMul-nDiv)/2; // but only add half of what we calculated, else nMul+=(nDiv-nMul)/2; // because the EditEngine calculates wrongly later on @@ -1704,27 +1704,27 @@ bool SdrTextObj::IsReallyEdited() const // moved inlines here form hxx -long SdrTextObj::GetEckenradius() const +tools::Long SdrTextObj::GetEckenradius() const { return GetObjectItemSet().Get(SDRATTR_ECKENRADIUS).GetValue(); } -long SdrTextObj::GetMinTextFrameHeight() const +tools::Long SdrTextObj::GetMinTextFrameHeight() const { return GetObjectItemSet().Get(SDRATTR_TEXT_MINFRAMEHEIGHT).GetValue(); } -long SdrTextObj::GetMaxTextFrameHeight() const +tools::Long SdrTextObj::GetMaxTextFrameHeight() const { return GetObjectItemSet().Get(SDRATTR_TEXT_MAXFRAMEHEIGHT).GetValue(); } -long SdrTextObj::GetMinTextFrameWidth() const +tools::Long SdrTextObj::GetMinTextFrameWidth() const { return GetObjectItemSet().Get(SDRATTR_TEXT_MINFRAMEWIDTH).GetValue(); } -long SdrTextObj::GetMaxTextFrameWidth() const +tools::Long SdrTextObj::GetMaxTextFrameWidth() const { return GetObjectItemSet().Get(SDRATTR_TEXT_MAXFRAMEWIDTH).GetValue(); } @@ -1747,22 +1747,22 @@ bool SdrTextObj::IsContourTextFrame() const && GetObjectItemSet().Get(SDRATTR_TEXT_CONTOURFRAME).GetValue(); } -long SdrTextObj::GetTextLeftDistance() const +tools::Long SdrTextObj::GetTextLeftDistance() const { return GetObjectItemSet().Get(SDRATTR_TEXT_LEFTDIST).GetValue(); } -long SdrTextObj::GetTextRightDistance() const +tools::Long SdrTextObj::GetTextRightDistance() const { return GetObjectItemSet().Get(SDRATTR_TEXT_RIGHTDIST).GetValue(); } -long SdrTextObj::GetTextUpperDistance() const +tools::Long SdrTextObj::GetTextUpperDistance() const { return GetObjectItemSet().Get(SDRATTR_TEXT_UPPERDIST).GetValue(); } -long SdrTextObj::GetTextLowerDistance() const +tools::Long SdrTextObj::GetTextLowerDistance() const { return GetObjectItemSet().Get(SDRATTR_TEXT_LOWERDIST).GetValue(); } diff --git a/svx/source/svdraw/svdotxat.cxx b/svx/source/svdraw/svdotxat.cxx index 4d7b5ee8434c..7c4548a2ef8d 100644 --- a/svx/source/svdraw/svdotxat.cxx +++ b/svx/source/svdraw/svdotxat.cxx @@ -67,8 +67,8 @@ bool SdrTextObj::AdjustTextFrameWidthAndHeight( tools::Rectangle& rR, bool bHgt, bool bVScroll = bScroll && (eAniDir == SdrTextAniDirection::Up || eAniDir == SdrTextAniDirection::Down); tools::Rectangle aOldRect = rR; - long nHgt = 0, nMinHgt = 0, nMaxHgt = 0; - long nWdt = 0, nMinWdt = 0, nMaxWdt = 0; + tools::Long nHgt = 0, nMinHgt = 0, nMaxHgt = 0; + tools::Long nWdt = 0, nMinWdt = 0, nMaxWdt = 0; Size aNewSize = rR.GetSize(); aNewSize.AdjustWidth( -1 ); aNewSize.AdjustHeight( -1 ); @@ -105,8 +105,8 @@ bool SdrTextObj::AdjustTextFrameWidthAndHeight( tools::Rectangle& rR, bool bHgt, aNewSize.setHeight( nMaxHgt ); } - long nHDist = GetTextLeftDistance() + GetTextRightDistance(); - long nVDist = GetTextUpperDistance() + GetTextLowerDistance(); + tools::Long nHDist = GetTextLeftDistance() + GetTextRightDistance(); + tools::Long nVDist = GetTextUpperDistance() + GetTextLowerDistance(); aNewSize.AdjustWidth( -nHDist ); aNewSize.AdjustHeight( -nVDist ); @@ -179,8 +179,8 @@ bool SdrTextObj::AdjustTextFrameWidthAndHeight( tools::Rectangle& rR, bool bHgt, nHgt += nVDist; if (nHgt < 1) nHgt = 1; // nVDist may be negative - long nWdtGrow = nWdt - (rR.Right() - rR.Left()); - long nHgtGrow = nHgt - (rR.Bottom() - rR.Top()); + tools::Long nWdtGrow = nWdt - (rR.Right() - rR.Left()); + tools::Long nHgtGrow = nHgt - (rR.Bottom() - rR.Top()); if (nWdtGrow == 0) bWdtGrow = false; @@ -200,7 +200,7 @@ bool SdrTextObj::AdjustTextFrameWidthAndHeight( tools::Rectangle& rR, bool bHgt, rR.AdjustLeft( -nWdtGrow ); else { - long nWdtGrow2 = nWdtGrow / 2; + tools::Long nWdtGrow2 = nWdtGrow / 2; rR.AdjustLeft( -nWdtGrow2 ); rR.SetRight( rR.Left() + nWdt ); } @@ -216,7 +216,7 @@ bool SdrTextObj::AdjustTextFrameWidthAndHeight( tools::Rectangle& rR, bool bHgt, rR.AdjustTop( -nHgtGrow ); else { - long nHgtGrow2 = nHgtGrow / 2; + tools::Long nHgtGrow2 = nHgtGrow / 2; rR.AdjustTop( -nHgtGrow2 ); rR.SetBottom( rR.Top() + nHgt ); } diff --git a/svx/source/svdraw/svdotxdr.cxx b/svx/source/svdraw/svdotxdr.cxx index f33f7cfe668a..86adbdac2daa 100644 --- a/svx/source/svdraw/svdotxdr.cxx +++ b/svx/source/svdraw/svdotxdr.cxx @@ -92,12 +92,12 @@ tools::Rectangle SdrTextObj::ImpDragCalcRect(const SdrDragStat& rDrag) const if (bTop) aTmpRect.SetTop(aPos.Y() ); if (bBtm) aTmpRect.SetBottom(aPos.Y() ); if (bOrtho) { // Ortho - long nWdt0=maRect.Right() -maRect.Left(); - long nHgt0=maRect.Bottom()-maRect.Top(); - long nXMul=aTmpRect.Right() -aTmpRect.Left(); - long nYMul=aTmpRect.Bottom()-aTmpRect.Top(); - long nXDiv=nWdt0; - long nYDiv=nHgt0; + tools::Long nWdt0=maRect.Right() -maRect.Left(); + tools::Long nHgt0=maRect.Bottom()-maRect.Top(); + tools::Long nXMul=aTmpRect.Right() -aTmpRect.Left(); + tools::Long nYMul=aTmpRect.Bottom()-aTmpRect.Top(); + tools::Long nXDiv=nWdt0; + tools::Long nYDiv=nHgt0; bool bXNeg=(nXMul<0)!=(nXDiv<0); bool bYNeg=(nYMul<0)!=(nYDiv<0); nXMul=std::abs(nXMul); @@ -113,26 +113,26 @@ tools::Rectangle SdrTextObj::ImpDragCalcRect(const SdrDragStat& rDrag) const if (bEcke) { // corner point handles bool bUseX=(aXFactAdjustRight( -nXFree ); else if (eHAdj==SDRTEXTHORZADJUST_RIGHT) pViewMin->AdjustLeft(nXFree ); else { pViewMin->AdjustLeft(nXFree/2 ); pViewMin->SetRight(pViewMin->Left()+aPaperMin.Width() ); } - long nYFree=aAnkSiz.Height()-aPaperMin.Height(); + tools::Long nYFree=aAnkSiz.Height()-aPaperMin.Height(); if (eVAdj==SDRTEXTVERTADJUST_TOP) pViewMin->AdjustBottom( -nYFree ); else if (eVAdj==SDRTEXTVERTADJUST_BOTTOM) pViewMin->AdjustTop(nYFree ); else { pViewMin->AdjustTop(nYFree/2 ); pViewMin->SetBottom(pViewMin->Top()+aPaperMin.Height() ); } diff --git a/svx/source/svdraw/svdotxtr.cxx b/svx/source/svdraw/svdotxtr.cxx index 4478324b4d5c..14cfe824f67c 100644 --- a/svx/source/svdraw/svdotxtr.cxx +++ b/svx/source/svdraw/svdotxtr.cxx @@ -45,10 +45,10 @@ void SdrTextObj::NbcSetSnapRect(const tools::Rectangle& rRect) { // Either the rotation or shear angle exists. tools::Rectangle aSR0(GetSnapRect()); - long nWdt0=aSR0.Right()-aSR0.Left(); - long nHgt0=aSR0.Bottom()-aSR0.Top(); - long nWdt1=rRect.Right()-rRect.Left(); - long nHgt1=rRect.Bottom()-rRect.Top(); + tools::Long nWdt0=aSR0.Right()-aSR0.Left(); + tools::Long nHgt0=aSR0.Bottom()-aSR0.Top(); + tools::Long nWdt1=rRect.Right()-rRect.Left(); + tools::Long nHgt1=rRect.Bottom()-rRect.Top(); SdrTextObj::NbcResize(maSnapRect.TopLeft(),Fraction(nWdt1,nWdt0),Fraction(nHgt1,nHgt0)); SdrTextObj::NbcMove(Size(rRect.Left()-aSR0.Left(),rRect.Top()-aSR0.Top())); } @@ -81,12 +81,12 @@ void SdrTextObj::NbcSetLogicRect(const tools::Rectangle& rRect) SetRectsDirty(); } -long SdrTextObj::GetRotateAngle() const +tools::Long SdrTextObj::GetRotateAngle() const { return aGeo.nRotationAngle; } -long SdrTextObj::GetShearAngle(bool /*bVertical*/) const +tools::Long SdrTextObj::GetShearAngle(bool /*bVertical*/) const { return aGeo.nShearAngle; } @@ -155,7 +155,7 @@ void SdrTextObj::NbcResize(const Point& rRef, const Fraction& xFact, const Fract if (bRotate90) { bool bRota90=aGeo.nRotationAngle % 9000 ==0; if (!bRota90) { // there's seems to be a rounding error occurring: correct it - long a=NormAngle36000(aGeo.nRotationAngle); + tools::Long a=NormAngle36000(aGeo.nRotationAngle); if (a<4500) a=0; else if (a<13500) a=9000; else if (a<22500) a=18000; @@ -183,11 +183,11 @@ void SdrTextObj::NbcResize(const Point& rRef, const Fraction& xFact, const Fract SetRectsDirty(); } -void SdrTextObj::NbcRotate(const Point& rRef, long nAngle, double sn, double cs) +void SdrTextObj::NbcRotate(const Point& rRef, tools::Long nAngle, double sn, double cs) { SetGlueReallyAbsolute(true); - long dx=maRect.Right()-maRect.Left(); - long dy=maRect.Bottom()-maRect.Top(); + tools::Long dx=maRect.Right()-maRect.Left(); + tools::Long dy=maRect.Bottom()-maRect.Top(); Point aP(maRect.TopLeft()); RotatePoint(aP,rRef,sn,cs); maRect.SetLeft(aP.X() ); @@ -207,7 +207,7 @@ void SdrTextObj::NbcRotate(const Point& rRef, long nAngle, double sn, double cs) SetGlueReallyAbsolute(false); } -void SdrTextObj::NbcShear(const Point& rRef, long /*nAngle*/, double tn, bool bVShear) +void SdrTextObj::NbcShear(const Point& rRef, tools::Long /*nAngle*/, double tn, bool bVShear) { SetGlueReallyAbsolute(true); @@ -257,7 +257,7 @@ void SdrTextObj::NbcMirror(const Point& rRef1, const Point& rRef2) if (bRotate90) { bool bRota90=aGeo.nRotationAngle % 9000 ==0; if (bRotate90 && !bRota90) { // there's seems to be a rounding error occurring: correct it - long a=NormAngle36000(aGeo.nRotationAngle); + tools::Long a=NormAngle36000(aGeo.nRotationAngle); if (a<4500) a=0; else if (a<13500) a=9000; else if (a<22500) a=18000; diff --git a/svx/source/svdraw/svdovirt.cxx b/svx/source/svdraw/svdovirt.cxx index 1fc49087a839..eba2814f6c28 100644 --- a/svx/source/svdraw/svdovirt.cxx +++ b/svx/source/svdraw/svdovirt.cxx @@ -305,7 +305,7 @@ void SdrVirtObj::NbcResize(const Point& rRef, const Fraction& xFact, const Fract SetRectsDirty(); } -void SdrVirtObj::NbcRotate(const Point& rRef, long nAngle, double sn, double cs) +void SdrVirtObj::NbcRotate(const Point& rRef, tools::Long nAngle, double sn, double cs) { rRefObj.NbcRotate(rRef-aAnchor,nAngle,sn,cs); SetRectsDirty(); @@ -317,7 +317,7 @@ void SdrVirtObj::NbcMirror(const Point& rRef1, const Point& rRef2) SetRectsDirty(); } -void SdrVirtObj::NbcShear(const Point& rRef, long nAngle, double tn, bool bVShear) +void SdrVirtObj::NbcShear(const Point& rRef, tools::Long nAngle, double tn, bool bVShear) { rRefObj.NbcShear(rRef-aAnchor,nAngle,tn,bVShear); SetRectsDirty(); @@ -345,7 +345,7 @@ void SdrVirtObj::Resize(const Point& rRef, const Fraction& xFact, const Fraction } } -void SdrVirtObj::Rotate(const Point& rRef, long nAngle, double sn, double cs) +void SdrVirtObj::Rotate(const Point& rRef, tools::Long nAngle, double sn, double cs) { if (nAngle!=0) { tools::Rectangle aBoundRect0; if (pUserCall!=nullptr) aBoundRect0=GetLastBoundRect(); @@ -363,7 +363,7 @@ void SdrVirtObj::Mirror(const Point& rRef1, const Point& rRef2) SendUserCall(SdrUserCallType::Resize,aBoundRect0); } -void SdrVirtObj::Shear(const Point& rRef, long nAngle, double tn, bool bVShear) +void SdrVirtObj::Shear(const Point& rRef, tools::Long nAngle, double tn, bool bVShear) { if (nAngle!=0) { tools::Rectangle aBoundRect0; if (pUserCall!=nullptr) aBoundRect0=GetLastBoundRect(); @@ -432,12 +432,12 @@ void SdrVirtObj::NbcSetLogicRect(const tools::Rectangle& rRect) } -long SdrVirtObj::GetRotateAngle() const +tools::Long SdrVirtObj::GetRotateAngle() const { return rRefObj.GetRotateAngle(); } -long SdrVirtObj::GetShearAngle(bool bVertical) const +tools::Long SdrVirtObj::GetShearAngle(bool bVertical) const { return rRefObj.GetShearAngle(bVertical); } diff --git a/svx/source/svdraw/svdpagv.cxx b/svx/source/svdraw/svdpagv.cxx index ad38d0ad3395..0db7711890e0 100644 --- a/svx/source/svdraw/svdpagv.cxx +++ b/svx/source/svdraw/svdpagv.cxx @@ -351,10 +351,10 @@ void SdrPageView::DrawPageViewGrid(OutputDevice& rOut, const tools::Rectangle& r if (GetPage()==nullptr) return; - long nx1=GetView().maGridBig.Width(); - long nx2=GetView().maGridFin.Width(); - long ny1=GetView().maGridBig.Height(); - long ny2=GetView().maGridFin.Height(); + tools::Long nx1=GetView().maGridBig.Width(); + tools::Long nx2=GetView().maGridFin.Width(); + tools::Long ny1=GetView().maGridBig.Height(); + tools::Long ny2=GetView().maGridFin.Height(); if (nx1==0) nx1=nx2; if (nx2==0) nx2=nx1; @@ -371,10 +371,10 @@ void SdrPageView::DrawPageViewGrid(OutputDevice& rOut, const tools::Rectangle& r return; // no more global output size, use window size instead to decide grid sizes - long nScreenWdt = rOut.GetOutputSizePixel().Width(); + tools::Long nScreenWdt = rOut.GetOutputSizePixel().Width(); - long nMinDotPix=2; - long nMinLinPix=4; + tools::Long nMinDotPix=2; + tools::Long nMinLinPix=4; if (nScreenWdt>=1600) { @@ -398,10 +398,10 @@ void SdrPageView::DrawPageViewGrid(OutputDevice& rOut, const tools::Rectangle& r // enlarge line offset (minimum 4 pixels) // enlarge by: *2 *5 *10 *20 *50 *100 ... int nTgl=0; - long nVal0=nx1; + tools::Long nVal0=nx1; while (nx1 nx1*=2.5 @@ -414,7 +414,7 @@ void SdrPageView::DrawPageViewGrid(OutputDevice& rOut, const tools::Rectangle& r nVal0=ny1; while (ny1 ny1*=2.5 @@ -436,13 +436,13 @@ void SdrPageView::DrawPageViewGrid(OutputDevice& rOut, const tools::Rectangle& r bool bMap0=rOut.IsMapModeEnabled(); - long nWrX=0; - long nWrY=0; + tools::Long nWrX=0; + tools::Long nWrY=0; Point aOrg(aPgOrg); - long x1=GetPage()->GetLeftBorder()+1+nWrX; - long x2=GetPage()->GetWidth()-GetPage()->GetRightBorder()-1+nWrY; - long y1=GetPage()->GetUpperBorder()+1+nWrX; - long y2=GetPage()->GetHeight()-GetPage()->GetLowerBorder()-1+nWrY; + tools::Long x1=GetPage()->GetLeftBorder()+1+nWrX; + tools::Long x2=GetPage()->GetWidth()-GetPage()->GetRightBorder()-1+nWrY; + tools::Long y1=GetPage()->GetUpperBorder()+1+nWrX; + tools::Long y2=GetPage()->GetHeight()-GetPage()->GetLowerBorder()-1+nWrY; const SdrPageGridFrameList* pFrames=GetPage()->GetGridFrameList(this,nullptr); sal_uInt16 nGridPaintCnt=1; @@ -461,25 +461,25 @@ void SdrPageView::DrawPageViewGrid(OutputDevice& rOut, const tools::Rectangle& r } if (!rRect.IsEmpty()) { Size a1PixSiz(rOut.PixelToLogic(Size(1,1))); - long nX1Pix=a1PixSiz.Width(); // add 1 pixel of tolerance - long nY1Pix=a1PixSiz.Height(); + tools::Long nX1Pix=a1PixSiz.Width(); // add 1 pixel of tolerance + tools::Long nY1Pix=a1PixSiz.Height(); if (x1rRect.Right() +nX1Pix) x2=rRect.Right() +nX1Pix; if (y1rRect.Bottom()+nY1Pix) y2=rRect.Bottom()+nY1Pix; } - long xBigOrg=aOrg.X()+nWrX; + tools::Long xBigOrg=aOrg.X()+nWrX; while (xBigOrg>=x1) xBigOrg-=nx1; while (xBigOrg=x1) xFinOrg-=nx2; while (xFinOrg=y1) yBigOrg-=ny1; while (yBigOrg=y1) yFinOrg-=ny2; while (yFinOrgrRect.Left()) dx=rRect.Left()-l; else if (rrRect.Top()) dy=rRect.Top()-o; diff --git a/svx/source/svdraw/svdpoev.cxx b/svx/source/svdraw/svdpoev.cxx index 79d70de48187..b5329fbd17fc 100644 --- a/svx/source/svdraw/svdpoev.cxx +++ b/svx/source/svdraw/svdpoev.cxx @@ -637,7 +637,7 @@ static void ImpRotate(Point& rPt, Point* pC1, Point* pC2, const void* p1, const if (pC2!=nullptr) RotatePoint(*pC2,*static_cast(p1),*static_cast(p3),*static_cast(p4)); } -void SdrPolyEditView::RotateMarkedPoints(const Point& rRef, long nAngle) +void SdrPolyEditView::RotateMarkedPoints(const Point& rRef, tools::Long nAngle) { ForceUndirtyMrkPnt(); OUString aStr(SvxResId(STR_EditResize)); diff --git a/svx/source/svdraw/svdsnpv.cxx b/svx/source/svdraw/svdsnpv.cxx index 2bb9527b63b4..b827ab6ae439 100644 --- a/svx/source/svdraw/svdsnpv.cxx +++ b/svx/source/svdraw/svdsnpv.cxx @@ -262,18 +262,18 @@ Point SdrSnapView::GetSnapPos(const Point& rPnt, const SdrPageView* pPV) const SdrSnap SdrSnapView::SnapPos(Point& rPnt, const SdrPageView* pPV) const { if (!bSnapEnab) return SdrSnap::NOTSNAPPED; - long x=rPnt.X(); - long y=rPnt.Y(); + tools::Long x=rPnt.X(); + tools::Long y=rPnt.Y(); if (pPV==nullptr) { pPV=GetSdrPageView(); if (pPV==nullptr) return SdrSnap::NOTSNAPPED; } - long dx=NOT_SNAPPED; - long dy=NOT_SNAPPED; - long dx1,dy1; - long mx=aMagnSiz.Width(); - long my=aMagnSiz.Height(); + tools::Long dx=NOT_SNAPPED; + tools::Long dy=NOT_SNAPPED; + tools::Long dx1,dy1; + tools::Long mx=aMagnSiz.Width(); + tools::Long my=aMagnSiz.Height(); if (mbHlplVisible && bHlplSnap && !IsDragHelpLine()) { const SdrHelpLineList& rHLL=pPV->GetHelpLines(); @@ -284,16 +284,16 @@ SdrSnap SdrSnapView::SnapPos(Point& rPnt, const SdrPageView* pPV) const const Point& rPos=rHL.GetPos(); switch (rHL.GetKind()) { case SdrHelpLineKind::Vertical: { - long a=x-rPos.X(); + tools::Long a=x-rPos.X(); if (std::abs(a)<=mx) { dx1=-a; if (std::abs(dx1)GetPage(); - long xs=pPage->GetWidth(); - long ys=pPage->GetHeight(); - long lft=pPage->GetLeftBorder(); - long rgt=pPage->GetRightBorder(); - long upp=pPage->GetUpperBorder(); - long lwr=pPage->GetLowerBorder(); - long a; + tools::Long xs=pPage->GetWidth(); + tools::Long ys=pPage->GetHeight(); + tools::Long lft=pPage->GetLeftBorder(); + tools::Long rgt=pPage->GetRightBorder(); + tools::Long upp=pPage->GetUpperBorder(); + tools::Long lwr=pPage->GetLowerBorder(); + tools::Long a; a=x- lft ; if (std::abs(a)<=mx) { dx1=-a; if (std::abs(dx1)((fx - static_cast(pPV->GetPageOrigin().X())) / fSnapWidth); - x = static_cast(static_cast(x) * fSnapWidth + static_cast(pPV->GetPageOrigin().X())); + x = static_cast((fx - static_cast(pPV->GetPageOrigin().X())) / fSnapWidth); + x = static_cast(static_cast(x) * fSnapWidth + static_cast(pPV->GetPageOrigin().X())); dx = 0; } fSnapWidth = double(aSnapWdtY); @@ -396,8 +396,8 @@ SdrSnap SdrSnapView::SnapPos(Point& rPnt, const SdrPageView* pPV) const else fy -= fSnapWidth / 2.0; - y = static_cast((fy - static_cast(pPV->GetPageOrigin().Y())) / fSnapWidth); - y = static_cast(static_cast(y) * fSnapWidth + static_cast(pPV->GetPageOrigin().Y())); + y = static_cast((fy - static_cast(pPV->GetPageOrigin().Y())) / fSnapWidth); + y = static_cast(static_cast(y) * fSnapWidth + static_cast(pPV->GetPageOrigin().Y())); dy = 0; } } @@ -409,7 +409,7 @@ SdrSnap SdrSnapView::SnapPos(Point& rPnt, const SdrPageView* pPV) const return bRet; } -void SdrSnapView::CheckSnap(const Point& rPt, long& nBestXSnap, long& nBestYSnap, bool& bXSnapped, bool& bYSnapped) const +void SdrSnapView::CheckSnap(const Point& rPt, tools::Long& nBestXSnap, tools::Long& nBestYSnap, bool& bXSnapped, bool& bYSnapped) const { Point aPt(rPt); SdrSnap nRet=SnapPos(aPt,nullptr); diff --git a/svx/source/svdraw/svdtrans.cxx b/svx/source/svdraw/svdtrans.cxx index b47fda17bf4f..f225e3d5d6b6 100644 --- a/svx/source/svdraw/svdtrans.cxx +++ b/svx/source/svdraw/svdtrans.cxx @@ -42,7 +42,7 @@ void ResizeRect(tools::Rectangle& rRect, const Point& rRef, const Fraction& rxFa if (!aXFact.IsValid()) { SAL_WARN( "svx.svdraw", "invalid fraction xFract, using Fraction(1,1)" ); aXFact = Fraction(1,1); - long nWdt = rRect.Right() - rRect.Left(); + tools::Long nWdt = rRect.Right() - rRect.Left(); if (nWdt == 0) rRect.AdjustRight( 1 ); } rRect.SetLeft( rRef.X() + FRound( (rRect.Left() - rRef.X()) * double(aXFact) ) ); @@ -51,7 +51,7 @@ void ResizeRect(tools::Rectangle& rRect, const Point& rRef, const Fraction& rxFa if (!aYFact.IsValid()) { SAL_WARN( "svx.svdraw", "invalid fraction yFract, using Fraction(1,1)" ); aYFact = Fraction(1,1); - long nHgt = rRect.Bottom() - rRect.Top(); + tools::Long nHgt = rRect.Bottom() - rRect.Top(); if (nHgt == 0) rRect.AdjustBottom( 1 ); } rRect.SetTop( rRef.Y() + FRound( (rRect.Top() - rRef.Y()) * double(aYFact) ) ); @@ -103,30 +103,30 @@ void RotateXPoly(XPolyPolygon& rPoly, const Point& rRef, double sn, double cs) void MirrorPoint(Point& rPnt, const Point& rRef1, const Point& rRef2) { - long mx=rRef2.X()-rRef1.X(); - long my=rRef2.Y()-rRef1.Y(); + tools::Long mx=rRef2.X()-rRef1.X(); + tools::Long my=rRef2.Y()-rRef1.Y(); if (mx==0) { // vertical axis - long dx=rRef1.X()-rPnt.X(); + tools::Long dx=rRef1.X()-rPnt.X(); rPnt.AdjustX(2*dx ); } else if (my==0) { // horizontal axis - long dy=rRef1.Y()-rPnt.Y(); + tools::Long dy=rRef1.Y()-rPnt.Y(); rPnt.AdjustY(2*dy ); } else if (mx==my) { // diagonal axis '\' - long dx1=rPnt.X()-rRef1.X(); - long dy1=rPnt.Y()-rRef1.Y(); + tools::Long dx1=rPnt.X()-rRef1.X(); + tools::Long dy1=rPnt.Y()-rRef1.Y(); rPnt.setX(rRef1.X()+dy1 ); rPnt.setY(rRef1.Y()+dx1 ); } else if (mx==-my) { // diagonal axis '/' - long dx1=rPnt.X()-rRef1.X(); - long dy1=rPnt.Y()-rRef1.Y(); + tools::Long dx1=rPnt.X()-rRef1.X(); + tools::Long dy1=rPnt.Y()-rRef1.Y(); rPnt.setX(rRef1.X()-dy1 ); rPnt.setY(rRef1.Y()-dx1 ); } else { // arbitrary axis // TODO: Optimize this! Raise perpendicular on the mirroring axis..? - long nRefWink=GetAngle(rRef2-rRef1); + tools::Long nRefWink=GetAngle(rRef2-rRef1); rPnt-=rRef1; - long nPntWink=GetAngle(rPnt); - long nAngle=2*(nRefWink-nPntWink); + tools::Long nPntWink=GetAngle(rPnt); + tools::Long nAngle=2*(nRefWink-nPntWink); double a = nAngle * F_PI18000; double nSin=sin(a); double nCos=cos(a); @@ -164,10 +164,10 @@ double CrookRotateXPoint(Point& rPnt, Point* pC1, Point* pC2, const Point& rCent { bool bC1=pC1!=nullptr; bool bC2=pC2!=nullptr; - long x0=rPnt.X(); - long y0=rPnt.Y(); - long cx=rCenter.X(); - long cy=rCenter.Y(); + tools::Long x0=rPnt.X(); + tools::Long y0=rPnt.Y(); + tools::Long cx=rCenter.X(); + tools::Long cy=rCenter.Y(); double nAngle=GetCrookAngle(rPnt,rCenter,rRad,bVert); double sn=sin(nAngle); double cs=cos(nAngle); @@ -183,7 +183,7 @@ double CrookRotateXPoint(Point& rPnt, Point* pC1, Point* pC2, const Point& rCent // move into the direction of the center, as a basic position for the rotation pC1->AdjustX( -x0 ); // resize, account for the distance from the center - long nPntRad=cy-pC1->Y(); + tools::Long nPntRad=cy-pC1->Y(); double nFact=static_cast(nPntRad)/static_cast(rRad.Y()); pC1->setX(FRound(static_cast(pC1->X())*nFact) ); pC1->AdjustX(cx ); @@ -201,7 +201,7 @@ double CrookRotateXPoint(Point& rPnt, Point* pC1, Point* pC2, const Point& rCent // move into the direction of the center, as a basic position for the rotation pC2->AdjustX( -x0 ); // resize, account for the distance from the center - long nPntRad=rCenter.Y()-pC2->Y(); + tools::Long nPntRad=rCenter.Y()-pC2->Y(); double nFact=static_cast(nPntRad)/static_cast(rRad.Y()); pC2->setX(FRound(static_cast(pC2->X())*nFact) ); pC2->AdjustX(cx ); @@ -218,13 +218,13 @@ double CrookSlantXPoint(Point& rPnt, Point* pC1, Point* pC2, const Point& rCente { bool bC1=pC1!=nullptr; bool bC2=pC2!=nullptr; - long x0=rPnt.X(); - long y0=rPnt.Y(); - long dx1=0,dy1=0; - long dxC1=0,dyC1=0; - long dxC2=0,dyC2=0; + tools::Long x0=rPnt.X(); + tools::Long y0=rPnt.Y(); + tools::Long dx1=0,dy1=0; + tools::Long dxC1=0,dyC1=0; + tools::Long dxC2=0,dyC2=0; if (bVert) { - long nStart=rCenter.X()-rRad.X(); + tools::Long nStart=rCenter.X()-rRad.X(); dx1=rPnt.X()-nStart; rPnt.setX(nStart ); if (bC1) { @@ -236,7 +236,7 @@ double CrookSlantXPoint(Point& rPnt, Point* pC1, Point* pC2, const Point& rCente pC2->setX(nStart ); } } else { - long nStart=rCenter.Y()-rRad.Y(); + tools::Long nStart=rCenter.Y()-rRad.Y(); dy1=rPnt.Y()-nStart; rPnt.setY(nStart ); if (bC1) { @@ -272,14 +272,14 @@ double CrookStretchXPoint(Point& rPnt, Point* pC1, Point* pC2, const Point& rCen const Point& rRad, double& rSin, double& rCos, bool bVert, const tools::Rectangle& rRefRect) { - long y0=rPnt.Y(); + tools::Long y0=rPnt.Y(); CrookSlantXPoint(rPnt,pC1,pC2,rCenter,rRad,rSin,rCos,bVert); if (bVert) { } else { - long nTop=rRefRect.Top(); - long nBtm=rRefRect.Bottom(); - long nHgt=nBtm-nTop; - long dy=rPnt.Y()-y0; + tools::Long nTop=rRefRect.Top(); + tools::Long nBtm=rRefRect.Bottom(); + tools::Long nHgt=nBtm-nTop; + tools::Long dy=rPnt.Y()-y0; double a=static_cast(y0-nTop)/nHgt; a*=dy; rPnt.setY(y0+FRound(a) ); @@ -383,9 +383,9 @@ void CrookStretchPoly(XPolyPolygon& rPoly, const Point& rCenter, const Point& rR } -long GetAngle(const Point& rPnt) +tools::Long GetAngle(const Point& rPnt) { - long a=0; + tools::Long a=0; if (rPnt.Y()==0) { if (rPnt.X()<0) a=-18000; } else if (rPnt.X()==0) { @@ -398,21 +398,21 @@ long GetAngle(const Point& rPnt) return a; } -long NormAngle18000(long a) +tools::Long NormAngle18000(tools::Long a) { while (a<-18000) a+=36000; while (a>=18000) a-=36000; return a; } -long NormAngle36000(long a) +tools::Long NormAngle36000(tools::Long a) { while (a<0) a+=36000; while (a>=36000) a-=36000; return a; } -sal_uInt16 GetAngleSector(long nAngle) +sal_uInt16 GetAngleSector(tools::Long nAngle) { while (nAngle<0) nAngle+=36000; while (nAngle>=36000) nAngle-=36000; @@ -422,10 +422,10 @@ sal_uInt16 GetAngleSector(long nAngle) return 3; } -long GetLen(const Point& rPnt) +tools::Long GetLen(const Point& rPnt) { - long x=std::abs(rPnt.X()); - long y=std::abs(rPnt.Y()); + tools::Long x=std::abs(rPnt.X()); + tools::Long y=std::abs(rPnt.Y()); if (x+y<0x8000) { // because 7FFF * 7FFF * 2 = 7FFE0002 x*=x; y*=y; @@ -493,15 +493,15 @@ void Poly2Rect(const tools::Polygon& rPol, tools::Rectangle& rRect, GeoStat& rGe Point aPt1(rPol[1]-rPol[0]); if (rGeo.nRotationAngle!=0) RotatePoint(aPt1,Point(0,0),-rGeo.nSin,rGeo.nCos); // -Sin to reverse rotation - long nWdt=aPt1.X(); + tools::Long nWdt=aPt1.X(); Point aPt0(rPol[0]); Point aPt3(rPol[3]-rPol[0]); if (rGeo.nRotationAngle!=0) RotatePoint(aPt3,Point(0,0),-rGeo.nSin,rGeo.nCos); // -Sin to reverse rotation - long nHgt=aPt3.Y(); + tools::Long nHgt=aPt3.Y(); - long nShW=GetAngle(aPt3); + tools::Long nShW=GetAngle(aPt3); nShW-=27000; // ShearWink is measured against a vertical line nShW=-nShW; // negating, because '+' is shearing clock-wise @@ -528,10 +528,10 @@ void Poly2Rect(const tools::Polygon& rPol, tools::Rectangle& rRect, GeoStat& rGe void OrthoDistance8(const Point& rPt0, Point& rPt, bool bBigOrtho) { - long dx=rPt.X()-rPt0.X(); - long dy=rPt.Y()-rPt0.Y(); - long dxa=std::abs(dx); - long dya=std::abs(dy); + tools::Long dx=rPt.X()-rPt0.X(); + tools::Long dy=rPt.Y()-rPt0.Y(); + tools::Long dxa=std::abs(dx); + tools::Long dya=std::abs(dy); if (dx==0 || dy==0 || dxa==dya) return; if (dxa>=dya*2) { rPt.setY(rPt0.Y() ); return; } if (dya>=dxa*2) { rPt.setX(rPt0.X() ); return; } @@ -544,10 +544,10 @@ void OrthoDistance8(const Point& rPt0, Point& rPt, bool bBigOrtho) void OrthoDistance4(const Point& rPt0, Point& rPt, bool bBigOrtho) { - long dx=rPt.X()-rPt0.X(); - long dy=rPt.Y()-rPt0.Y(); - long dxa=std::abs(dx); - long dya=std::abs(dy); + tools::Long dx=rPt.X()-rPt0.X(); + tools::Long dy=rPt.Y()-rPt0.Y(); + tools::Long dxa=std::abs(dx); + tools::Long dya=std::abs(dy); if ((dxa=0 ? 1 : -1) ) ); } else { @@ -556,7 +556,7 @@ void OrthoDistance4(const Point& rPt0, Point& rPt, bool bBigOrtho) } -long BigMulDiv(long nVal, long nMul, long nDiv) +tools::Long BigMulDiv(tools::Long nVal, tools::Long nMul, tools::Long nDiv) { BigInt aVal(nVal); aVal*=nMul; @@ -568,7 +568,7 @@ long BigMulDiv(long nVal, long nMul, long nDiv) if(nDiv) { aVal/=nDiv; - return long(aVal); + return tools::Long(aVal); } return 0x7fffffff; } @@ -664,7 +664,7 @@ FrPair GetMapFactor(FieldUnit eS, FieldUnit eD) // 1 yd = 3 ft = 36" = 914,4mm // 1 ft = 12 " = 1" = 304,8mm -static void GetMeterOrInch(MapUnit eMU, short& rnComma, long& rnMul, long& rnDiv, bool& rbMetr, bool& rbInch) +static void GetMeterOrInch(MapUnit eMU, short& rnComma, tools::Long& rnMul, tools::Long& rnDiv, bool& rbMetr, bool& rbInch) { rnMul=1; rnDiv=1; short nComma=0; @@ -698,7 +698,7 @@ static void GetMeterOrInch(MapUnit eMU, short& rnComma, long& rnMul, long& rnDiv void SdrFormatter::Undirty() { bool bSrcMetr,bSrcInch,bDstMetr,bDstInch; - long nMul1,nDiv1,nMul2,nDiv2; + tools::Long nMul1,nDiv1,nMul2,nDiv2; short nComma1,nComma2; // first: normalize to m or in GetMeterOrInch(eSrcMU,nComma1,nMul1,nDiv1,bSrcMetr,bSrcInch); @@ -728,7 +728,7 @@ void SdrFormatter::Undirty() } -OUString SdrFormatter::GetStr(long nVal) const +OUString SdrFormatter::GetStr(tools::Long nVal) const { const OUString aNullCode("0"); diff --git a/svx/source/svdraw/svdview.cxx b/svx/source/svdraw/svdview.cxx index 2cf43d6669e8..f266478927b8 100644 --- a/svx/source/svdraw/svdview.cxx +++ b/svx/source/svdraw/svdview.cxx @@ -888,7 +888,7 @@ bool SdrView::DoMouseEvent(const SdrViewEvent& rVEvt) case SdrEventKind::BeginDragObj: bRet=BegDragObj(aLogicPos,nullptr,rVEvt.pHdl,mnMinMovLog); break; case SdrEventKind::BeginCreateObj: { if (nCurrentInvent==SdrInventor::Default && nCurrentIdent==OBJ_CAPTION) { - long nHgt=SdrEngineDefaults::GetFontHeight(); + tools::Long nHgt=SdrEngineDefaults::GetFontHeight(); bRet=BegCreateCaptionObj(aLogicPos,Size(5*nHgt,2*nHgt)); } else bRet=BegCreateObj(aLogicPos); } break; @@ -1214,7 +1214,7 @@ OUString SdrView::GetStatusText() else if (IsTextEdit() && pTextEditOutlinerView!=nullptr) { aStr=SvxResId(STR_ViewTextEdit); // "TextEdit - Row y, Column x"; ESelection aSel(pTextEditOutlinerView->GetSelection()); - long nPar=aSel.nEndPara,nLin=0,nCol=aSel.nEndPos; + tools::Long nPar=aSel.nEndPara,nLin=0,nCol=aSel.nEndPos; if (aSel.nEndPara>0) { for (sal_Int32 nParaNum=0; nParaNumGetLineCount(nParaNum); diff --git a/svx/source/svdraw/svdxcgv.cxx b/svx/source/svdraw/svdxcgv.cxx index e8c8a3218a89..21d0451e7f3c 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(); - long xs=nSizX; - long ys=nSizY; + tools::Long xs=nSizX; + tools::Long ys=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); -- cgit v1.2.3