From e8493f9349d18cbcb323930a9bf200c542a72d62 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Sun, 28 Jul 2019 09:01:19 +0200 Subject: loplugin:collapseif Change-Id: I69bfafa97c66ef944cc6ae35c7e2f66d0430d6a4 Reviewed-on: https://gerrit.libreoffice.org/76496 Tested-by: Jenkins Reviewed-by: Noel Grandin --- unotools/source/misc/fontdefs.cxx | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'unotools') diff --git a/unotools/source/misc/fontdefs.cxx b/unotools/source/misc/fontdefs.cxx index f988b5f17759..c8c05c94fe59 100644 --- a/unotools/source/misc/fontdefs.cxx +++ b/unotools/source/misc/fontdefs.cxx @@ -527,19 +527,16 @@ OUString GetSubsFontName( const OUString& rName, SubsFontFlags nFlags ) return aName; const utl::FontNameAttr* pAttr = utl::FontSubstConfiguration::get().getSubstInfo( aOrgName ); - if ( pAttr ) + if ( pAttr && (nFlags & SubsFontFlags::MS) ) { - if( nFlags & SubsFontFlags::MS ) + for( const auto& rSubstitution : pAttr->MSSubstitutions ) + if( ! ImplIsFontToken( rName, rSubstitution ) ) { - for( const auto& rSubstitution : pAttr->MSSubstitutions ) - if( ! ImplIsFontToken( rName, rSubstitution ) ) - { - ImplAppendFontToken( aName, rSubstitution ); - if( nFlags & SubsFontFlags::ONLYONE ) - { - break; - } - } + ImplAppendFontToken( aName, rSubstitution ); + if( nFlags & SubsFontFlags::ONLYONE ) + { + break; + } } } -- cgit