summaryrefslogtreecommitdiff
path: root/sd/source/core/undoanim.cxx
diff options
context:
space:
mode:
authorKurt Zenker <kz@openoffice.org>2005-01-21 17:17:47 +0000
committerKurt Zenker <kz@openoffice.org>2005-01-21 17:17:47 +0000
commit2beb6fefc76f2fb9e6dd9c734ae9a92c856a6e60 (patch)
treee688cb882d271aaabc942abf24e5d59aedca2d73 /sd/source/core/undoanim.cxx
parentd145413db8b798f7c6b9b70e540ea91fb0be5800 (diff)
INTEGRATION: CWS impress28 (1.2.38); FILE MERGED
2005/01/19 13:50:09 cl 1.2.38.2: #i39941# added undo for animation when shapes are deleted 2005/01/06 11:50:20 cl 1.2.38.1: #i39941# added undo for animation when shapes are deleted
Diffstat (limited to 'sd/source/core/undoanim.cxx')
-rw-r--r--sd/source/core/undoanim.cxx46
1 files changed, 35 insertions, 11 deletions
diff --git a/sd/source/core/undoanim.cxx b/sd/source/core/undoanim.cxx
index 45ceb6560f61..5e81ca9d0463 100644
--- a/sd/source/core/undoanim.cxx
+++ b/sd/source/core/undoanim.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: undoanim.cxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: rt $ $Date: 2004-11-26 19:48:02 $
+ * last change: $Author: kz $ $Date: 2005-01-21 18:17:47 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -71,6 +71,7 @@
#include "sdpage.hxx"
#include "sdresid.hxx"
#include "CustomAnimationEffect.hxx"
+#include "drawdoc.hxx"
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Exception;
@@ -90,7 +91,7 @@ struct UndoAnimationImpl
};
UndoAnimation::UndoAnimation( SdDrawDocument* pDoc, SdPage* pThePage )
-: SdUndoAction( pDoc ), mpImpl( new UndoAnimationImpl )
+: SdrUndoAction( *pDoc ), mpImpl( new UndoAnimationImpl )
{
mpImpl->mpPage = pThePage;
@@ -117,19 +118,42 @@ UndoAnimation::~UndoAnimation()
void UndoAnimation::Undo()
{
- if( !mpImpl->mxNewNode.is() )
- mpImpl->mxNewNode = mpImpl->mpPage->mxAnimationNode;
+ try
+ {
+ if( !mpImpl->mxNewNode.is() )
+ {
+ Reference< XCloneable > xCloneAble( mpImpl->mpPage->mxAnimationNode, UNO_QUERY_THROW );
+ mpImpl->mxNewNode.set( xCloneAble->createClone(), UNO_QUERY_THROW );
+ }
+
+ Reference< XCloneable > xCloneAble( mpImpl->mxOldNode, UNO_QUERY_THROW );
+ Reference< XAnimationNode > xClone( xCloneAble->createClone(), UNO_QUERY_THROW );
- mpImpl->mpPage->mxAnimationNode = mpImpl->mxOldNode;
- if( mpImpl->mpPage->mpMainSequence.get() )
- mpImpl->mpPage->mpMainSequence->init( mpImpl->mxOldNode );
+ mpImpl->mpPage->mxAnimationNode = xClone;
+ if( mpImpl->mpPage->mpMainSequence.get() )
+ mpImpl->mpPage->mpMainSequence->init( xClone );
+ }
+ catch( Exception& e )
+ {
+ (void)e;
+ DBG_ERROR("sd::UndoAnimation::Undo(), exception caught!");
+ }
}
void UndoAnimation::Redo()
{
- mpImpl->mpPage->mxAnimationNode = mpImpl->mxNewNode;
- if( mpImpl->mpPage->mpMainSequence.get() )
- mpImpl->mpPage->mpMainSequence->init( mpImpl->mxNewNode );
+ try
+ {
+ Reference< XCloneable > xCloneAble( mpImpl->mxNewNode, UNO_QUERY_THROW );
+ mpImpl->mpPage->mxAnimationNode.set( xCloneAble->createClone(), UNO_QUERY_THROW );
+ if( mpImpl->mpPage->mpMainSequence.get() )
+ mpImpl->mpPage->mpMainSequence->init( mpImpl->mpPage->mxAnimationNode );
+ }
+ catch( Exception& e )
+ {
+ (void)e;
+ DBG_ERROR("sd::UndoAnimation::Redo(), exception caught!");
+ }
}
void UndoAnimation::Repeat()