diff options
author | David Tardon <dtardon@redhat.com> | 2014-10-16 15:30:32 +0200 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2014-10-16 17:44:44 +0200 |
commit | 582ef22d3e8e30ffd58f092d37ffda30bd07bd9e (patch) | |
tree | 80c42b34da7e7ee05843b572f7311b3c230de9dd /svx/source/svdraw | |
parent | ada4862afc3227b04c12960ded761db24f61257e (diff) |
fdo#84854 it seems long is not enough on 32 bit
Fraction used BigInt internally for computations, rational does nothing
like that.
Change-Id: I3e9b25074f979bc291208f7c6362c3c40eb77ff5
Diffstat (limited to 'svx/source/svdraw')
34 files changed, 153 insertions, 153 deletions
diff --git a/svx/source/svdraw/svdattr.cxx b/svx/source/svdraw/svdattr.cxx index 216107aa9930..2a5a4c521545 100644 --- a/svx/source/svdraw/svdattr.cxx +++ b/svx/source/svdraw/svdattr.cxx @@ -630,7 +630,7 @@ SdrFractionItem::SdrFractionItem(sal_uInt16 nId, SvStream& rIn): sal_Int32 nMul,nDiv; rIn.ReadInt32( nMul ); rIn.ReadInt32( nDiv ); - nValue=boost::rational<long>(nMul,nDiv); + nValue=boost::rational<sal_Int64>(nMul,nDiv); } bool SdrFractionItem::operator==(const SfxPoolItem& rCmp) const diff --git a/svx/source/svdraw/svddrag.cxx b/svx/source/svdraw/svddrag.cxx index fda560eb2a43..b26b5c8eb7e1 100644 --- a/svx/source/svdraw/svddrag.cxx +++ b/svx/source/svdraw/svddrag.cxx @@ -106,22 +106,22 @@ bool SdrDragStat::CheckMinMoved(const Point& rPnt) return bMinMoved; } -boost::rational<long> SdrDragStat::GetXFact() const +boost::rational<sal_Int64> SdrDragStat::GetXFact() const { long nMul=GetNow().X()-aRef1.X(); long nDiv=GetPrev().X()-aRef1.X(); if (nDiv==0) nDiv=1; if (bHorFixed) { nMul=1; nDiv=1; } - return boost::rational<long>(nMul,nDiv); + return boost::rational<sal_Int64>(nMul,nDiv); } -boost::rational<long> SdrDragStat::GetYFact() const +boost::rational<sal_Int64> SdrDragStat::GetYFact() const { long nMul=GetNow().Y()-aRef1.Y(); long nDiv=GetPrev().Y()-aRef1.Y(); if (nDiv==0) nDiv=1; if (bVerFixed) { nMul=1; nDiv=1; } - return boost::rational<long>(nMul,nDiv); + return boost::rational<sal_Int64>(nMul,nDiv); } void SdrDragStat::TakeCreateRect(Rectangle& rRect) const diff --git a/svx/source/svdraw/svddrgm1.hxx b/svx/source/svdraw/svddrgm1.hxx index 7b038800b5e2..53469b72cd33 100644 --- a/svx/source/svdraw/svddrgm1.hxx +++ b/svx/source/svdraw/svddrgm1.hxx @@ -74,7 +74,7 @@ public: class SdrDragShear : public SdrDragMethod { private: - boost::rational<long> aFact; + boost::rational<sal_Int64> aFact; long nWink0; long nWink; double nTan; @@ -151,7 +151,7 @@ private: Point aMarkCenter; Point aCenter; Point aStart; - boost::rational<long> aFact; + boost::rational<sal_Int64> aFact; Point aRad; bool bContortionAllowed; bool bNoContortionAllowed; diff --git a/svx/source/svdraw/svddrgmt.cxx b/svx/source/svdraw/svddrgmt.cxx index 687ed7d73c58..b2d5ccfba657 100644 --- a/svx/source/svdraw/svddrgmt.cxx +++ b/svx/source/svdraw/svddrgmt.cxx @@ -1779,7 +1779,7 @@ SdrDragResize::SdrDragResize(SdrDragView& rNewView) void SdrDragResize::TakeSdrDragComment(OUString& rStr) const { ImpTakeDescriptionStr(STR_DragMethResize, rStr); - boost::rational<long> aFact1(1,1); + boost::rational<sal_Int64> aFact1(1,1); Point aStart(DragStat().GetStart()); Point aRef(DragStat().GetRef1()); sal_Int32 nXDiv(aStart.X() - aRef.X()); @@ -1889,7 +1889,7 @@ void SdrDragResize::MoveSdrDrag(const Point& rNoSnapPnt) Point aPnt(GetSnapPos(rNoSnapPnt)); Point aStart(DragStat().GetStart()); Point aRef(DragStat().GetRef1()); - boost::rational<long> aMaxFact(0x7FFFFFFF,1); + boost::rational<sal_Int64> aMaxFact(0x7FFFFFFF,1); Rectangle aLR(getSdrDragView().GetWorkArea()); bool bWorkArea=!aLR.IsEmpty(); bool bDragLimit=IsDragLimit(); @@ -1920,7 +1920,7 @@ void SdrDragResize::MoveSdrDrag(const Point& rNoSnapPnt) if (aRef.X()>aSR.Left()) { - boost::rational<long> aMax(aRef.X()-aLR.Left(),aRef.X()-aSR.Left()); + boost::rational<sal_Int64> aMax(aRef.X()-aLR.Left(),aRef.X()-aSR.Left()); if (aMax<aMaxFact) aMaxFact=aMax; @@ -1928,7 +1928,7 @@ void SdrDragResize::MoveSdrDrag(const Point& rNoSnapPnt) if (aRef.X()<aSR.Right()) { - boost::rational<long> aMax(aLR.Right()-aRef.X(),aSR.Right()-aRef.X()); + boost::rational<sal_Int64> aMax(aLR.Right()-aRef.X(),aSR.Right()-aRef.X()); if (aMax<aMaxFact) aMaxFact=aMax; @@ -1936,7 +1936,7 @@ void SdrDragResize::MoveSdrDrag(const Point& rNoSnapPnt) if (aRef.Y()>aSR.Top()) { - boost::rational<long> aMax(aRef.Y()-aLR.Top(),aRef.Y()-aSR.Top()); + boost::rational<sal_Int64> aMax(aRef.Y()-aLR.Top(),aRef.Y()-aSR.Top()); if (aMax<aMaxFact) aMaxFact=aMax; @@ -1944,7 +1944,7 @@ void SdrDragResize::MoveSdrDrag(const Point& rNoSnapPnt) if (aRef.Y()<aSR.Bottom()) { - boost::rational<long> aMax(aLR.Bottom()-aRef.Y(),aSR.Bottom()-aRef.Y()); + boost::rational<sal_Int64> aMax(aLR.Bottom()-aRef.Y(),aSR.Bottom()-aRef.Y()); if (aMax<aMaxFact) aMaxFact=aMax; @@ -1979,7 +1979,7 @@ void SdrDragResize::MoveSdrDrag(const Point& rNoSnapPnt) if (bOrtho) { - if ((boost::rational<long>(nXMul,nXDiv)>boost::rational<long>(nYMul,nYDiv)) !=getSdrDragView().IsBigOrtho()) + if ((boost::rational<sal_Int64>(nXMul,nXDiv)>boost::rational<sal_Int64>(nYMul,nYDiv)) !=getSdrDragView().IsBigOrtho()) { nXMul=nYMul; nXDiv=nYDiv; @@ -2027,8 +2027,8 @@ void SdrDragResize::MoveSdrDrag(const Point& rNoSnapPnt) } } - boost::rational<long> aNeuXFact(nXMul,nXDiv); - boost::rational<long> aNeuYFact(nYMul,nYDiv); + boost::rational<sal_Int64> aNeuXFact(nXMul,nXDiv); + boost::rational<sal_Int64> aNeuYFact(nYMul,nYDiv); if (bOrtho) { @@ -2046,10 +2046,10 @@ void SdrDragResize::MoveSdrDrag(const Point& rNoSnapPnt) } if (bXNeg) - aNeuXFact=boost::rational<long>(-aNeuXFact.numerator(),aNeuXFact.denominator()); + aNeuXFact=boost::rational<sal_Int64>(-aNeuXFact.numerator(),aNeuXFact.denominator()); if (bYNeg) - aNeuYFact=boost::rational<long>(-aNeuYFact.numerator(),aNeuYFact.denominator()); + aNeuYFact=boost::rational<sal_Int64>(-aNeuYFact.numerator(),aNeuYFact.denominator()); if (DragStat().CheckMinMoved(aPnt)) { @@ -2344,7 +2344,7 @@ void SdrDragShear::MoveSdrDrag(const Point& rPnt) Point aP0(DragStat().GetStart()); Point aPnt(rPnt); - boost::rational<long> aNeuFact(1,1); + boost::rational<sal_Int64> aNeuFact(1,1); // if angle snapping not activated, snap to raster (except when using slant) if (nSA==0 && !bSlant) @@ -2389,11 +2389,11 @@ void SdrDragShear::MoveSdrDrag(const Point& rPnt) if (bVertical) { - aNeuFact=boost::rational<long>(aPt2.X()-aRef.X(),aP0.X()-aRef.X()); + aNeuFact=boost::rational<sal_Int64>(aPt2.X()-aRef.X(),aP0.X()-aRef.X()); } else { - aNeuFact=boost::rational<long>(aPt2.Y()-aRef.Y(),aP0.Y()-aRef.Y()); + aNeuFact=boost::rational<sal_Int64>(aPt2.Y()-aRef.Y(),aP0.Y()-aRef.Y()); } } } @@ -2451,11 +2451,11 @@ void SdrDragShear::applyCurrentTransformationToSdrObject(SdrObject& rTarget) { if (bVertical) { - rTarget.Resize(DragStat().GetRef1(),aFact,boost::rational<long>(1,1)); + rTarget.Resize(DragStat().GetRef1(),aFact,boost::rational<sal_Int64>(1,1)); } else { - rTarget.Resize(DragStat().GetRef1(),boost::rational<long>(1,1),aFact); + rTarget.Resize(DragStat().GetRef1(),boost::rational<sal_Int64>(1,1),aFact); } } @@ -2469,7 +2469,7 @@ bool SdrDragShear::EndSdrDrag(bool bCopy) { Hide(); - if (bResize && aFact==boost::rational<long>(1,1)) + if (bResize && aFact==boost::rational<sal_Int64>(1,1)) bResize=false; if (nWink!=0 || bResize) @@ -2489,11 +2489,11 @@ bool SdrDragShear::EndSdrDrag(bool bCopy) { if (bVertical) { - getSdrDragView().ResizeMarkedObj(DragStat().GetRef1(),aFact,boost::rational<long>(1,1),bCopy); + getSdrDragView().ResizeMarkedObj(DragStat().GetRef1(),aFact,boost::rational<sal_Int64>(1,1),bCopy); } else { - getSdrDragView().ResizeMarkedObj(DragStat().GetRef1(),boost::rational<long>(1,1),aFact,bCopy); + getSdrDragView().ResizeMarkedObj(DragStat().GetRef1(),boost::rational<sal_Int64>(1,1),aFact,bCopy); } bCopy=false; @@ -3016,7 +3016,7 @@ void SdrDragCrook::_MovAllPoints(basegfx::B2DPolyPolygon& rTarget) if (bResize) { - boost::rational<long> aFact1(1,1); + boost::rational<sal_Int64> aFact1(1,1); if (bVertical) { @@ -3108,7 +3108,7 @@ void SdrDragCrook::_MovCrookPoint(Point& rPnt, Point* pC1, Point* pC2) if (bResize) { - boost::rational<long> aFact1(1,1); + boost::rational<sal_Int64> aFact1(1,1); if (bVert) { @@ -3184,7 +3184,7 @@ void SdrDragCrook::MoveSdrDrag(const Point& rPnt) else bAtCenter=true; - boost::rational<long> aNeuFact(1,1); + boost::rational<sal_Int64> aNeuFact(1,1); long dx1=aPnt.X()-aNeuCenter.X(); long dy1=aPnt.Y()-aNeuCenter.Y(); bValid=bVertical ? dx1!=0 : dy1!=0; @@ -3254,7 +3254,7 @@ void SdrDragCrook::MoveSdrDrag(const Point& rPnt) if (bAtCenter) nMul*=2; - aNeuFact=boost::rational<long>(nMul,nMarkSize); + aNeuFact=boost::rational<sal_Int64>(nMul,nMarkSize); nWink=nPntWink; } else @@ -3287,7 +3287,7 @@ void SdrDragCrook::MoveSdrDrag(const Point& rPnt) nMul = std::abs(nMul); } - aNeuFact=boost::rational<long>(nMul,nDiv); + aNeuFact=boost::rational<sal_Int64>(nMul,nDiv); } if (aNeuCenter!=aCenter || bNeuContortion!=bContortion || aNeuFact!=aFact || @@ -3301,7 +3301,7 @@ void SdrDragCrook::MoveSdrDrag(const Point& rPnt) aCenter=aNeuCenter; aFact=aNeuFact; aRad=Point(nNeuRad,nNeuRad); - bResize=aFact!=boost::rational<long>(1,1); + bResize=aFact!=boost::rational<sal_Int64>(1,1); DragStat().NextMove(aPnt); Show(); } @@ -3310,14 +3310,14 @@ void SdrDragCrook::MoveSdrDrag(const Point& rPnt) void SdrDragCrook::applyCurrentTransformationToSdrObject(SdrObject& rTarget) { - const bool bDoResize(aFact!=boost::rational<long>(1,1)); + const bool bDoResize(aFact!=boost::rational<sal_Int64>(1,1)); const bool bDoCrook(aCenter!=aMarkCenter && aRad.X()!=0 && aRad.Y()!=0); if (bDoCrook || bDoResize) { if (bDoResize) { - boost::rational<long> aFact1(1,1); + boost::rational<sal_Int64> aFact1(1,1); if (bContortion) { @@ -3370,7 +3370,7 @@ bool SdrDragCrook::EndSdrDrag(bool bCopy) { Hide(); - if (bResize && aFact==boost::rational<long>(1,1)) + if (bResize && aFact==boost::rational<sal_Int64>(1,1)) bResize=false; const bool bUndo = getSdrDragView().IsUndoEnabled(); @@ -3392,7 +3392,7 @@ bool SdrDragCrook::EndSdrDrag(bool bCopy) if (bResize) { - boost::rational<long> aFact1(1,1); + boost::rational<sal_Int64> aFact1(1,1); if (bContortion) { diff --git a/svx/source/svdraw/svdedtv1.cxx b/svx/source/svdraw/svdedtv1.cxx index d0a34a13cf08..340a96946ba4 100644 --- a/svx/source/svdraw/svdedtv1.cxx +++ b/svx/source/svdraw/svdedtv1.cxx @@ -212,7 +212,7 @@ void SdrEditView::MoveMarkedObj(const Size& rSiz, bool bCopy) EndUndo(); } -void SdrEditView::ResizeMarkedObj(const Point& rRef, const boost::rational<long>& xFact, const boost::rational<long>& yFact, bool bCopy) +void SdrEditView::ResizeMarkedObj(const Point& rRef, const boost::rational<sal_Int64>& xFact, const boost::rational<sal_Int64>& yFact, bool bCopy) { const bool bUndo = IsUndoEnabled(); if( bUndo ) @@ -245,8 +245,8 @@ void SdrEditView::ResizeMarkedObj(const Point& rRef, const boost::rational<long> EndUndo(); } void SdrEditView::ResizeMultMarkedObj(const Point& rRef, - const boost::rational<long>& xFact, - const boost::rational<long>& yFact, + const boost::rational<sal_Int64>& xFact, + const boost::rational<sal_Int64>& yFact, const bool bCopy, const bool bWdh, const bool bHgt) @@ -276,7 +276,7 @@ void SdrEditView::ResizeMultMarkedObj(const Point& rRef, AddUndo( GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pO)); } - boost::rational<long> aFrac(1,1); + boost::rational<sal_Int64> aFrac(1,1); if (bWdh && bHgt) pO->Resize(rRef, xFact, yFact); else if (bWdh) @@ -755,12 +755,12 @@ void SdrEditView::SetNotPersistAttrToMarked(const SfxItemSet& rAttr, bool /*bRep SetMarkedObjRect(aRect); } if (rAttr.GetItemState(SDRATTR_RESIZEXALL,true,&pPoolItem)==SfxItemState::SET) { - boost::rational<long> aXFact=((const SdrResizeXAllItem*)pPoolItem)->GetValue(); - ResizeMarkedObj(aAllSnapRect.TopLeft(),aXFact,boost::rational<long>(1,1)); + boost::rational<sal_Int64> aXFact=((const SdrResizeXAllItem*)pPoolItem)->GetValue(); + ResizeMarkedObj(aAllSnapRect.TopLeft(),aXFact,boost::rational<sal_Int64>(1,1)); } if (rAttr.GetItemState(SDRATTR_RESIZEYALL,true,&pPoolItem)==SfxItemState::SET) { - boost::rational<long> aYFact=((const SdrResizeYAllItem*)pPoolItem)->GetValue(); - ResizeMarkedObj(aAllSnapRect.TopLeft(),boost::rational<long>(1,1),aYFact); + boost::rational<sal_Int64> aYFact=((const SdrResizeYAllItem*)pPoolItem)->GetValue(); + ResizeMarkedObj(aAllSnapRect.TopLeft(),boost::rational<sal_Int64>(1,1),aYFact); } if (rAttr.GetItemState(SDRATTR_ROTATEALL,true,&pPoolItem)==SfxItemState::SET) { long nAngle=((const SdrRotateAllItem*)pPoolItem)->GetValue(); @@ -1608,8 +1608,8 @@ void SdrEditView::SetGeoAttrToMarked(const SfxItemSet& rAttr) // change size and height if (bChgSiz && (bResizeFreeAllowed || bResizePropAllowed)) { - boost::rational<long> aWdt(nSizX,aRect.Right()-aRect.Left()); - boost::rational<long> aHgt(nSizY,aRect.Bottom()-aRect.Top()); + boost::rational<sal_Int64> aWdt(nSizX,aRect.Right()-aRect.Left()); + boost::rational<sal_Int64> aHgt(nSizY,aRect.Bottom()-aRect.Top()); Point aRef(ImpGetPoint(aRect,eSizePoint)); if(GetSdrPageView()) diff --git a/svx/source/svdraw/svdfmtf.cxx b/svx/source/svdraw/svdfmtf.cxx index 5b6a1f4dfcc0..ca4996af510f 100644 --- a/svx/source/svdraw/svdfmtf.cxx +++ b/svx/source/svdraw/svdfmtf.cxx @@ -241,18 +241,18 @@ size_t ImpSdrGDIMetaFileImport::DoImport( mbMov = maOfs.X()!=0 || maOfs.Y()!=0; mbSize = false; - maScaleX = boost::rational<long>( 1, 1 ); - maScaleY = boost::rational<long>( 1, 1 ); + maScaleX = boost::rational<sal_Int64>( 1, 1 ); + maScaleY = boost::rational<sal_Int64>( 1, 1 ); if(aMtfSize.Width() != (maScaleRect.GetWidth() - 1)) { - maScaleX = boost::rational<long>(maScaleRect.GetWidth() - 1, aMtfSize.Width()); + maScaleX = boost::rational<sal_Int64>(maScaleRect.GetWidth() - 1, aMtfSize.Width()); mbSize = true; } if(aMtfSize.Height() != (maScaleRect.GetHeight() - 1)) { - maScaleY = boost::rational<long>(maScaleRect.GetHeight() - 1, aMtfSize.Height()); + maScaleY = boost::rational<sal_Int64>(maScaleRect.GetHeight() - 1, aMtfSize.Height()); mbSize = true; } diff --git a/svx/source/svdraw/svdfmtf.hxx b/svx/source/svdraw/svdfmtf.hxx index d394e97463b3..239e6ee4f0d2 100644 --- a/svx/source/svdraw/svdfmtf.hxx +++ b/svx/source/svdraw/svdfmtf.hxx @@ -63,8 +63,8 @@ protected: Point maOfs; double mfScaleX; double mfScaleY; - boost::rational<long> maScaleX; - boost::rational<long> maScaleY; + boost::rational<sal_Int64> maScaleX; + boost::rational<sal_Int64> maScaleY; bool mbFntDirty; diff --git a/svx/source/svdraw/svdglev.cxx b/svx/source/svdraw/svdglev.cxx index 279c84631190..af7f705d0b29 100644 --- a/svx/source/svdraw/svdglev.cxx +++ b/svx/source/svdraw/svdglev.cxx @@ -378,10 +378,10 @@ void SdrGlueEditView::MoveMarkedGluePoints(const Size& rSiz, bool bCopy) static void ImpResize(Point& rPt, const void* p1, const void* p2, const void* p3, const void* /*p4*/, const void* /*p5*/) { - ResizePoint(rPt,*(const Point*)p1,*(const boost::rational<long>*)p2,*(const boost::rational<long>*)p3); + ResizePoint(rPt,*(const Point*)p1,*(const boost::rational<sal_Int64>*)p2,*(const boost::rational<sal_Int64>*)p3); } -void SdrGlueEditView::ResizeMarkedGluePoints(const Point& rRef, const boost::rational<long>& xFact, const boost::rational<long>& yFact, bool bCopy) +void SdrGlueEditView::ResizeMarkedGluePoints(const Point& rRef, const boost::rational<sal_Int64>& xFact, const boost::rational<sal_Int64>& yFact, bool bCopy) { ForceUndirtyMrkPnt(); OUString aStr(ImpGetResStr(STR_EditResize)); diff --git a/svx/source/svdraw/svdibrow.cxx b/svx/source/svdraw/svdibrow.cxx index be76208d988e..3a54e6458e03 100644 --- a/svx/source/svdraw/svdibrow.cxx +++ b/svx/source/svdraw/svdibrow.cxx @@ -1217,7 +1217,7 @@ IMPL_LINK(SdrItemBrowser,ChangedHdl,_SdrItemBrowserControl*,pBrowse) case ITEM_FRACTION: { if (!bPairX) nLongX=1; if (!bPairY) nLongY=1; - ((SdrFractionItem*)pNewItem)->SetValue(boost::rational<long>(nLongX,nLongY)); + ((SdrFractionItem*)pNewItem)->SetValue(boost::rational<sal_Int64>(nLongX,nLongY)); } break; case ITEM_XCOLOR: break; case ITEM_COLOR: break; diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx index e7171b1c3961..8a46865dbbe0 100644 --- a/svx/source/svdraw/svdmodel.cxx +++ b/svx/source/svdraw/svdmodel.cxx @@ -113,7 +113,7 @@ void SdrModel::ImpCtor(SfxItemPool* pPool, ::comphelper::IEmbeddedHelper* _pEmbe aObjUnit=SdrEngineDefaults::GetMapFraction(); eObjUnit=SdrEngineDefaults::GetMapUnit(); eUIUnit=FUNIT_MM; - aUIScale=boost::rational<long>(1,1); + aUIScale=boost::rational<sal_Int64>(1,1); nUIUnitKomma=0; bUIOnlyKomma=false; pLayerAdmin=NULL; @@ -929,7 +929,7 @@ void SdrModel::ImpSetUIUnit() { if(0 == aUIScale.numerator()) { - aUIScale = boost::rational<long>(1,1); + aUIScale = boost::rational<sal_Int64>(1,1); } // set start values @@ -1015,7 +1015,7 @@ void SdrModel::ImpSetUIUnit() // may need to be changed in the future, too if(1 != nMul || 1 != nDiv) { - const boost::rational<long> aTemp(static_cast< long >(nMul), static_cast< long >(nDiv)); + const boost::rational<sal_Int64> aTemp(static_cast< long >(nMul), static_cast< long >(nDiv)); nMul = aTemp.numerator(); nDiv = aTemp.denominator(); } @@ -1043,12 +1043,12 @@ void SdrModel::ImpSetUIUnit() } // end preparations, set member values - aUIUnitFact = boost::rational<long>(sal_Int32(nMul), sal_Int32(nDiv)); + aUIUnitFact = boost::rational<sal_Int64>(sal_Int32(nMul), sal_Int32(nDiv)); bUIOnlyKomma = (nMul == nDiv); TakeUnitStr(eUIUnit, aUIUnitStr); } -void SdrModel::SetScaleUnit(MapUnit eMap, const boost::rational<long>& rFrac) +void SdrModel::SetScaleUnit(MapUnit eMap, const boost::rational<sal_Int64>& rFrac) { if (eObjUnit!=eMap || aObjUnit!=rFrac) { eObjUnit=eMap; @@ -1073,7 +1073,7 @@ void SdrModel::SetScaleUnit(MapUnit eMap) } } -void SdrModel::SetScaleFraction(const boost::rational<long>& rFrac) +void SdrModel::SetScaleFraction(const boost::rational<sal_Int64>& rFrac) { if (aObjUnit!=rFrac) { aObjUnit=rFrac; @@ -1093,7 +1093,7 @@ void SdrModel::SetUIUnit(FieldUnit eUnit) } } -void SdrModel::SetUIScale(const boost::rational<long>& rScale) +void SdrModel::SetUIScale(const boost::rational<sal_Int64>& rScale) { if (aUIScale!=rScale) { aUIScale=rScale; @@ -1102,7 +1102,7 @@ void SdrModel::SetUIScale(const boost::rational<long>& rScale) } } -void SdrModel::SetUIUnit(FieldUnit eUnit, const boost::rational<long>& rScale) +void SdrModel::SetUIUnit(FieldUnit eUnit, const boost::rational<sal_Int64>& rScale) { if (eUIUnit!=eUnit || aUIScale!=rScale) { eUIUnit=eUnit; @@ -1333,7 +1333,7 @@ void SdrModel::TakeWinkStr(long nWink, OUString& rStr, bool bNoDegChar) const rStr = aBuf.makeStringAndClear(); } -void SdrModel::TakePercentStr(const boost::rational<long>& rVal, OUString& rStr, bool bNoPercentChar) const +void SdrModel::TakePercentStr(const boost::rational<sal_Int64>& rVal, OUString& rStr, bool bNoPercentChar) const { sal_Int32 nMul(rVal.numerator()); sal_Int32 nDiv(rVal.denominator()); diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx index 859e366ec17e..021e9a049ade 100644 --- a/svx/source/svdraw/svdoashp.cxx +++ b/svx/source/svdraw/svdoashp.cxx @@ -1564,15 +1564,15 @@ void SdrObjCustomShape::NbcMove( const Size& rSiz ) mpLastShadowGeometry->NbcMove( rSiz ); } } -void SdrObjCustomShape::Resize( const Point& rRef, const boost::rational<long>& xFact, const boost::rational<long>& yFact, bool bUnsetRelative ) +void SdrObjCustomShape::Resize( const Point& rRef, const boost::rational<sal_Int64>& xFact, const boost::rational<sal_Int64>& yFact, bool bUnsetRelative ) { SdrTextObj::Resize( rRef, xFact, yFact, bUnsetRelative ); } -void SdrObjCustomShape::NbcResize( const Point& rRef, const boost::rational<long>& rxFact, const boost::rational<long>& ryFact ) +void SdrObjCustomShape::NbcResize( const Point& rRef, const boost::rational<sal_Int64>& rxFact, const boost::rational<sal_Int64>& ryFact ) { - boost::rational<long> xFact( rxFact ); - boost::rational<long> yFact( ryFact ); + boost::rational<sal_Int64> xFact( rxFact ); + boost::rational<sal_Int64> yFact( ryFact ); // taking care of handles that should not been changed Rectangle aOld( aRect ); diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx index 2cd9069de14f..1c1281d9d934 100644 --- a/svx/source/svdraw/svdobj.cxx +++ b/svx/source/svdraw/svdobj.cxx @@ -1338,8 +1338,8 @@ Rectangle SdrObject::ImpDragCalcRect(const SdrDragStat& rDrag) const nYMul=std::abs(nYMul); nXDiv=std::abs(nXDiv); nYDiv=std::abs(nYDiv); - boost::rational<long> aXFact(nXMul,nXDiv); // fractions for canceling - boost::rational<long> aYFact(nYMul,nYDiv); // and for comparing + boost::rational<sal_Int64> aXFact(nXMul,nXDiv); // fractions for canceling + boost::rational<sal_Int64> aYFact(nYMul,nYDiv); // and for comparing nXMul=aXFact.numerator(); nYMul=aYFact.numerator(); nXDiv=aXFact.denominator(); @@ -1495,7 +1495,7 @@ void SdrObject::NbcMove(const Size& rSiz) SetRectsDirty(); } -void SdrObject::NbcResize(const Point& rRef, const boost::rational<long>& xFact, const boost::rational<long>& yFact) +void SdrObject::NbcResize(const Point& rRef, const boost::rational<sal_Int64>& xFact, const boost::rational<sal_Int64>& yFact) { bool bXMirr = xFact < 0; bool bYMirr = yFact < 0; @@ -1593,7 +1593,7 @@ void SdrObject::Move(const Size& rSiz) } } -void SdrObject::Resize(const Point& rRef, const boost::rational<long>& xFact, const boost::rational<long>& yFact, bool bUnsetRelative) +void SdrObject::Resize(const Point& rRef, const boost::rational<sal_Int64>& xFact, const boost::rational<sal_Int64>& yFact, bool bUnsetRelative) { if (xFact.numerator()!=xFact.denominator() || yFact.numerator()!=yFact.denominator()) { if (bUnsetRelative) @@ -2262,15 +2262,15 @@ void SdrObject::NbcApplyNotPersistAttr(const SfxItemSet& rAttr) if (aNewLogic!=rLogic) { NbcSetLogicRect(aNewLogic); } - boost::rational<long> aResizeX(1,1); - boost::rational<long> aResizeY(1,1); + boost::rational<sal_Int64> aResizeX(1,1); + boost::rational<sal_Int64> aResizeY(1,1); if (rAttr.GetItemState(SDRATTR_RESIZEXONE,true,&pPoolItem)==SfxItemState::SET) { aResizeX*=((const SdrResizeXOneItem*)pPoolItem)->GetValue(); } if (rAttr.GetItemState(SDRATTR_RESIZEYONE,true,&pPoolItem)==SfxItemState::SET) { aResizeY*=((const SdrResizeYOneItem*)pPoolItem)->GetValue(); } - if (aResizeX!=boost::rational<long>(1,1) || aResizeY!=boost::rational<long>(1,1)) { + if (aResizeX!=boost::rational<sal_Int64>(1,1) || aResizeY!=boost::rational<sal_Int64>(1,1)) { NbcResize(aRef1,aResizeX,aResizeY); } } diff --git a/svx/source/svdraw/svdocapt.cxx b/svx/source/svdraw/svdocapt.cxx index 85f7502f9d33..cd0fba56b32f 100644 --- a/svx/source/svdraw/svdocapt.cxx +++ b/svx/source/svdraw/svdocapt.cxx @@ -608,7 +608,7 @@ void SdrCaptionObj::NbcMove(const Size& rSiz) SetTailPos(GetFixedTailPos()); } -void SdrCaptionObj::NbcResize(const Point& rRef, const boost::rational<long>& xFact, const boost::rational<long>& yFact) +void SdrCaptionObj::NbcResize(const Point& rRef, const boost::rational<sal_Int64>& xFact, const boost::rational<sal_Int64>& yFact) { SdrRectObj::NbcResize(rRef,xFact,yFact); ResizePoly(aTailPoly,rRef,xFact,yFact); diff --git a/svx/source/svdraw/svdocirc.cxx b/svx/source/svdraw/svdocirc.cxx index 32f99f01b246..987f1ab6e16d 100644 --- a/svx/source/svdraw/svdocirc.cxx +++ b/svx/source/svdraw/svdocirc.cxx @@ -811,7 +811,7 @@ void SdrCircObj::NbcMove(const Size& aSiz) SetRectsDirty(true); } -void SdrCircObj::NbcResize(const Point& rRef, const boost::rational<long>& xFact, const boost::rational<long>& yFact) +void SdrCircObj::NbcResize(const Point& rRef, const boost::rational<sal_Int64>& xFact, const boost::rational<sal_Int64>& yFact) { long nWink0=aGeo.nRotationAngle; bool bNoShearRota=(aGeo.nRotationAngle==0 && aGeo.nShearWink==0); @@ -1031,7 +1031,7 @@ void SdrCircObj::NbcSetSnapRect(const Rectangle& rRect) long nHgt0=aSR0.Bottom()-aSR0.Top(); long nWdt1=rRect.Right()-rRect.Left(); long nHgt1=rRect.Bottom()-rRect.Top(); - NbcResize(maSnapRect.TopLeft(),boost::rational<long>(nWdt1,nWdt0),boost::rational<long>(nHgt1,nHgt0)); + NbcResize(maSnapRect.TopLeft(),boost::rational<sal_Int64>(nWdt1,nWdt0),boost::rational<sal_Int64>(nHgt1,nHgt0)); NbcMove(Size(rRect.Left()-aSR0.Left(),rRect.Top()-aSR0.Top())); } else { aRect=rRect; diff --git a/svx/source/svdraw/svdoedge.cxx b/svx/source/svdraw/svdoedge.cxx index c73a6d167f73..d1794116b332 100644 --- a/svx/source/svdraw/svdoedge.cxx +++ b/svx/source/svdraw/svdoedge.cxx @@ -2244,8 +2244,8 @@ void SdrEdgeObj::NbcSetSnapRect(const Rectangle& rRect) long nDivY = aOld.Bottom() - aOld.Top(); if ( nDivX == 0 ) { nMulX = 1; nDivX = 1; } if ( nDivY == 0 ) { nMulY = 1; nDivY = 1; } - boost::rational<long> aX(nMulX, nDivX); - boost::rational<long> aY(nMulY, nDivY); + boost::rational<sal_Int64> aX(nMulX, nDivX); + boost::rational<sal_Int64> aY(nMulY, nDivY); NbcResize(aOld.TopLeft(), aX, aY); NbcMove(Size(rRect.Left() - aOld.Left(), rRect.Top() - aOld.Top())); } @@ -2258,7 +2258,7 @@ void SdrEdgeObj::NbcMove(const Size& rSiz) MoveXPoly(*pEdgeTrack,rSiz); } -void SdrEdgeObj::NbcResize(const Point& rRefPnt, const boost::rational<long>& aXFact, const boost::rational<long>& aYFact) +void SdrEdgeObj::NbcResize(const Point& rRefPnt, const boost::rational<sal_Int64>& aXFact, const boost::rational<sal_Int64>& aYFact) { SdrTextObj::NbcResize(rRefPnt,aXFact,aXFact); ResizeXPoly(*pEdgeTrack,rRefPnt,aXFact,aYFact); diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx index 7190aa283205..09fe52409a20 100644 --- a/svx/source/svdraw/svdograf.cxx +++ b/svx/source/svdraw/svdograf.cxx @@ -897,7 +897,7 @@ SdrHdl* SdrGrafObj::GetHdl(sal_uInt32 nHdlNum) const return SdrRectObj::GetHdl( nHdlNum + 1L ); } -void SdrGrafObj::NbcResize(const Point& rRef, const boost::rational<long>& xFact, const boost::rational<long>& yFact) +void SdrGrafObj::NbcResize(const Point& rRef, const boost::rational<sal_Int64>& xFact, const boost::rational<sal_Int64>& yFact) { SdrRectObj::NbcResize( rRef, xFact, yFact ); diff --git a/svx/source/svdraw/svdogrp.cxx b/svx/source/svdraw/svdogrp.cxx index a624269bd2a8..638a05b622fe 100644 --- a/svx/source/svdraw/svdogrp.cxx +++ b/svx/source/svdraw/svdogrp.cxx @@ -403,8 +403,8 @@ void SdrObjGroup::NbcSetSnapRect(const Rectangle& rRect) if (nDivX==0) { nMulX=1; nDivX=1; } if (nDivY==0) { nMulY=1; nDivY=1; } if (nMulX!=nDivX || nMulY!=nDivY) { - boost::rational<long> aX(nMulX,nDivX); - boost::rational<long> aY(nMulY,nDivY); + boost::rational<sal_Int64> aX(nMulX,nDivX); + boost::rational<sal_Int64> aY(nMulY,nDivY); NbcResize(aOld.TopLeft(),aX,aY); } if (rRect.Left()!=aOld.Left() || rRect.Top()!=aOld.Top()) { @@ -436,7 +436,7 @@ void SdrObjGroup::NbcMove(const Size& rSiz) } -void SdrObjGroup::NbcResize(const Point& rRef, const boost::rational<long>& xFact, const boost::rational<long>& yFact) +void SdrObjGroup::NbcResize(const Point& rRef, const boost::rational<sal_Int64>& xFact, const boost::rational<sal_Int64>& yFact) { bool bXMirr = xFact < 0; bool bYMirr = yFact < 0; @@ -538,8 +538,8 @@ void SdrObjGroup::SetSnapRect(const Rectangle& rRect) if (nDivX==0) { nMulX=1; nDivX=1; } if (nDivY==0) { nMulY=1; nDivY=1; } if (nMulX!=nDivX || nMulY!=nDivY) { - boost::rational<long> aX(nMulX,nDivX); - boost::rational<long> aY(nMulY,nDivY); + boost::rational<sal_Int64> aX(nMulX,nDivX); + boost::rational<sal_Int64> aY(nMulY,nDivY); Resize(aOld.TopLeft(),aX,aY); } if (rRect.Left()!=aOld.Left() || rRect.Top()!=aOld.Top()) { @@ -587,7 +587,7 @@ void SdrObjGroup::Move(const Size& rSiz) } -void SdrObjGroup::Resize(const Point& rRef, const boost::rational<long>& xFact, const boost::rational<long>& yFact, bool bUnsetRelative) +void SdrObjGroup::Resize(const Point& rRef, const boost::rational<sal_Int64>& xFact, const boost::rational<sal_Int64>& yFact, bool bUnsetRelative) { if (xFact.numerator()!=xFact.denominator() || yFact.numerator()!=yFact.denominator()) { bool bXMirr = xFact < 0; diff --git a/svx/source/svdraw/svdomeas.cxx b/svx/source/svdraw/svdomeas.cxx index ebec5c688349..09d664b7647f 100644 --- a/svx/source/svdraw/svdomeas.cxx +++ b/svx/source/svdraw/svdomeas.cxx @@ -80,7 +80,7 @@ SdrMeasureObjGeoData::~SdrMeasureObjGeoData() {} OUString SdrMeasureObj::TakeRepresentation(SdrMeasureFieldKind eMeasureFieldKind) const { OUString aStr; - boost::rational<long> aMeasureScale(1, 1); + boost::rational<sal_Int64> aMeasureScale(1, 1); bool bTextRota90(false); bool bShowUnit(false); FieldUnit eMeasureUnit(FUNIT_NONE); @@ -105,7 +105,7 @@ OUString SdrMeasureObj::TakeRepresentation(SdrMeasureFieldKind eMeasureFieldKind eMeasureUnit = eModUIUnit; sal_Int32 nLen(GetLen(aPt2 - aPt1)); - boost::rational<long> aFact(1,1); + boost::rational<sal_Int64> aFact(1,1); if(eMeasureUnit != eModUIUnit) { @@ -275,7 +275,7 @@ struct ImpMeasureRec : public SdrDragStatUserData bool bTextUpsideDown; long nMeasureOverhang; FieldUnit eMeasureUnit; - boost::rational<long> aMeasureScale; + boost::rational<sal_Int64> aMeasureScale; bool bShowUnit; OUString aFormatString; bool bTextAutoAngle; @@ -1029,7 +1029,7 @@ void SdrMeasureObj::NbcMove(const Size& rSiz) MovePoint(aPt2,rSiz); } -void SdrMeasureObj::NbcResize(const Point& rRef, const boost::rational<long>& xFact, const boost::rational<long>& yFact) +void SdrMeasureObj::NbcResize(const Point& rRef, const boost::rational<sal_Int64>& xFact, const boost::rational<sal_Int64>& yFact) { SdrTextObj::NbcResize(rRef,xFact,yFact); ResizePoint(aPt1,rRef,xFact,yFact); diff --git a/svx/source/svdraw/svdoole2.cxx b/svx/source/svdraw/svdoole2.cxx index cb9dd89ffc04..2bcf9e8b11d1 100644 --- a/svx/source/svdraw/svdoole2.cxx +++ b/svx/source/svdraw/svdoole2.cxx @@ -114,22 +114,22 @@ class SdrLightEmbeddedClient_Impl : public ::cppu::WeakImplHelper5 uno::Reference< awt::XWindow > m_xWindow; SdrOle2Obj* mpObj; - boost::rational<long> m_aScaleWidth; - boost::rational<long> m_aScaleHeight; + boost::rational<sal_Int64> m_aScaleWidth; + boost::rational<sal_Int64> m_aScaleHeight; public: SdrLightEmbeddedClient_Impl( SdrOle2Obj* pObj ); void Release(); - void SetSizeScale( const boost::rational<long>& aScaleWidth, const boost::rational<long>& aScaleHeight ) + void SetSizeScale( const boost::rational<sal_Int64>& aScaleWidth, const boost::rational<sal_Int64>& aScaleHeight ) { m_aScaleWidth = aScaleWidth; m_aScaleHeight = aScaleHeight; } - boost::rational<long> GetScaleWidth() const { return m_aScaleWidth; } - boost::rational<long> GetScaleHeight() const { return m_aScaleHeight; } + boost::rational<sal_Int64> GetScaleWidth() const { return m_aScaleWidth; } + boost::rational<sal_Int64> GetScaleHeight() const { return m_aScaleHeight; } void setWindow(const uno::Reference< awt::XWindow >& _xWindow); @@ -1762,8 +1762,8 @@ void SdrOle2Obj::ImpSetVisAreaSize() || mpImpl->mxObjRef->getCurrentState() == embed::EmbedStates::INPLACE_ACTIVE ) { - boost::rational<long> aScaleWidth; - boost::rational<long> aScaleHeight; + boost::rational<sal_Int64> aScaleWidth; + boost::rational<sal_Int64> aScaleHeight; if ( pClient ) { aScaleWidth = pClient->GetScaleWidth(); @@ -1826,8 +1826,8 @@ void SdrOle2Obj::ImpSetVisAreaSize() { // The object isn't active and does not want to resize itself so the changed object area size // will be reflected in a changed object scaling - boost::rational<long> aScaleWidth; - boost::rational<long> aScaleHeight; + boost::rational<sal_Int64> aScaleWidth; + boost::rational<sal_Int64> aScaleHeight; Size aObjAreaSize; if ( CalculateNewScaling( aScaleWidth, aScaleHeight, aObjAreaSize ) ) { @@ -1865,7 +1865,7 @@ void SdrOle2Obj::ImpSetVisAreaSize() -void SdrOle2Obj::NbcResize(const Point& rRef, const boost::rational<long>& xFact, const boost::rational<long>& yFact) +void SdrOle2Obj::NbcResize(const Point& rRef, const boost::rational<sal_Int64>& xFact, const boost::rational<sal_Int64>& yFact) { if( pModel && !pModel->isLocked() ) { @@ -2211,7 +2211,7 @@ uno::Reference< frame::XModel > SdrOle2Obj::GetParentXModel() const } -bool SdrOle2Obj::CalculateNewScaling( boost::rational<long>& aScaleWidth, boost::rational<long>& aScaleHeight, Size& aObjAreaSize ) +bool SdrOle2Obj::CalculateNewScaling( boost::rational<sal_Int64>& aScaleWidth, boost::rational<sal_Int64>& aScaleHeight, Size& aObjAreaSize ) { // TODO/LEAN: to avoid rounding errors scaling always uses the VisArea. // If we don't cache it for own objects also we must load the object here @@ -2222,8 +2222,8 @@ bool SdrOle2Obj::CalculateNewScaling( boost::rational<long>& aScaleWidth, boost: aObjAreaSize = mpImpl->mxObjRef.GetSize( &aMapMode ); Size aSize = aRect.GetSize(); - aScaleWidth = boost::rational<long>(aSize.Width(), aObjAreaSize.Width() ); - aScaleHeight = boost::rational<long>(aSize.Height(), aObjAreaSize.Height() ); + aScaleWidth = boost::rational<sal_Int64>(aSize.Width(), aObjAreaSize.Width() ); + aScaleHeight = boost::rational<sal_Int64>(aSize.Height(), aObjAreaSize.Height() ); // reduce to 10 binary digits Kuerzen(aScaleHeight, 10); @@ -2243,8 +2243,8 @@ bool SdrOle2Obj::AddOwnLightClient() if ( mpImpl->mxObjRef.is() && mpImpl->pLightClient ) { - boost::rational<long> aScaleWidth; - boost::rational<long> aScaleHeight; + boost::rational<sal_Int64> aScaleWidth; + boost::rational<sal_Int64> aScaleHeight; Size aObjAreaSize; if ( CalculateNewScaling( aScaleWidth, aScaleHeight, aObjAreaSize ) ) { diff --git a/svx/source/svdraw/svdoopengl.cxx b/svx/source/svdraw/svdoopengl.cxx index b1e8e8f0e945..7e3f689059d7 100644 --- a/svx/source/svdraw/svdoopengl.cxx +++ b/svx/source/svdraw/svdoopengl.cxx @@ -35,7 +35,7 @@ sdr::contact::ViewContact* SdrOpenGLObj::CreateObjectSpecificViewContact() } -void SdrOpenGLObj::NbcResize(const Point& rRef, const boost::rational<long>& xFact, const boost::rational<long>& yFact) +void SdrOpenGLObj::NbcResize(const Point& rRef, const boost::rational<sal_Int64>& xFact, const boost::rational<sal_Int64>& yFact) { SdrObject::NbcResize(rRef, xFact, yFact); diff --git a/svx/source/svdraw/svdopath.cxx b/svx/source/svdraw/svdopath.cxx index 3f7541383b72..fc58d2b3a419 100644 --- a/svx/source/svdraw/svdopath.cxx +++ b/svx/source/svdraw/svdopath.cxx @@ -2352,7 +2352,7 @@ void SdrPathObj::NbcMove(const Size& rSiz) SdrTextObj::NbcMove(rSiz); } -void SdrPathObj::NbcResize(const Point& rRef, const boost::rational<long>& xFact, const boost::rational<long>& yFact) +void SdrPathObj::NbcResize(const Point& rRef, const boost::rational<sal_Int64>& xFact, const boost::rational<sal_Int64>& yFact) { basegfx::B2DHomMatrix aTrans(basegfx::tools::createTranslateB2DHomMatrix(-rRef.X(), -rRef.Y())); aTrans = basegfx::tools::createScaleTranslateB2DHomMatrix( @@ -2454,8 +2454,8 @@ void SdrPathObj::NbcSetSnapRect(const Rectangle& rRect) long nDivY = aOld.Bottom() - aOld.Top(); if ( nDivX == 0 ) { nMulX = 1; nDivX = 1; } if ( nDivY == 0 ) { nMulY = 1; nDivY = 1; } - boost::rational<long> aX(nMulX,nDivX); - boost::rational<long> aY(nMulY,nDivY); + boost::rational<sal_Int64> aX(nMulX,nDivX); + boost::rational<sal_Int64> aY(nMulY,nDivY); NbcResize(aOld.TopLeft(), aX, aY); NbcMove(Size(rRect.Left() - aOld.Left(), rRect.Top() - aOld.Top())); } diff --git a/svx/source/svdraw/svdorect.cxx b/svx/source/svdraw/svdorect.cxx index 81b12eceed49..774286e0e457 100644 --- a/svx/source/svdraw/svdorect.cxx +++ b/svx/source/svdraw/svdorect.cxx @@ -494,7 +494,7 @@ void SdrRectObj::NbcMove(const Size& rSiz) SetXPolyDirty(); } -void SdrRectObj::NbcResize(const Point& rRef, const boost::rational<long>& xFact, const boost::rational<long>& yFact) +void SdrRectObj::NbcResize(const Point& rRef, const boost::rational<sal_Int64>& xFact, const boost::rational<sal_Int64>& yFact) { SdrTextObj::NbcResize(rRef,xFact,yFact); SetXPolyDirty(); diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx index a84b853396be..5f6cc3d7ed1a 100644 --- a/svx/source/svdraw/svdotext.cxx +++ b/svx/source/svdraw/svdotext.cxx @@ -871,7 +871,7 @@ OutlinerParaObject* SdrTextObj::GetEditOutlinerParaObject() const return pPara; } -void SdrTextObj::ImpSetCharStretching(SdrOutliner& rOutliner, const Size& rTextSize, const Size& rShapeSize, boost::rational<long>& rFitXKorreg) const +void SdrTextObj::ImpSetCharStretching(SdrOutliner& rOutliner, const Size& rTextSize, const Size& rShapeSize, boost::rational<sal_Int64>& rFitXKorreg) const { OutputDevice* pOut = rOutliner.GetRefDevice(); bool bNoStretching(false); @@ -963,7 +963,7 @@ void SdrTextObj::ImpSetCharStretching(SdrOutliner& rOutliner, const Size& rTextS nLoopCount++; Size aSiz(rOutliner.CalcTextSize()); long nXDiff=aSiz.Width()-nWantWdt; - rFitXKorreg=boost::rational<long>(nWantWdt,aSiz.Width()); + rFitXKorreg=boost::rational<sal_Int64>(nWantWdt,aSiz.Width()); if (((nXDiff>=nXTolMi || !bChkX) && nXDiff<=nXTolPl) || nXDiff==nXDiff0) { bNoMoreLoop = true; } else { @@ -1245,7 +1245,7 @@ void SdrTextObj::ImpSetupDrawOutlinerForPaint( bool bContourFrame, Rectangle& rTextRect, Rectangle& rAnchorRect, Rectangle& rPaintRect, - boost::rational<long>& rFitXKorreg ) const + boost::rational<sal_Int64>& rFitXKorreg ) const { if (!bContourFrame) { @@ -1349,7 +1349,7 @@ void SdrTextObj::UpdateOutlinerFormatting( SdrOutliner& rOutl, Rectangle& rPaint { Rectangle aTextRect; Rectangle aAnchorRect; - boost::rational<long> aFitXKorreg(1,1); + boost::rational<sal_Int64> aFitXKorreg(1,1); bool bContourFrame=IsContourTextFrame(); @@ -1837,7 +1837,7 @@ GDIMetaFile* SdrTextObj::GetTextScrollMetaFileAndRectangle( Rectangle aTextRect; Rectangle aAnchorRect; Rectangle aPaintRect; - boost::rational<long> aFitXKorreg(1,1); + boost::rational<sal_Int64> aFitXKorreg(1,1); bool bContourFrame(IsContourTextFrame()); // get outliner set up. To avoid getting a somehow rotated MetaFile, diff --git a/svx/source/svdraw/svdotxdr.cxx b/svx/source/svdraw/svdotxdr.cxx index 334aaaef1568..05bdb03c860a 100644 --- a/svx/source/svdraw/svdotxdr.cxx +++ b/svx/source/svdraw/svdotxdr.cxx @@ -104,8 +104,8 @@ Rectangle SdrTextObj::ImpDragCalcRect(const SdrDragStat& rDrag) const nYMul=std::abs(nYMul); nXDiv=std::abs(nXDiv); nYDiv=std::abs(nYDiv); - boost::rational<long> aXFact(nXMul,nXDiv); // fractions for canceling - boost::rational<long> aYFact(nYMul,nYDiv); // and for comparing + boost::rational<sal_Int64> aXFact(nXMul,nXDiv); // fractions for canceling + boost::rational<sal_Int64> aYFact(nYMul,nYDiv); // and for comparing nXMul=aXFact.numerator(); nYMul=aYFact.numerator(); nXDiv=aXFact.denominator(); diff --git a/svx/source/svdraw/svdotxed.cxx b/svx/source/svdraw/svdotxed.cxx index 4bdaa2a0f845..94f1aef13e12 100644 --- a/svx/source/svdraw/svdotxed.cxx +++ b/svx/source/svdraw/svdotxed.cxx @@ -95,7 +95,7 @@ bool SdrTextObj::BegTextEdit(SdrOutliner& rOutl) Rectangle aTextRect; TakeTextRect(rOutl, aTextRect, false, &aAnchorRect); - boost::rational<long> aFitXKorreg(1,1); + boost::rational<sal_Int64> aFitXKorreg(1,1); ImpSetCharStretching(rOutl,aTextRect.GetSize(),aAnchorRect.GetSize(),aFitXKorreg); } else if (IsAutoFit()) diff --git a/svx/source/svdraw/svdotxtr.cxx b/svx/source/svdraw/svdotxtr.cxx index 550ce4c335af..64a48cae777c 100644 --- a/svx/source/svdraw/svdotxtr.cxx +++ b/svx/source/svdraw/svdotxtr.cxx @@ -48,7 +48,7 @@ void SdrTextObj::NbcSetSnapRect(const Rectangle& rRect) long nHgt0=aSR0.Bottom()-aSR0.Top(); long nWdt1=rRect.Right()-rRect.Left(); long nHgt1=rRect.Bottom()-rRect.Top(); - SdrTextObj::NbcResize(maSnapRect.TopLeft(),boost::rational<long>(nWdt1,nWdt0),boost::rational<long>(nHgt1,nHgt0)); + SdrTextObj::NbcResize(maSnapRect.TopLeft(),boost::rational<sal_Int64>(nWdt1,nWdt0),boost::rational<sal_Int64>(nHgt1,nHgt0)); SdrTextObj::NbcMove(Size(rRect.Left()-aSR0.Left(),rRect.Top()-aSR0.Top())); } else { long nHDist=GetTextLeftDistance()+GetTextRightDistance(); @@ -118,7 +118,7 @@ void SdrTextObj::NbcMove(const Size& rSiz) SetRectsDirty(true); } -void SdrTextObj::NbcResize(const Point& rRef, const boost::rational<long>& xFact, const boost::rational<long>& yFact) +void SdrTextObj::NbcResize(const Point& rRef, const boost::rational<sal_Int64>& xFact, const boost::rational<sal_Int64>& yFact) { bool bNoShearMerk=aGeo.nShearWink==0; bool bRota90Merk=bNoShearMerk && aGeo.nRotationAngle % 9000 ==0; diff --git a/svx/source/svdraw/svdouno.cxx b/svx/source/svdraw/svdouno.cxx index aff41c4f92e9..a577387a464b 100644 --- a/svx/source/svdraw/svdouno.cxx +++ b/svx/source/svdraw/svdouno.cxx @@ -320,7 +320,7 @@ SdrUnoObj& SdrUnoObj::operator= (const SdrUnoObj& rObj) return *this; } -void SdrUnoObj::NbcResize(const Point& rRef, const boost::rational<long>& xFact, const boost::rational<long>& yFact) +void SdrUnoObj::NbcResize(const Point& rRef, const boost::rational<sal_Int64>& xFact, const boost::rational<sal_Int64>& yFact) { SdrRectObj::NbcResize(rRef,xFact,yFact); diff --git a/svx/source/svdraw/svdovirt.cxx b/svx/source/svdraw/svdovirt.cxx index ae99c80b2e5c..cc690fef6da2 100644 --- a/svx/source/svdraw/svdovirt.cxx +++ b/svx/source/svdraw/svdovirt.cxx @@ -355,7 +355,7 @@ void SdrVirtObj::NbcMove(const Size& rSiz) SetRectsDirty(); } -void SdrVirtObj::NbcResize(const Point& rRef, const boost::rational<long>& xFact, const boost::rational<long>& yFact) +void SdrVirtObj::NbcResize(const Point& rRef, const boost::rational<sal_Int64>& xFact, const boost::rational<sal_Int64>& yFact) { rRefObj.NbcResize(rRef-aAnchor,xFact,yFact); SetRectsDirty(); @@ -392,7 +392,7 @@ void SdrVirtObj::Move(const Size& rSiz) } } -void SdrVirtObj::Resize(const Point& rRef, const boost::rational<long>& xFact, const boost::rational<long>& yFact, bool bUnsetRelative) +void SdrVirtObj::Resize(const Point& rRef, const boost::rational<sal_Int64>& xFact, const boost::rational<sal_Int64>& yFact, bool bUnsetRelative) { if (xFact.numerator()!=xFact.denominator() || yFact.numerator()!=yFact.denominator()) { Rectangle aBoundRect0; if (pUserCall!=NULL) aBoundRect0=GetLastBoundRect(); diff --git a/svx/source/svdraw/svdpntv.cxx b/svx/source/svdraw/svdpntv.cxx index e7a713ec74f5..14fc0d43c53b 100644 --- a/svx/source/svdraw/svdpntv.cxx +++ b/svx/source/svdraw/svdpntv.cxx @@ -1149,8 +1149,8 @@ void SdrPaintView::MakeVisible(const Rectangle& rRect, vcl::Window& rWin) { bNewScale=true; // set new MapMode (Size+Org) and invalidate everything - boost::rational<long> aXFact(aNewSize.Width(),aActualSize.Width()); - boost::rational<long> aYFact(aNewSize.Height(),aActualSize.Height()); + boost::rational<sal_Int64> aXFact(aNewSize.Width(),aActualSize.Width()); + boost::rational<sal_Int64> aYFact(aNewSize.Height(),aActualSize.Height()); if (aYFact>aXFact) aXFact=aYFact; aXFact*=aMap.GetScaleX(); rational_ReduceInaccurate(aXFact, 10); // to avoid runovers and BigInt mapping diff --git a/svx/source/svdraw/svdpoev.cxx b/svx/source/svdraw/svdpoev.cxx index 8ee050116a7c..ac5d309e9578 100644 --- a/svx/source/svdraw/svdpoev.cxx +++ b/svx/source/svdraw/svdpoev.cxx @@ -672,12 +672,12 @@ void SdrPolyEditView::MoveMarkedPoints(const Size& rSiz) static void ImpResize(Point& rPt, Point* pC1, Point* pC2, const void* p1, const void* p2, const void* p3, const void* /*p4*/, const void* /*p5*/) { - ResizePoint(rPt,*(const Point*)p1,*(const boost::rational<long>*)p2,*(const boost::rational<long>*)p3); - if (pC1!=NULL) ResizePoint(*pC1,*(const Point*)p1,*(const boost::rational<long>*)p2,*(const boost::rational<long>*)p3); - if (pC2!=NULL) ResizePoint(*pC2,*(const Point*)p1,*(const boost::rational<long>*)p2,*(const boost::rational<long>*)p3); + ResizePoint(rPt,*(const Point*)p1,*(const boost::rational<sal_Int64>*)p2,*(const boost::rational<sal_Int64>*)p3); + if (pC1!=NULL) ResizePoint(*pC1,*(const Point*)p1,*(const boost::rational<sal_Int64>*)p2,*(const boost::rational<sal_Int64>*)p3); + if (pC2!=NULL) ResizePoint(*pC2,*(const Point*)p1,*(const boost::rational<sal_Int64>*)p2,*(const boost::rational<sal_Int64>*)p3); } -void SdrPolyEditView::ResizeMarkedPoints(const Point& rRef, const boost::rational<long>& xFact, const boost::rational<long>& yFact) +void SdrPolyEditView::ResizeMarkedPoints(const Point& rRef, const boost::rational<sal_Int64>& xFact, const boost::rational<sal_Int64>& yFact) { ForceUndirtyMrkPnt(); OUString aStr(ImpGetResStr(STR_EditResize)); diff --git a/svx/source/svdraw/svdtext.cxx b/svx/source/svdraw/svdtext.cxx index acd1546b1cad..bc67201aa366 100644 --- a/svx/source/svdraw/svdtext.cxx +++ b/svx/source/svdraw/svdtext.cxx @@ -153,7 +153,7 @@ void SdrText::SetModel( SdrModel* pNewModel ) mpOutlinerParaObject=0; if (bScaleUnitChanged) { - boost::rational<long> aMetricFactor=GetMapFactor(aOldUnit,aNewUnit).X(); + boost::rational<sal_Int64> aMetricFactor=GetMapFactor(aOldUnit,aNewUnit).X(); if (bSetHgtItem) { diff --git a/svx/source/svdraw/svdtrans.cxx b/svx/source/svdraw/svdtrans.cxx index 535383a6f827..195abe60fcb3 100644 --- a/svx/source/svdraw/svdtrans.cxx +++ b/svx/source/svdraw/svdtrans.cxx @@ -32,10 +32,10 @@ void MoveXPoly(XPolygon& rPoly, const Size& S) rPoly.Move(S.Width(),S.Height()); } -void ResizeRect(Rectangle& rRect, const Point& rRef, const boost::rational<long>& rxFact, const boost::rational<long>& ryFact, bool bNoJustify) +void ResizeRect(Rectangle& rRect, const Point& rRef, const boost::rational<sal_Int64>& rxFact, const boost::rational<sal_Int64>& ryFact, bool bNoJustify) { - boost::rational<long> xFact(rxFact); - boost::rational<long> yFact(ryFact); + boost::rational<sal_Int64> xFact(rxFact); + boost::rational<sal_Int64> yFact(ryFact); rRect.Left() =rRef.X()+Round(((double)(rRect.Left() -rRef.X())*xFact.numerator())/xFact.denominator()); rRect.Right() =rRef.X()+Round(((double)(rRect.Right() -rRef.X())*xFact.numerator())/xFact.denominator()); @@ -45,7 +45,7 @@ void ResizeRect(Rectangle& rRect, const Point& rRef, const boost::rational<long> } -void ResizePoly(Polygon& rPoly, const Point& rRef, const boost::rational<long>& xFact, const boost::rational<long>& yFact) +void ResizePoly(Polygon& rPoly, const Point& rRef, const boost::rational<sal_Int64>& xFact, const boost::rational<sal_Int64>& yFact) { sal_uInt16 nAnz=rPoly.GetSize(); for (sal_uInt16 i=0; i<nAnz; i++) { @@ -53,7 +53,7 @@ void ResizePoly(Polygon& rPoly, const Point& rRef, const boost::rational<long>& } } -void ResizeXPoly(XPolygon& rPoly, const Point& rRef, const boost::rational<long>& xFact, const boost::rational<long>& yFact) +void ResizeXPoly(XPolygon& rPoly, const Point& rRef, const boost::rational<sal_Int64>& xFact, const boost::rational<sal_Int64>& yFact) { sal_uInt16 nAnz=rPoly.GetPointCount(); for (sal_uInt16 i=0; i<nAnz; i++) { @@ -570,7 +570,7 @@ long BigMulDiv(long nVal, long nMul, long nDiv) return 0x7fffffff; } -void Kuerzen(boost::rational<long>& rF, unsigned nDigits) +void Kuerzen(boost::rational<sal_Int64>& rF, unsigned nDigits) { sal_Int32 nMul=rF.numerator(); sal_Int32 nDiv=rF.denominator(); @@ -599,7 +599,7 @@ void Kuerzen(boost::rational<long>& rF, unsigned nDigits) return; } if (bNeg) nMul=-nMul; - rF=boost::rational<long>(nMul,nDiv); + rF=boost::rational<sal_Int64>(nMul,nDiv); } @@ -635,7 +635,7 @@ FrPair GetInchOrMM(MapUnit eU) } default: break; } - return boost::rational<long>(1,1); + return boost::rational<sal_Int64>(1,1); } FrPair GetInchOrMM(FieldUnit eU) @@ -654,7 +654,7 @@ FrPair GetInchOrMM(FieldUnit eU) case FUNIT_MILE : return FrPair( 1,63360); default: break; } - return boost::rational<long>(1,1); + return boost::rational<sal_Int64>(1,1); } // Calculate the factor that we need to convert units from eS to eD. @@ -668,8 +668,8 @@ FrPair GetMapFactor(MapUnit eS, MapUnit eD) bool bSInch=IsInch(eS); bool bDInch=IsInch(eD); FrPair aRet(aD.X()/aS.X(),aD.Y()/aS.Y()); - if (bSInch && !bDInch) { aRet.X()*=boost::rational<long>(127,5); aRet.Y()*=boost::rational<long>(127,5); } - if (!bSInch && bDInch) { aRet.X()*=boost::rational<long>(5,127); aRet.Y()*=boost::rational<long>(5,127); } + if (bSInch && !bDInch) { aRet.X()*=boost::rational<sal_Int64>(127,5); aRet.Y()*=boost::rational<sal_Int64>(127,5); } + if (!bSInch && bDInch) { aRet.X()*=boost::rational<sal_Int64>(5,127); aRet.Y()*=boost::rational<sal_Int64>(5,127); } return aRet; }; @@ -681,8 +681,8 @@ FrPair GetMapFactor(FieldUnit eS, FieldUnit eD) bool bSInch=IsInch(eS); bool bDInch=IsInch(eD); FrPair aRet(aD.X()/aS.X(),aD.Y()/aS.Y()); - if (bSInch && !bDInch) { aRet.X()*=boost::rational<long>(127,5); aRet.Y()*=boost::rational<long>(127,5); } - if (!bSInch && bDInch) { aRet.X()*=boost::rational<long>(5,127); aRet.Y()*=boost::rational<long>(5,127); } + if (bSInch && !bDInch) { aRet.X()*=boost::rational<sal_Int64>(127,5); aRet.Y()*=boost::rational<sal_Int64>(127,5); } + if (!bSInch && bDInch) { aRet.X()*=boost::rational<sal_Int64>(5,127); aRet.Y()*=boost::rational<sal_Int64>(5,127); } return aRet; }; @@ -763,7 +763,7 @@ void GetMeterOrInch(FieldUnit eFU, short& rnKomma, long& rnMul, long& rnDiv, boo void SdrFormatter::Undirty() { - if (aScale.numerator()==0) aScale=boost::rational<long>(1,1); + if (aScale.numerator()==0) aScale=boost::rational<sal_Int64>(1,1); bool bSrcMetr,bSrcInch,bDstMetr,bDstInch; long nMul1,nDiv1,nMul2,nDiv2; short nKomma1,nKomma2; @@ -792,7 +792,7 @@ void SdrFormatter::Undirty() } // temporary fraction for canceling - boost::rational<long> aTempFract(nMul1,nDiv1); + boost::rational<sal_Int64> aTempFract(nMul1,nDiv1); nMul1=aTempFract.numerator(); nDiv1=aTempFract.denominator(); diff --git a/svx/source/svdraw/svdview.cxx b/svx/source/svdraw/svdview.cxx index eadfbcf02977..b70743cdd726 100644 --- a/svx/source/svdraw/svdview.cxx +++ b/svx/source/svdraw/svdview.cxx @@ -480,8 +480,8 @@ SdrHitKind SdrView::PickAnything(const Point& rLogicPos, SdrViewEvent& rVEvt) co // account for FitToSize bool bFitToSize(pTextObj->IsFitToSize()); if (bFitToSize) { - boost::rational<long> aX(aTextRect.GetWidth()-1, std::max(aAnchor.GetWidth()-1, 1L)); - boost::rational<long> aY(aTextRect.GetHeight()-1, std::max(aAnchor.GetHeight()-1, 1L)); + boost::rational<sal_Int64> aX(aTextRect.GetWidth()-1, std::max(aAnchor.GetWidth()-1, 1L)); + boost::rational<sal_Int64> aY(aTextRect.GetHeight()-1, std::max(aAnchor.GetHeight()-1, 1L)); ResizePoint(aTemporaryTextRelativePosition,Point(),aX,aY); } // account for rotation diff --git a/svx/source/svdraw/svdxcgv.cxx b/svx/source/svdraw/svdxcgv.cxx index 1b070a17f1f2..51790c335289 100644 --- a/svx/source/svdraw/svdxcgv.cxx +++ b/svx/source/svdraw/svdxcgv.cxx @@ -160,7 +160,7 @@ bool SdrExchangeView::Paste(const OUString& rStr, const Point& rPos, SdrObjList* pObj->FitFrameToTextSize(); Size aSiz(pObj->GetLogicRect().GetSize()); MapUnit eMap=pMod->GetScaleUnit(); - boost::rational<long> aMap=pMod->GetScaleFraction(); + boost::rational<sal_Int64> aMap=pMod->GetScaleFraction(); ImpPasteObject(pObj,*pLst,aPos,aSiz,MapMode(eMap,Point(0,0),aMap,aMap),nOptions); return true; } @@ -197,7 +197,7 @@ bool SdrExchangeView::Paste(SvStream& rInput, const OUString& rBaseURL, sal_uInt pObj->FitFrameToTextSize(); Size aSiz(pObj->GetLogicRect().GetSize()); MapUnit eMap=pMod->GetScaleUnit(); - boost::rational<long> aMap=pMod->GetScaleFraction(); + boost::rational<sal_Int64> aMap=pMod->GetScaleFraction(); ImpPasteObject(pObj,*pLst,aPos,aSiz,MapMode(eMap,Point(0,0),aMap,aMap),nOptions); // b4967543 @@ -267,7 +267,7 @@ bool SdrExchangeView::Paste( MapUnit eSrcUnit=pSrcMod->GetScaleUnit(); MapUnit eDstUnit=pMod->GetScaleUnit(); bool bResize=eSrcUnit!=eDstUnit; - boost::rational<long> xResize,yResize; + boost::rational<sal_Int64> xResize,yResize; Point aPt0; if (bResize) { @@ -403,7 +403,7 @@ void SdrExchangeView::ImpPasteObject(SdrObject* pObj, SdrObjList& rLst, const Po MapUnit eSrcMU=rMap.GetMapUnit(); MapUnit eDstMU=pMod->GetScaleUnit(); FrPair aMapFact(GetMapFactor(eSrcMU,eDstMU)); - boost::rational<long> aDstFr(pMod->GetScaleFraction()); + boost::rational<sal_Int64> aDstFr(pMod->GetScaleFraction()); nSizX*=aMapFact.X().numerator(); nSizX*=rMap.GetScaleX().numerator(); nSizX*=aDstFr.denominator(); |