summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorMark Hung <marklh9@gmail.com>2019-02-18 23:15:39 +0800
committerMark Hung <marklh9@gmail.com>2019-02-19 18:25:22 +0100
commita1bf6fa6c49a2a84d94447673c724e706e01cb59 (patch)
tree589046cc0849ae61277b4f3a8250d1fe7da83900 /sd
parentcacdb1ae9d9e249737d0b3732e6fd198cfdd9d82 (diff)
sd: respect what user has selected for new effects.
It was annoying that "Entry - Appear" animation was always added despite user had selected another effect. Correct the design as: - "Entry - Appear" is added for the first animation in the slide. - Last selected effect is added. - If the category is selected but the effect isn't, the first effect in the category is added. Change-Id: I5e781feb0468bef4a5e46fd277554ddeadbcfbec Reviewed-on: https://gerrit.libreoffice.org/67977 Tested-by: Jenkins Reviewed-by: Mark Hung <marklh9@gmail.com>
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/animations/CustomAnimationPane.cxx28
1 files changed, 21 insertions, 7 deletions
diff --git a/sd/source/ui/animations/CustomAnimationPane.cxx b/sd/source/ui/animations/CustomAnimationPane.cxx
index a7e55e344648..1041ccc8b22d 100644
--- a/sd/source/ui/animations/CustomAnimationPane.cxx
+++ b/sd/source/ui/animations/CustomAnimationPane.cxx
@@ -1807,16 +1807,30 @@ void CustomAnimationPane::onAdd()
CustomAnimationPresetPtr pDescriptor;
mpFTCategory->Enable();
- mpLBCategory->Enable();
mpFTAnimation->Enable();
- mpLBAnimation->Enable();
- mpLBCategory->SelectEntryPos(0);
- sal_uInt32 nFirstEffect = fillAnimationLB( bHasText );
- if(nFirstEffect == LISTBOX_ENTRY_NOTFOUND)
- return;
+ bool bCategoryReset = false;
+
+ if (!mpLBCategory->IsEnabled() ||
+ mpLBCategory->GetSelectedEntryPos() == LISTBOX_ENTRY_NOTFOUND)
+ {
+ mpLBCategory->Enable();
+ mpLBCategory->SelectEntryPos(0);
+ bCategoryReset = true;
+ }
+
+ if (bCategoryReset || !mpLBAnimation->IsEnabled() ||
+ mpLBAnimation->GetSelectedEntryPos() == LISTBOX_ENTRY_NOTFOUND)
+ {
+ mpLBAnimation->Enable();
+
+ sal_uInt32 nFirstEffect = fillAnimationLB( bHasText );
+ if(nFirstEffect == LISTBOX_ENTRY_NOTFOUND)
+ return;
+
+ mpLBAnimation->SelectEntryPos(nFirstEffect);
+ }
- mpLBAnimation->SelectEntryPos(nFirstEffect);
void* pEntryData = mpLBAnimation->GetSelectedEntryData();
if( pEntryData )
pDescriptor = *static_cast< CustomAnimationPresetPtr* >( pEntryData );