summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Lippka ORACLE <christian.lippka@oracle.com>2011-12-06 02:48:42 +0100
committerThorsten Behrens <tbehrens@suse.com>2011-12-06 09:39:12 +0100
commitf0a1b95f99bed6d184e3020b5c7e30bc6c1597f6 (patch)
treee30279438605a800855f9e2ce65accbdc6b88d91
parent15aeab6cbd0b50b1d78646f03588237b8473285c (diff)
impress210: #i41995# fixed import of path animation from sxi files
# HG changeset patch # User Christian Lippka ORACLE <christian.lippka@oracle.com> # Date 1299691949 -3600 # Node ID 8edc33ef50a3b6ebbc4e88d574b6b1ba57b1dbaa # Parent 0b9b11216b0d3401f8824542dd5f2794eb141035 impress210: #i41995# fixed import of path animation from sxi files
-rw-r--r--sd/inc/EffectMigration.hxx3
-rw-r--r--sd/source/core/CustomAnimationEffect.cxx1
-rw-r--r--sd/source/core/EffectMigration.cxx25
-rw-r--r--sd/source/ui/unoidl/unoobj.cxx12
-rw-r--r--svx/inc/svx/svdobj.hxx3
-rw-r--r--svx/inc/svx/svdogrp.hxx3
-rw-r--r--svx/inc/svx/svdovirt.hxx2
-rw-r--r--svx/source/svdraw/svdobj.cxx6
-rw-r--r--svx/source/svdraw/svdogrp.cxx11
-rw-r--r--svx/source/svdraw/svdovirt.cxx2
-rw-r--r--sw/inc/dcontact.hxx2
-rw-r--r--sw/source/core/draw/dcontact.cxx2
-rw-r--r--sw/source/core/draw/dflyobj.cxx2
-rw-r--r--sw/source/core/inc/dflyobj.hxx2
14 files changed, 65 insertions, 11 deletions
diff --git a/sd/inc/EffectMigration.hxx b/sd/inc/EffectMigration.hxx
index 03fd55303422..59e19dacdb70 100644
--- a/sd/inc/EffectMigration.hxx
+++ b/sd/inc/EffectMigration.hxx
@@ -37,6 +37,7 @@ class SdPage;
class SvxShape;
class SdAnimationInfo;
class SdrObject;
+class SdrPathObj;
namespace sd {
@@ -77,6 +78,8 @@ public:
static void UpdateSoundEffect( SvxShape* pShape, SdAnimationInfo* pInfo );
static ::rtl::OUString GetSoundFile( SvxShape* pShape );
static sal_Bool GetSoundOn( SvxShape* pShape );
+
+ static void SetAnimationPath( SvxShape* pShape, SdrPathObj* pPathObj );
};
} // end of namespace sd
diff --git a/sd/source/core/CustomAnimationEffect.cxx b/sd/source/core/CustomAnimationEffect.cxx
index 054fcd0c4748..7deb7cfa0ed9 100644
--- a/sd/source/core/CustomAnimationEffect.cxx
+++ b/sd/source/core/CustomAnimationEffect.cxx
@@ -1735,6 +1735,7 @@ void CustomAnimationEffect::updatePathFromSdrPathObj( const SdrPathObj& rPathObj
SdrObject* pObj = GetSdrObjectFromXShape( getTargetShape() );
if( pObj )
{
+ pObj->RecalcBoundRect(true);
const Rectangle aBoundRect( pObj->GetCurrentBoundRect() );
const Point aCenter( aBoundRect.Center() );
diff --git a/sd/source/core/EffectMigration.cxx b/sd/source/core/EffectMigration.cxx
index 9d03a10fafed..f90808d9368a 100644
--- a/sd/source/core/EffectMigration.cxx
+++ b/sd/source/core/EffectMigration.cxx
@@ -32,6 +32,7 @@
#include <com/sun/star/presentation/ParagraphTarget.hpp>
#include <svx/unoshape.hxx>
#include <svx/svdotext.hxx>
+#include <svx/svdopath.hxx>
#include "drawdoc.hxx"
#include "sdpage.hxx"
#include <CustomAnimationPreset.hxx>
@@ -1319,4 +1320,28 @@ sal_Bool EffectMigration::GetSoundOn( SvxShape* pShape )
return GetSoundFile( pShape ).getLength() != 0;
}
+// --------------------------------------------------------------------
+
+void EffectMigration::SetAnimationPath( SvxShape* pShape, SdrPathObj* pPathObj )
+{
+ if( pShape && pPathObj )
+ {
+ SdrObject* pObj = pShape->GetSdrObject();
+
+ if( pObj )
+ {
+ sd::MainSequencePtr pMainSequence = static_cast<SdPage*>(pObj->GetPage())->getMainSequence();
+
+ const Reference< XShape > xShape( pShape );
+ SdPage* pPage = dynamic_cast< SdPage* >( pPathObj ? pPathObj->GetPage() : 0 );
+ if( pPage )
+ {
+ boost::shared_ptr< sd::MainSequence > pMainSequence( pPage->getMainSequence() );
+ if( pMainSequence.get() )
+ CustomAnimationEffectPtr pCreated( pMainSequence->append( *pPathObj, makeAny( xShape ), -1.0 ) );
+ }
+ }
+ }
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/source/ui/unoidl/unoobj.cxx b/sd/source/ui/unoidl/unoobj.cxx
index 8f1ab65abcee..8341121af06a 100644
--- a/sd/source/ui/unoidl/unoobj.cxx
+++ b/sd/source/ui/unoidl/unoobj.cxx
@@ -644,7 +644,17 @@ void SAL_CALL SdXShape::setPropertyValue( const ::rtl::OUString& aPropertyName,
}
}
break;
-// TODO: WID_ANIMPATH
+ case WID_ANIMPATH:
+ {
+ uno::Reference< drawing::XShape > xShape( aValue, uno::UNO_QUERY );
+ SdrPathObj* pObj = xShape.is() ? dynamic_cast< SdrPathObj* >( GetSdrObjectFromXShape( xShape ) ) : NULL;
+
+ if( pObj == NULL )
+ throw lang::IllegalArgumentException();
+
+ EffectMigration::SetAnimationPath( mpShape, pObj );
+ break;
+ }
case WID_IMAGEMAP:
{
SdDrawDocument* pDoc = mpModel?mpModel->GetDoc():NULL;
diff --git a/svx/inc/svx/svdobj.hxx b/svx/inc/svx/svdobj.hxx
index 1bac35e49232..2b69930c28bf 100644
--- a/svx/inc/svx/svdobj.hxx
+++ b/svx/inc/svx/svdobj.hxx
@@ -660,7 +660,8 @@ public:
// a new method for accessing the last BoundRect.
virtual const Rectangle& GetLastBoundRect() const;
- virtual void RecalcBoundRect();
+ // If bForced is true, the boundrect is also calculated when the model is locked
+ virtual void RecalcBoundRect(bool bForced = false);
void BroadcastObjectChange() const;
diff --git a/svx/inc/svx/svdogrp.hxx b/svx/inc/svx/svdogrp.hxx
index 7e48ec372ae7..5b96c38ddacb 100644
--- a/svx/inc/svx/svdogrp.hxx
+++ b/svx/inc/svx/svdogrp.hxx
@@ -80,6 +80,9 @@ 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 95536ef3bc40..5d05a68b43cf 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();
+ virtual void RecalcBoundRect(bool bForced = false);
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 5a11ca6fc1cd..d5a2fe3fab0b 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()
+void SdrObject::RecalcBoundRect(bool bForced)
{
// #i101680# suppress BoundRect calculations on import(s)
- if(pModel && pModel->isLocked() )
+ if(pModel && pModel->isLocked() && !bForced )
return;
// central new method which will calculate the BoundRect using primitive geometry
- if(aOutRect.IsEmpty())
+ if(aOutRect.IsEmpty() || bForced)
{
const drawinglayer::primitive2d::Primitive2DSequence xPrimitives(GetViewContact().getViewIndependentPrimitive2DSequence());
diff --git a/svx/source/svdraw/svdogrp.cxx b/svx/source/svdraw/svdogrp.cxx
index 1e5206298c16..ff5fec569796 100644
--- a/svx/source/svdraw/svdogrp.cxx
+++ b/svx/source/svdraw/svdogrp.cxx
@@ -267,6 +267,17 @@ 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
{
diff --git a/svx/source/svdraw/svdovirt.cxx b/svx/source/svdraw/svdovirt.cxx
index 2aa7d0e0351e..b8155eac4787 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()
+void SdrVirtObj::RecalcBoundRect(bool bForced)
{
aOutRect=rRefObj.GetCurrentBoundRect();
aOutRect+=aAnchor;
diff --git a/sw/inc/dcontact.hxx b/sw/inc/dcontact.hxx
index ff317e5e40d4..4c2bb433108e 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();
+ virtual void RecalcBoundRect(bool bForce = false);
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 998b1672ba83..38ec0a01f508 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()
+void SwDrawVirtObj::RecalcBoundRect(bool)
{
// 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 6eac60586127..82629d804f3d 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()
+void SwVirtFlyDrawObj::RecalcBoundRect(bool)
{
SetRect();
}
diff --git a/sw/source/core/inc/dflyobj.hxx b/sw/source/core/inc/dflyobj.hxx
index 9e3cf0dff55e..1ac349decc0d 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();
+ virtual void RecalcBoundRect(bool bForce = false);
virtual void RecalcSnapRect();
virtual const Rectangle& GetSnapRect() const;
virtual void SetSnapRect(const Rectangle& rRect);