[Libreoffice-commits] core.git: sd/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Tue Feb 19 17:25:48 UTC 2019
sd/source/ui/animations/CustomAnimationPane.cxx | 28 ++++++++++++++++++------
1 file changed, 21 insertions(+), 7 deletions(-)
New commits:
commit a1bf6fa6c49a2a84d94447673c724e706e01cb59
Author: Mark Hung <marklh9 at gmail.com>
AuthorDate: Mon Feb 18 23:15:39 2019 +0800
Commit: Mark Hung <marklh9 at gmail.com>
CommitDate: Tue Feb 19 18:25:22 2019 +0100
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 at gmail.com>
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 );
More information about the Libreoffice-commits
mailing list