diff options
-rw-r--r-- | sd/source/core/CustomAnimationEffect.cxx | 17 | ||||
-rw-r--r-- | svx/inc/svx/svdobj.hxx | 3 | ||||
-rw-r--r-- | svx/inc/svx/svdogrp.hxx | 3 | ||||
-rw-r--r-- | svx/inc/svx/svdovirt.hxx | 2 | ||||
-rw-r--r-- | svx/source/svdraw/svdobj.cxx | 6 | ||||
-rw-r--r-- | svx/source/svdraw/svdogrp.cxx | 12 | ||||
-rw-r--r-- | svx/source/svdraw/svdovirt.cxx | 2 | ||||
-rw-r--r-- | sw/inc/dcontact.hxx | 2 | ||||
-rw-r--r-- | sw/source/core/draw/dcontact.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/draw/dflyobj.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/inc/dflyobj.hxx | 2 |
11 files changed, 25 insertions, 28 deletions
diff --git a/sd/source/core/CustomAnimationEffect.cxx b/sd/source/core/CustomAnimationEffect.cxx index 7deb7cfa0ed9..47b47d126c11 100644 --- a/sd/source/core/CustomAnimationEffect.cxx +++ b/sd/source/core/CustomAnimationEffect.cxx @@ -69,6 +69,8 @@ #include <cppuhelper/implbase1.hxx> +#include <drawinglayer/geometry/viewinformation2d.hxx> +#include <svx/sdr/contact/viewcontact.hxx> #include <svx/svdopath.hxx> #include <svx/svdpage.hxx> #include <svx/unoapi.hxx> @@ -1735,8 +1737,19 @@ void CustomAnimationEffect::updatePathFromSdrPathObj( const SdrPathObj& rPathObj SdrObject* pObj = GetSdrObjectFromXShape( getTargetShape() ); if( pObj ) { - pObj->RecalcBoundRect(true); - const Rectangle aBoundRect( pObj->GetCurrentBoundRect() ); + Rectangle aBoundRect(0,0,0,0); + + const drawinglayer::primitive2d::Primitive2DSequence xPrimitives(pObj->GetViewContact().getViewIndependentPrimitive2DSequence()); + const drawinglayer::geometry::ViewInformation2D aViewInformation2D; + const basegfx::B2DRange aRange(drawinglayer::primitive2d::getB2DRangeFromPrimitive2DSequence(xPrimitives, aViewInformation2D)); + + if(!aRange.isEmpty()) + { + aBoundRect = Rectangle( + (sal_Int32)floor(aRange.getMinX()), (sal_Int32)floor(aRange.getMinY()), + (sal_Int32)ceil(aRange.getMaxX()), (sal_Int32)ceil(aRange.getMaxY())); + } + const Point aCenter( aBoundRect.Center() ); xPolyPoly.transform(basegfx::tools::createTranslateB2DHomMatrix(-aCenter.X(), -aCenter.Y())); diff --git a/svx/inc/svx/svdobj.hxx b/svx/inc/svx/svdobj.hxx index 2b69930c28bf..1bac35e49232 100644 --- a/svx/inc/svx/svdobj.hxx +++ b/svx/inc/svx/svdobj.hxx @@ -660,8 +660,7 @@ public: // a new method for accessing the last BoundRect. virtual const Rectangle& GetLastBoundRect() const; - // If bForced is true, the boundrect is also calculated when the model is locked - virtual void RecalcBoundRect(bool bForced = false); + virtual void RecalcBoundRect(); void BroadcastObjectChange() const; diff --git a/svx/inc/svx/svdogrp.hxx b/svx/inc/svx/svdogrp.hxx index 5b96c38ddacb..7e48ec372ae7 100644 --- a/svx/inc/svx/svdogrp.hxx +++ b/svx/inc/svx/svdogrp.hxx @@ -80,9 +80,6 @@ public: virtual const Rectangle& GetCurrentBoundRect() const; virtual const Rectangle& GetSnapRect() const; - // If bForced is true, the boundrect is also calculated when the model is locked - virtual void RecalcBoundRect(bool bForced = false); - virtual SdrObjGroup* Clone() const; SdrObjGroup& operator=(const SdrObjGroup& rObj); diff --git a/svx/inc/svx/svdovirt.hxx b/svx/inc/svx/svdovirt.hxx index 5d05a68b43cf..95536ef3bc40 100644 --- a/svx/inc/svx/svdovirt.hxx +++ b/svx/inc/svx/svdovirt.hxx @@ -76,7 +76,7 @@ public: virtual const Rectangle& GetCurrentBoundRect() const; virtual const Rectangle& GetLastBoundRect() const; - virtual void RecalcBoundRect(bool bForced = false); + virtual void RecalcBoundRect(); virtual void SetChanged(); virtual SdrVirtObj* Clone() const; SdrVirtObj& operator=(const SdrVirtObj& rObj); diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx index d5a2fe3fab0b..d96080bcd99d 100644 --- a/svx/source/svdraw/svdobj.cxx +++ b/svx/source/svdraw/svdobj.cxx @@ -828,14 +828,14 @@ const Rectangle& SdrObject::GetLastBoundRect() const return aOutRect; } -void SdrObject::RecalcBoundRect(bool bForced) +void SdrObject::RecalcBoundRect() { // #i101680# suppress BoundRect calculations on import(s) - if(pModel && pModel->isLocked() && !bForced ) + if(pModel && pModel->isLocked()) return; // central new method which will calculate the BoundRect using primitive geometry - if(aOutRect.IsEmpty() || bForced) + if(aOutRect.IsEmpty()) { const drawinglayer::primitive2d::Primitive2DSequence xPrimitives(GetViewContact().getViewIndependentPrimitive2DSequence()); diff --git a/svx/source/svdraw/svdogrp.cxx b/svx/source/svdraw/svdogrp.cxx index ff5fec569796..df0fe3f8d674 100644 --- a/svx/source/svdraw/svdogrp.cxx +++ b/svx/source/svdraw/svdogrp.cxx @@ -267,18 +267,6 @@ const Rectangle& SdrObjGroup::GetCurrentBoundRect() const return aOutRect; } -void SdrObjGroup::RecalcBoundRect(bool bForced) -{ - if( bForced ) - { - sal_uIntPtr nAnz=pSub->GetObjCount(); - for( sal_uIntPtr i=0; i<nAnz; i++) - pSub->GetObj(i)->RecalcBoundRect(true); - } - - SdrObject::RecalcBoundRect(bForced); -} - const Rectangle& SdrObjGroup::GetSnapRect() const { // <aOutRect> has to contain the bounding rectangle diff --git a/svx/source/svdraw/svdovirt.cxx b/svx/source/svdraw/svdovirt.cxx index 10fa828dc40c..2aa7d0e0351e 100644 --- a/svx/source/svdraw/svdovirt.cxx +++ b/svx/source/svdraw/svdovirt.cxx @@ -137,7 +137,7 @@ const Rectangle& SdrVirtObj::GetLastBoundRect() const return aOutRect; } -void SdrVirtObj::RecalcBoundRect(bool) +void SdrVirtObj::RecalcBoundRect() { aOutRect=rRefObj.GetCurrentBoundRect(); aOutRect+=aAnchor; diff --git a/sw/inc/dcontact.hxx b/sw/inc/dcontact.hxx index 4c2bb433108e..ff317e5e40d4 100644 --- a/sw/inc/dcontact.hxx +++ b/sw/inc/dcontact.hxx @@ -293,7 +293,7 @@ class SwDrawVirtObj : public SdrVirtObj virtual void NbcSetAnchorPos(const Point& rPnt); // All overloaded methods which need to use the offset - virtual void RecalcBoundRect(bool bForce = false); + virtual void RecalcBoundRect(); virtual ::basegfx::B2DPolyPolygon TakeXorPoly() const; virtual ::basegfx::B2DPolyPolygon TakeContour() const; virtual SdrHdl* GetHdl(sal_uInt32 nHdlNum) const; diff --git a/sw/source/core/draw/dcontact.cxx b/sw/source/core/draw/dcontact.cxx index 38ec0a01f508..998b1672ba83 100644 --- a/sw/source/core/draw/dcontact.cxx +++ b/sw/source/core/draw/dcontact.cxx @@ -2384,7 +2384,7 @@ void SwDrawVirtObj::SetBoundRectDirty() // do nothing to not lose model information in aOutRect } -void SwDrawVirtObj::RecalcBoundRect(bool) +void SwDrawVirtObj::RecalcBoundRect() { // OD 2004-04-05 #i26791# - switch order of calling <GetOffset()> and // <ReferencedObj().GetCurrentBoundRect()>, because <GetOffset()> calculates diff --git a/sw/source/core/draw/dflyobj.cxx b/sw/source/core/draw/dflyobj.cxx index 82629d804f3d..6eac60586127 100644 --- a/sw/source/core/draw/dflyobj.cxx +++ b/sw/source/core/draw/dflyobj.cxx @@ -582,7 +582,7 @@ const Rectangle& SwVirtFlyDrawObj::GetLastBoundRect() const } -void SwVirtFlyDrawObj::RecalcBoundRect(bool) +void SwVirtFlyDrawObj::RecalcBoundRect() { SetRect(); } diff --git a/sw/source/core/inc/dflyobj.hxx b/sw/source/core/inc/dflyobj.hxx index 1ac349decc0d..9e3cf0dff55e 100644 --- a/sw/source/core/inc/dflyobj.hxx +++ b/sw/source/core/inc/dflyobj.hxx @@ -102,7 +102,7 @@ public: //Wir nehemen die Groessenbehandlung vollstaendig selbst in die Hand. virtual const Rectangle& GetCurrentBoundRect() const; virtual const Rectangle& GetLastBoundRect() const; - virtual void RecalcBoundRect(bool bForce = false); + virtual void RecalcBoundRect(); virtual void RecalcSnapRect(); virtual const Rectangle& GetSnapRect() const; virtual void SetSnapRect(const Rectangle& rRect); |