summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Hung <marklh9@gmail.com>2018-06-19 00:10:49 +0800
committerKatarina Behrens <Katarina.Behrens@cib.de>2018-06-19 15:24:32 +0200
commite559d360d0a19715bd6261b7dfc7f03eb7c9b99e (patch)
tree43776b1f9cdc2c3c7c2621e9c9868418a684a858
parentc5e1c4105f744ad9730cf74c9b36c2b23bbc0979 (diff)
tdf#90243 don't append index if shape already has a name.
Change-Id: I518ad83bf3782af7cb3144982ec8844a573f0de4 Reviewed-on: https://gerrit.libreoffice.org/56051 Tested-by: Jenkins Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de>
-rw-r--r--sd/source/ui/animations/CustomAnimationList.cxx21
1 files changed, 15 insertions, 6 deletions
diff --git a/sd/source/ui/animations/CustomAnimationList.cxx b/sd/source/ui/animations/CustomAnimationList.cxx
index 4f1b4eef4786..11d54bbe04f7 100644
--- a/sd/source/ui/animations/CustomAnimationList.cxx
+++ b/sd/source/ui/animations/CustomAnimationList.cxx
@@ -124,16 +124,25 @@ OUString getShapeDescription( const Reference< XShape >& xShape, bool bWithText
{
OUString aDescription;
Reference< XPropertySet > xSet( xShape, UNO_QUERY );
+ bool bAppendIndex = true;
+
if( xSet.is() )
{
- Reference< XPropertySetInfo > xInfo( xSet->getPropertySetInfo() );
- const OUString aPropName( "UINameSingular");
- if( xInfo->hasPropertyByName( aPropName ) )
- xSet->getPropertyValue( aPropName ) >>= aDescription;
+ Reference<XPropertySetInfo> xInfo(xSet->getPropertySetInfo());
+
+ xSet->getPropertyValue("Name") >>= aDescription;
+ bAppendIndex = aDescription.isEmpty();
+
+ const OUString aPropName("UINameSingular");
+ if(xInfo->hasPropertyByName(aPropName))
+ xSet->getPropertyValue(aPropName) >>= aDescription;
}
- aDescription += " ";
- aDescription += OUString::number( getShapeIndex( xShape ) );
+ if (bAppendIndex)
+ {
+ aDescription += " ";
+ aDescription += OUString::number(getShapeIndex(xShape));
+ }
if( bWithText )
{