diff options
Diffstat (limited to 'sd/source/ui/animations')
-rw-r--r-- | sd/source/ui/animations/CustomAnimationPane.cxx | 138 | ||||
-rw-r--r-- | sd/source/ui/animations/CustomAnimationPane.hxx | 3 | ||||
-rw-r--r-- | sd/source/ui/animations/SlideTransitionPane.cxx | 12 |
3 files changed, 64 insertions, 89 deletions
diff --git a/sd/source/ui/animations/CustomAnimationPane.cxx b/sd/source/ui/animations/CustomAnimationPane.cxx index ef3db270b6f3..237bdd198a7a 100644 --- a/sd/source/ui/animations/CustomAnimationPane.cxx +++ b/sd/source/ui/animations/CustomAnimationPane.cxx @@ -1740,37 +1740,6 @@ bool getTextSelection( const Any& rSelection, Reference< XShape >& xShape, std:: return false; } -void CustomAnimationPane::animationChange() -{ - if( maListSelection.size() == 1 ) - { - CustomAnimationPresetPtr* pPreset = static_cast< CustomAnimationPresetPtr* >(mpLBAnimation->GetSelectEntryData()); - // tdf#99137, the selected entry may also be a subcategory title, so not an effect - // just leave in this case - if (!pPreset) - return; - const double fDuration = (*pPreset)->getDuration(); - CustomAnimationPresetPtr pDescriptor(*pPreset); - MainSequenceRebuildGuard aGuard( mpMainSequence ); - - // get selected effect - EffectSequence::iterator aIter( maListSelection.begin() ); - const EffectSequence::iterator aEnd( maListSelection.end() ); - while( aIter != aEnd ) - { - CustomAnimationEffectPtr pEffect = (*aIter++); - - EffectSequenceHelper* pEffectSequence = pEffect->getEffectSequence(); - if( !pEffectSequence ) - pEffectSequence = mpMainSequence.get(); - - pEffectSequence->replace( pEffect, pDescriptor, fDuration ); - } - onPreview(false); - } - -} - void CustomAnimationPane::onAdd() { bool bHasText = true; @@ -1976,40 +1945,6 @@ void CustomAnimationPane::onChangeStart( sal_Int16 nNodeType ) } } -void CustomAnimationPane::onChangeProperty() -{ - if( mpLBProperty->getSubControl() ) - { - addUndo(); - - MainSequenceRebuildGuard aGuard( mpMainSequence ); - - const Any aValue( mpLBProperty->getSubControl()->getValue() ); - - bool bNeedUpdate = false; - - // change selected effect - EffectSequence::iterator aIter( maListSelection.begin() ); - const EffectSequence::iterator aEnd( maListSelection.end() ); - while( aIter != aEnd ) - { - CustomAnimationEffectPtr pEffect = (*aIter++); - - if( setProperty1Value( mnPropertyType, pEffect, aValue ) ) - bNeedUpdate = true; - } - - if( bNeedUpdate ) - { - mpMainSequence->rebuild(); - updateControls(); - mrBase.GetDocShell()->SetModified(); - } - - onPreview( false ); - } -} - void CustomAnimationPane::onChangeSpeed() { double fDuration = getDuration(); @@ -2051,12 +1986,66 @@ double CustomAnimationPane::getDuration() /// this link is called when the property box is modified by the user IMPL_LINK_NOARG(CustomAnimationPane, implPropertyHdl, LinkParamNone*, void) { - onChangeProperty(); + if( mpLBProperty->getSubControl() ) + { + addUndo(); + + MainSequenceRebuildGuard aGuard( mpMainSequence ); + + const Any aValue( mpLBProperty->getSubControl()->getValue() ); + + bool bNeedUpdate = false; + + // change selected effect + EffectSequence::iterator aIter( maListSelection.begin() ); + const EffectSequence::iterator aEnd( maListSelection.end() ); + while( aIter != aEnd ) + { + CustomAnimationEffectPtr pEffect = (*aIter++); + + if( setProperty1Value( mnPropertyType, pEffect, aValue ) ) + bNeedUpdate = true; + } + + if( bNeedUpdate ) + { + mpMainSequence->rebuild(); + updateControls(); + mrBase.GetDocShell()->SetModified(); + } + + onPreview( false ); + } } IMPL_LINK_NOARG(CustomAnimationPane, AnimationSelectHdl, ListBox&, void) { - animationChange(); + if( maListSelection.size() == 1 ) + { + CustomAnimationPresetPtr* pPreset = static_cast< CustomAnimationPresetPtr* >(mpLBAnimation->GetSelectEntryData()); + // tdf#99137, the selected entry may also be a subcategory title, so not an effect + // just leave in this case + if (!pPreset) + return; + const double fDuration = (*pPreset)->getDuration(); + CustomAnimationPresetPtr pDescriptor(*pPreset); + MainSequenceRebuildGuard aGuard( mpMainSequence ); + + // get selected effect + EffectSequence::iterator aIter( maListSelection.begin() ); + const EffectSequence::iterator aEnd( maListSelection.end() ); + while( aIter != aEnd ) + { + CustomAnimationEffectPtr pEffect = (*aIter++); + + EffectSequenceHelper* pEffectSequence = pEffect->getEffectSequence(); + if( !pEffectSequence ) + pEffectSequence = mpMainSequence.get(); + + pEffectSequence->replace( pEffect, pDescriptor, fDuration ); + } + onPreview(false); + } } IMPL_LINK_NOARG(CustomAnimationPane, UpdateAnimationLB, ListBox&, void) @@ -2327,14 +2316,6 @@ void CustomAnimationPane::preview( const Reference< XAnimationNode >& xAnimation SlideShow::StartPreview( mrBase, mxCurrentPage, xRoot ); } -// ICustomAnimationListController -void CustomAnimationPane::onSelect() -{ - maListSelection = mpCustomAnimationList->getSelection(); - updateControls(); - markShapesFromSelectedEffects(); -} - const CustomAnimationPresets& CustomAnimationPane::getPresets() { if (mpCustomAnimationPresets == nullptr) @@ -2342,8 +2323,13 @@ const CustomAnimationPresets& CustomAnimationPane::getPresets() return *mpCustomAnimationPresets; } -void CustomAnimationPane::markShapesFromSelectedEffects() +// ICustomAnimationListController +void CustomAnimationPane::onSelect() { + maListSelection = mpCustomAnimationList->getSelection(); + updateControls(); + + // mark shapes from selected effects if( !maSelectionLock.isLocked() ) { ScopeLockGuard aGuard( maSelectionLock ); diff --git a/sd/source/ui/animations/CustomAnimationPane.hxx b/sd/source/ui/animations/CustomAnimationPane.hxx index aabe68c2ffbb..636fff1edcb0 100644 --- a/sd/source/ui/animations/CustomAnimationPane.hxx +++ b/sd/source/ui/animations/CustomAnimationPane.hxx @@ -74,11 +74,9 @@ public: void onSelectionChanged(); void onChangeCurrentPage(); void onAdd(); - void animationChange(); void onRemove(); void onChangeStart(); void onChangeStart( sal_Int16 nNodeType ); - void onChangeProperty(); void onChangeSpeed(); // methods @@ -108,7 +106,6 @@ private: void removeListener(); void updateControls(); void updateMotionPathTags(); - void markShapesFromSelectedEffects(); void showOptions(const OString& sPage = OString()); void moveSelection( bool bUp ); diff --git a/sd/source/ui/animations/SlideTransitionPane.cxx b/sd/source/ui/animations/SlideTransitionPane.cxx index b80be66e0fca..dc65fdde43da 100644 --- a/sd/source/ui/animations/SlideTransitionPane.cxx +++ b/sd/source/ui/animations/SlideTransitionPane.cxx @@ -925,8 +925,8 @@ void SlideTransitionPane::applyToSelectedPages(bool bPreview = true) { if (aEffect.mnType) // mnType = 0 denotes no transition playCurrentEffect(); - else - stopEffects(); + else if( mxView.is() ) + SlideShow::Stop( mrBase ); } if (pFocusWindow) @@ -944,14 +944,6 @@ void SlideTransitionPane::playCurrentEffect() } } -void SlideTransitionPane::stopEffects() -{ - if( mxView.is() ) - { - SlideShow::Stop( mrBase ); - } -} - void SlideTransitionPane::addListener() { Link<tools::EventMultiplexerEvent&,void> aLink( LINK(this,SlideTransitionPane,EventMultiplexerListener) ); |