sd/source/ui/animations/CustomAnimationPane.cxx | 14 ++++++++------ sd/source/ui/animations/CustomAnimationPane.hxx | 2 +- 2 files changed, 9 insertions(+), 7 deletions(-)
New commits: commit b5245993c0450b49607a352b642a1cc97031c29e Author: Katarina Behrens <katarina.behr...@cib.de> Date: Fri May 20 10:21:06 2016 +0200 tdf#98852: Show text-specific effects when selection contains text This regressed as effect list(s) moved to sidebar, text-specific effects were simply always skipped even if it'd be relevant to offer them in the given context Change-Id: I2dc9cd360b462fb232573434da743e517661a6b8 Reviewed-on: https://gerrit.libreoffice.org/25190 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Katarina Behrens <katarina.behr...@cib.de> diff --git a/sd/source/ui/animations/CustomAnimationPane.cxx b/sd/source/ui/animations/CustomAnimationPane.cxx index 2157283..e8de52c 100644 --- a/sd/source/ui/animations/CustomAnimationPane.cxx +++ b/sd/source/ui/animations/CustomAnimationPane.cxx @@ -501,7 +501,6 @@ void CustomAnimationPane::updateControls() { mpFTAnimation->Enable(); mpLBAnimation->Enable(); - fillAnimationLB(); } else { @@ -602,7 +601,7 @@ void CustomAnimationPane::updateControls() break; } mpLBCategory->SelectEntryPos(nCategoryPos); - fillAnimationLB(); + fillAnimationLB( pEffect->hasText() ); OUString rsPresetId = pEffect->getPresetId(); sal_Int32 nAnimationPos = mpLBAnimation->GetEntryCount(); while( nAnimationPos-- ) @@ -1810,7 +1809,7 @@ void CustomAnimationPane::onAdd() mpLBAnimation->Enable(); mpLBCategory->SelectEntryPos(0); - sal_uInt32 nFirstEffect = fillAnimationLB(); + sal_uInt32 nFirstEffect = fillAnimationLB( bHasText ); if(nFirstEffect == LISTBOX_ENTRY_NOTFOUND) return; @@ -2031,7 +2030,9 @@ IMPL_LINK_NOARG_TYPED(CustomAnimationPane, AnimationSelectHdl, ListBox&, void) IMPL_LINK_NOARG_TYPED(CustomAnimationPane, UpdateAnimationLB, ListBox&, void) { - fillAnimationLB(); + //FIXME: first effect only? what if there is more? + CustomAnimationEffectPtr pEffect = maListSelection.front(); + fillAnimationLB( pEffect->hasText() ); } IMPL_LINK_NOARG_TYPED(CustomAnimationPane, DurationModifiedHdl, Edit&, void) @@ -2047,7 +2048,7 @@ IMPL_LINK_NOARG_TYPED(CustomAnimationPane, DurationModifiedHdl, Edit&, void) } } -sal_uInt32 CustomAnimationPane::fillAnimationLB() +sal_uInt32 CustomAnimationPane::fillAnimationLB( bool bHasText ) { PresetCategoryList rCategoryList; sal_uInt16 nPosition = mpLBCategory->GetSelectEntryPos(); @@ -2090,7 +2091,8 @@ sal_uInt32 CustomAnimationPane::fillAnimationLB() while( aIter != aEnd ) { CustomAnimationPresetPtr pDescriptor = (*aIter++); - if( pDescriptor.get() && !pDescriptor->isTextOnly() ) + // ( !isTextOnly || ( isTextOnly && bHasText ) ) <=> !isTextOnly || bHasText + if( pDescriptor.get() && ( !pDescriptor->isTextOnly() || bHasText ) ) { sal_Int32 nPos = mpLBAnimation->InsertEntry( pDescriptor->getLabel() ); mpLBAnimation->SetEntryData( nPos, static_cast<void*>( new CustomAnimationPresetPtr( pDescriptor ) ) ); diff --git a/sd/source/ui/animations/CustomAnimationPane.hxx b/sd/source/ui/animations/CustomAnimationPane.hxx index 992e552..3143af4 100644 --- a/sd/source/ui/animations/CustomAnimationPane.hxx +++ b/sd/source/ui/animations/CustomAnimationPane.hxx @@ -118,7 +118,7 @@ private: static css::uno::Any getProperty1Value( sal_Int32 nType, const CustomAnimationEffectPtr& pEffect ); bool setProperty1Value( sal_Int32 nType, const CustomAnimationEffectPtr& pEffect, const css::uno::Any& rValue ); void UpdateLook(); - sal_uInt32 fillAnimationLB(); + sal_uInt32 fillAnimationLB( bool bHasText ); DECL_LINK_TYPED( implControlListBoxHdl, ListBox&, void ); DECL_LINK_TYPED( implClickHdl, Button*, void ); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits