diff options
author | Christian Lippka ORACLE <christian.lippka@oracle.com> | 2011-03-30 10:57:41 +0200 |
---|---|---|
committer | Christian Lippka ORACLE <christian.lippka@oracle.com> | 2011-03-30 10:57:41 +0200 |
commit | 64fd6776945540e0ed3bd7e7467d4a00b6bcb7a0 (patch) | |
tree | aec9ecb20bf95096af99e37f5a57dea8c099665b | |
parent | 9ad72383ccd8e5c2dfede71439b487d052cbd98c (diff) |
impress210: #i41995# using view contact to get bound rect for old path animation import
-rwxr-xr-x | sd/source/core/CustomAnimationEffect.cxx | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/sd/source/core/CustomAnimationEffect.cxx b/sd/source/core/CustomAnimationEffect.cxx index 52d53426f133..9ce0084ddbd3 100755 --- a/sd/source/core/CustomAnimationEffect.cxx +++ b/sd/source/core/CustomAnimationEffect.cxx @@ -72,6 +72,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> @@ -1738,8 +1740,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())); |