[Libreoffice-commits] core.git: sd/inc sd/source
Mark Hung
marklh9 at gmail.com
Sun Jun 24 01:51:59 UTC 2018
sd/inc/sdpage.hxx | 3 +++
sd/source/core/sdpage_animations.cxx | 12 ++++++++++++
sd/source/ui/view/drviews2.cxx | 4 ++++
3 files changed, 19 insertions(+)
New commits:
commit 3e768ce8260ed442b02c884c5a6bfac421dbcec9
Author: Mark Hung <marklh9 at gmail.com>
Date: Mon Jun 18 23:16:12 2018 +0800
tdf#45178 notify object rename and update effect description.
Change-Id: Ib63147a9f4dceb35e21bcf0ca5c1afebf5263721
Reviewed-on: https://gerrit.libreoffice.org/56048
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9 at gmail.com>
diff --git a/sd/inc/sdpage.hxx b/sd/inc/sdpage.hxx
index 932643014f4a..e8d0d639a01c 100644
--- a/sd/inc/sdpage.hxx
+++ b/sd/inc/sdpage.hxx
@@ -314,6 +314,9 @@ public:
/** removes all custom animations for the given shape */
void removeAnimations( const SdrObject* pObj );
+ /** Notify that the object has been renamed and the animation effects has to update. */
+ void notifyObjectRenamed(const SdrObject* pObj);
+
/** Set the name of the page and broadcast a model change.
*/
void SetName (const OUString& rName);
diff --git a/sd/source/core/sdpage_animations.cxx b/sd/source/core/sdpage_animations.cxx
index cdd16e9cb968..c7e35d05dffb 100644
--- a/sd/source/core/sdpage_animations.cxx
+++ b/sd/source/core/sdpage_animations.cxx
@@ -81,6 +81,18 @@ void SdPage::removeAnimations( const SdrObject* pObj )
}
}
+/** Notify that the object has been renamed and the animation effect has to update. */
+void SdPage::notifyObjectRenamed(const SdrObject* pObj)
+{
+ if (pObj && hasAnimationNode())
+ {
+ Reference<XShape> xShape(const_cast<SdrObject*>(pObj)->getUnoShape(), UNO_QUERY);
+
+ if (xShape.is() && getMainSequence()->hasEffect(xShape))
+ getMainSequence()->notify_change();
+ }
+}
+
bool SdPage::hasAnimationNode() const
{
return mxAnimationNode.is();
diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx
index c9879eec60ae..c7bd428a3a10 100644
--- a/sd/source/ui/view/drviews2.cxx
+++ b/sd/source/ui/view/drviews2.cxx
@@ -2506,6 +2506,10 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
{
pDlg->GetName(aName);
pSelected->SetName(aName);
+
+ SdPage* pPage = GetActualPage();
+ if (pPage)
+ pPage->notifyObjectRenamed(pSelected);
}
}
More information about the Libreoffice-commits
mailing list