summaryrefslogtreecommitdiff
path: root/sd/source/ui
diff options
context:
space:
mode:
authorMark Hung <marklh9@gmail.com>2019-11-18 00:49:03 +0800
committerMark Hung <marklh9@gmail.com>2019-11-30 15:00:09 +0100
commitd86cfcaf709638d73fcb0de5067b902dab7a7f2f (patch)
tree9306bca1007d5888e76c608f2fd1103704761623 /sd/source/ui
parentaeed331f7307612fbc4ebac4764cd39f6f2352e9 (diff)
tdf#94947 Set preset-id for user defined motion paths.
User defined motion paths ( curve, polygon, freeform line ) did not have preset-id. Set the preset-id so that the preset type will be highlighted in the custom animation pane after editing. "libo-motionpath-curve", "libo-motionpath-polygon", and "libo-motionpath-freeform-line" are used for the three user defined motion paths. This patch is related to tdf#94947, though it doesn't make the original document display correctly by guessing the missing preset-id, but it prevent empty preset-id to be generated when creating those three motion path animation. Change-Id: I50c0133bea32e022b07e5d8c0a024810844f124d Reviewed-on: https://gerrit.libreoffice.org/83079 Tested-by: Jenkins Reviewed-by: Mark Hung <marklh9@gmail.com>
Diffstat (limited to 'sd/source/ui')
-rw-r--r--sd/source/ui/animations/CustomAnimationPane.cxx11
-rw-r--r--sd/source/ui/func/fuconbez.cxx17
2 files changed, 27 insertions, 1 deletions
diff --git a/sd/source/ui/animations/CustomAnimationPane.cxx b/sd/source/ui/animations/CustomAnimationPane.cxx
index c63e4d0e8712..42b5055b0e5a 100644
--- a/sd/source/ui/animations/CustomAnimationPane.cxx
+++ b/sd/source/ui/animations/CustomAnimationPane.cxx
@@ -637,6 +637,17 @@ void CustomAnimationPane::updateControls()
}
}
+ // If preset id is missing and category is motion path.
+ if (nAnimationPos < 0 && nCategoryPos == 3)
+ {
+ if (rsPresetId == "libo-motionpath-curve")
+ mpLBAnimation->SelectEntryPos(mnCurvePathPos);
+ else if (rsPresetId == "libo-motionpath-polygon")
+ mpLBAnimation->SelectEntryPos(mnPolygonPathPos);
+ else if (rsPresetId == "libo-motionpath-freeform-line")
+ mpLBAnimation->SelectEntryPos(mnFreeformPathPos);
+ }
+
sal_uInt16 nPos = 0xffff;
sal_Int16 nNodeType = pEffect->getNodeType();
diff --git a/sd/source/ui/func/fuconbez.cxx b/sd/source/ui/func/fuconbez.cxx
index 072d743fb843..7630ea02304e 100644
--- a/sd/source/ui/func/fuconbez.cxx
+++ b/sd/source/ui/func/fuconbez.cxx
@@ -242,9 +242,24 @@ bool FuConstructBezierPolygon::MouseButtonUp(const MouseEvent& rMEvt )
double fDuration = 0.0;
*pTarget++ >>= fDuration;
bool bFirst = true;
+
+ OUString sPresetId;
+ switch(nSlotId)
+ {
+ case SID_DRAW_BEZIER_NOFILL:
+ sPresetId = "libo-motionpath-curve";
+ break;
+ case SID_DRAW_POLYGON_NOFILL:
+ sPresetId = "libo-motionpath-polygon";
+ break;
+ case SID_DRAW_FREELINE_NOFILL:
+ sPresetId = "libo-motionpath-freeform-line";
+ break;
+ }
+
while( --nTCount )
{
- CustomAnimationEffectPtr pCreated( pMainSequence->append( *pPathObj, *pTarget++, fDuration ) );
+ CustomAnimationEffectPtr pCreated( pMainSequence->append( *pPathObj, *pTarget++, fDuration, sPresetId) );
if( bFirst )
bFirst = false;
else