summaryrefslogtreecommitdiff
path: root/sd/source/ui/animations
diff options
context:
space:
mode:
authorKatarina Behrens <Katarina.Behrens@cib.de>2016-05-20 10:21:06 +0200
committerKatarina Behrens <Katarina.Behrens@cib.de>2016-05-20 10:02:52 +0000
commitb5245993c0450b49607a352b642a1cc97031c29e (patch)
tree69506479a8e84966cf69ad0b9ec0ef942fd7f911 /sd/source/ui/animations
parent6c785f65ea5cc961c0a079455973f3086731b2c9 (diff)
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 <ci@libreoffice.org> Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de>
Diffstat (limited to 'sd/source/ui/animations')
-rw-r--r--sd/source/ui/animations/CustomAnimationPane.cxx14
-rw-r--r--sd/source/ui/animations/CustomAnimationPane.hxx2
2 files changed, 9 insertions, 7 deletions
diff --git a/sd/source/ui/animations/CustomAnimationPane.cxx b/sd/source/ui/animations/CustomAnimationPane.cxx
index 21572837861d..e8de52c456c5 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 992e552dc1c8..3143af48b3de 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 );