diff options
author | Christian Lippka ORACLE <christian.lippka@oracle.com> | 2011-03-09 18:32:29 +0100 |
---|---|---|
committer | Christian Lippka ORACLE <christian.lippka@oracle.com> | 2011-03-09 18:32:29 +0100 |
commit | d30085b1ee435059d01a3d8d947803ebd91041c2 (patch) | |
tree | 84eadcdf46e95010f3fa1ea414640bbd2b285f50 /sd/source | |
parent | f269295e80eba9515f48f09561d04594b2652469 (diff) |
impress210: #i41995# fixed import of path animation from sxi files
Diffstat (limited to 'sd/source')
-rwxr-xr-x | sd/source/core/CustomAnimationEffect.cxx | 1 | ||||
-rwxr-xr-x[-rw-r--r--] | sd/source/core/EffectMigration.cxx | 26 | ||||
-rwxr-xr-x | sd/source/ui/unoidl/unoobj.cxx | 27 |
3 files changed, 31 insertions, 23 deletions
diff --git a/sd/source/core/CustomAnimationEffect.cxx b/sd/source/core/CustomAnimationEffect.cxx index 33b9c233909b..52d53426f133 100755 --- a/sd/source/core/CustomAnimationEffect.cxx +++ b/sd/source/core/CustomAnimationEffect.cxx @@ -1738,6 +1738,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 cbb9a1019baf..751ce0911cfc 100644..100755 --- a/sd/source/core/EffectMigration.cxx +++ b/sd/source/core/EffectMigration.cxx @@ -33,6 +33,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> @@ -1342,3 +1343,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 ) ); + } + } + } +} + + diff --git a/sd/source/ui/unoidl/unoobj.cxx b/sd/source/ui/unoidl/unoobj.cxx index 681aad8f44ed..ddb115a21525 100755 --- a/sd/source/ui/unoidl/unoobj.cxx +++ b/sd/source/ui/unoidl/unoobj.cxx @@ -658,36 +658,17 @@ void SAL_CALL SdXShape::setPropertyValue( const ::rtl::OUString& aPropertyName, case WID_MASTERDEPEND: SetMasterDepend( ::cppu::any2bool(aValue) ); break; -/* todo case WID_ANIMPATH: { - uno::Reference< drawing::XShape > xShape; - aValue >>= xShape; + uno::Reference< drawing::XShape > xShape( aValue, uno::UNO_QUERY ); + SdrPathObj* pObj = xShape.is() ? dynamic_cast< SdrPathObj* >( GetSdrObjectFromXShape( xShape ) ) : NULL; - SdrObject* pObj = NULL; - if(xShape.is()) - pObj = GetSdrObjectFromXShape( xShape ); - - if( pObj == NULL || !pObj->ISA( SdrPathObj ) ) + if( pObj == NULL ) throw lang::IllegalArgumentException(); - pInfo->mpPathObj = (SdrPathObj*)pObj; - - SdDrawDocument* pDoc = mpModel?mpModel->GetDoc():NULL; - if( pDoc ) - { - pInfo = pDoc->GetAnimationInfo(pObj); - if( pInfo == NULL ) - { - pInfo = new SdAnimationInfo(pDoc); - pObj->InsertUserData( pInfo ); - } - pInfo->mbInvisibleInPresentation = sal_True; - } - + EffectMigration::SetAnimationPath( mpShape, pObj ); break; } -*/ case WID_IMAGEMAP: { SdDrawDocument* pDoc = mpModel?mpModel->GetDoc():NULL; |