tdf#170595 no need to call HasListCharStyle
if we are just going to create a new style anyway Change-Id: Ib7c70b1fe64bd12ed2e500c0fee686f45b94985f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198599 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
@@ -2183,15 +2183,18 @@ void StyleSheetTable::applyDefaults(bool bParaProperties)
|
||||
|
||||
OUString StyleSheetTable::getOrCreateCharStyle( const PropertyValueVector_t& rCharProperties, bool bAlwaysCreate )
|
||||
{
|
||||
//find out if any of the styles already has the required properties then return its name
|
||||
OUString sListLabel = HasListCharStyle(rCharProperties);
|
||||
// Don't try to reuse an existing character style if requested.
|
||||
if( !sListLabel.isEmpty() && !bAlwaysCreate)
|
||||
return sListLabel;
|
||||
if (!bAlwaysCreate)
|
||||
{
|
||||
//find out if any of the styles already has the required properties then return its name
|
||||
OUString sListLabel = HasListCharStyle(rCharProperties);
|
||||
// Don't try to reuse an existing character style if requested.
|
||||
if( !sListLabel.isEmpty())
|
||||
return sListLabel;
|
||||
}
|
||||
|
||||
//create a new one otherwise
|
||||
const rtl::Reference< SwXStyleFamily >& xCharStyles = m_rDMapper.GetCharacterStyles();
|
||||
sListLabel = m_rDMapper.GetUnusedCharacterStyleName();
|
||||
OUString sListLabel = m_rDMapper.GetUnusedCharacterStyleName();
|
||||
if (!m_xTextDocument)
|
||||
throw uno::RuntimeException();
|
||||
try
|
||||
|
||||
Reference in New Issue
Block a user