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>
This commit is contained in:
Mark Hung
2018-06-19 15:24:32 +02:00
committed by Katarina Behrens
parent c5e1c4105f
commit e559d360d0
@@ -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 )
{