summaryrefslogtreecommitdiff
path: root/sd/source/core/undoanim.cxx
diff options
context:
space:
mode:
authorRĂ¼diger Timm <rt@openoffice.org>2007-07-06 12:10:25 +0000
committerRĂ¼diger Timm <rt@openoffice.org>2007-07-06 12:10:25 +0000
commitd730847f9797b3d38458ac2a311a4cf122001463 (patch)
treef5983580aca945c915f79a9a0fed7ca9adbe81a9 /sd/source/core/undoanim.cxx
parentd3dfb98c7132491d700b9ea341cdeaf4eabff383 (diff)
INTEGRATION: CWS pathfinder01 (1.11.126); FILE MERGED
2007/07/03 17:18:30 cl 1.11.126.3: #i41800# implemented support for path animation editing for custom animations 2007/07/03 14:30:14 cl 1.11.126.2: #i41800# implemented support for path animation editing for custom animations 2007/07/03 13:05:45 cl 1.11.126.1: #i41800# implemented support for path animation editing for custom animations
Diffstat (limited to 'sd/source/core/undoanim.cxx')
-rw-r--r--sd/source/core/undoanim.cxx82
1 files changed, 80 insertions, 2 deletions
diff --git a/sd/source/core/undoanim.cxx b/sd/source/core/undoanim.cxx
index 2c9ca2ff7bd5..964c284c135e 100644
--- a/sd/source/core/undoanim.cxx
+++ b/sd/source/core/undoanim.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: undoanim.cxx,v $
*
- * $Revision: 1.12 $
+ * $Revision: 1.13 $
*
- * last change: $Author: hr $ $Date: 2007-06-27 15:38:01 $
+ * last change: $Author: rt $ $Date: 2007-07-06 13:10:25 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -139,6 +139,84 @@ String UndoAnimation::GetComment() const
return String(SdResId(STR_UNDO_ANIMATION));
}
+struct UndoAnimationPathImpl
+{
+ SdPage* mpPage;
+ sal_Int32 mnEffectOffset;
+ ::rtl::OUString msUndoPath;
+ ::rtl::OUString msRedoPath;
+
+ UndoAnimationPathImpl( SdPage* pThePage, const com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode >& xNode )
+ : mpPage( pThePage )
+ , mnEffectOffset( -1 )
+ {
+ if( mpPage && xNode.is() )
+ {
+ boost::shared_ptr< sd::MainSequence > pMainSequence( mpPage->getMainSequence() );
+ if( pMainSequence.get() )
+ {
+ CustomAnimationEffectPtr pEffect( pMainSequence->findEffect( xNode ) );
+ if( pEffect.get() )
+ {
+ mnEffectOffset = pMainSequence->getOffsetFromEffect( pEffect );
+ msUndoPath = pEffect->getPath();
+ }
+ }
+ }
+ }
+
+ CustomAnimationEffectPtr getEffect() const
+ {
+ CustomAnimationEffectPtr pEffect;
+ if( mpPage && (mnEffectOffset >= 0) )
+ {
+ boost::shared_ptr< sd::MainSequence > pMainSequence( mpPage->getMainSequence() );
+ if( pMainSequence.get() )
+ pEffect = pMainSequence->getEffectFromOffset( mnEffectOffset );
+ }
+ return pEffect;
+ }
+
+ private:
+ UndoAnimationPathImpl( const UndoAnimationPathImpl& ); //not implemented
+ const UndoAnimationPathImpl& operator=( const UndoAnimationPathImpl& ); // not implemented
+
+};
+
+UndoAnimationPath::UndoAnimationPath( SdDrawDocument* pDoc, SdPage* pThePage, const com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode >& xNode )
+: SdrUndoAction( *pDoc )
+, mpImpl( new UndoAnimationPathImpl( pThePage, xNode ) )
+{
+}
+
+UndoAnimationPath::~UndoAnimationPath()
+{
+}
+
+void UndoAnimationPath::Undo()
+{
+ CustomAnimationEffectPtr pEffect = mpImpl->getEffect();
+ if( pEffect.get() )
+ {
+ mpImpl->msRedoPath = pEffect->getPath();
+ pEffect->setPath( mpImpl->msUndoPath );
+ }
+}
+
+void UndoAnimationPath::Redo()
+{
+ CustomAnimationEffectPtr pEffect = mpImpl->getEffect();
+ if( pEffect.get() )
+ {
+ pEffect->setPath( mpImpl->msRedoPath );
+ }
+}
+
+String UndoAnimationPath::GetComment() const
+{
+ return String(SdResId(STR_UNDO_ANIMATION));
+}
+
struct UndoTransitionImpl
{
SdPage* mpPage;