summaryrefslogtreecommitdiff
path: root/sd
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 /sd
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
Diffstat (limited to 'sd')
-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
4 files changed, 40 insertions, 1 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;