summaryrefslogtreecommitdiff
path: root/unotools
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-11-26 10:25:31 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-11-27 10:16:40 +0100
commit33e80611c46ffb8b324e1d445287f0957546de97 (patch)
treee4549720e29fdce11e54b83a24ece1eb878917ec /unotools
parent11fc3b52db6e46d0879b163da59df14268c1fe13 (diff)
remove unused SubsFontFlags flags
and document in the registry that the SubstFontsPS is unused Change-Id: I66a9e0b4353f17b34cffb02823726c9887b7bdd3 Reviewed-on: https://gerrit.libreoffice.org/64065 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'unotools')
-rw-r--r--unotools/source/config/fontcfg.cxx4
-rw-r--r--unotools/source/misc/fontdefs.cxx37
2 files changed, 9 insertions, 32 deletions
diff --git a/unotools/source/config/fontcfg.cxx b/unotools/source/config/fontcfg.cxx
index 9f796ff88fc4..114e2dc37352 100644
--- a/unotools/source/config/fontcfg.cxx
+++ b/unotools/source/config/fontcfg.cxx
@@ -1002,8 +1002,6 @@ void FontSubstConfiguration::readLocaleSubst( const OUString& rBcp47 ) const
// strings for subst retrieval, construct only once
OUString const aSubstFontsStr ( "SubstFonts" );
OUString const aSubstFontsMSStr ( "SubstFontsMS" );
- OUString const aSubstFontsPSStr ( "SubstFontsPS" );
- OUString const aSubstFontsHTMLStr ( "SubstFontsHTML" );
OUString const aSubstWeightStr ( "FontWeight" );
OUString const aSubstWidthStr ( "FontWidth" );
OUString const aSubstTypeStr ( "FontType" );
@@ -1032,8 +1030,6 @@ void FontSubstConfiguration::readLocaleSubst( const OUString& rBcp47 ) const
aAttr.Name = pFontNames[i];
fillSubstVector( xFont, aSubstFontsStr, aAttr.Substitutions );
fillSubstVector( xFont, aSubstFontsMSStr, aAttr.MSSubstitutions );
- fillSubstVector( xFont, aSubstFontsPSStr, aAttr.PSSubstitutions );
- fillSubstVector( xFont, aSubstFontsHTMLStr, aAttr.HTMLSubstitutions );
aAttr.Weight = getSubstWeight( xFont, aSubstWeightStr );
aAttr.Width = getSubstWidth( xFont, aSubstWidthStr );
aAttr.Type = getSubstType( xFont, aSubstTypeStr );
diff --git a/unotools/source/misc/fontdefs.cxx b/unotools/source/misc/fontdefs.cxx
index 35af2a1bddfb..c83c14d93cda 100644
--- a/unotools/source/misc/fontdefs.cxx
+++ b/unotools/source/misc/fontdefs.cxx
@@ -529,37 +529,18 @@ OUString GetSubsFontName( const OUString& rName, SubsFontFlags nFlags )
const utl::FontNameAttr* pAttr = utl::FontSubstConfiguration::get().getSubstInfo( aOrgName );
if ( pAttr )
{
- for( int i = 0; i < 3; i++ )
- {
- const ::std::vector< OUString >* pVector = nullptr;
- switch( i )
+ if( nFlags & SubsFontFlags::MS && !pAttr->MSSubstitutions.empty() )
{
- case 0:
- if( nFlags & SubsFontFlags::MS && !pAttr->MSSubstitutions.empty() )
- pVector = &pAttr->MSSubstitutions;
- break;
- case 1:
- if( nFlags & SubsFontFlags::PS && !pAttr->PSSubstitutions.empty() )
- pVector = &pAttr->PSSubstitutions;
- break;
- case 2:
- if( nFlags & SubsFontFlags::HTML && !pAttr->HTMLSubstitutions.empty() )
- pVector = &pAttr->HTMLSubstitutions;
- break;
- }
- if( ! pVector )
- continue;
- for( const auto& rSubstitution : *pVector )
- if( ! ImplIsFontToken( rName, rSubstitution ) )
- {
- ImplAppendFontToken( aName, rSubstitution );
- if( nFlags & SubsFontFlags::ONLYONE )
+ for( const auto& rSubstitution : pAttr->MSSubstitutions )
+ if( ! ImplIsFontToken( rName, rSubstitution ) )
{
- i = 4;
- break;
+ ImplAppendFontToken( aName, rSubstitution );
+ if( nFlags & SubsFontFlags::ONLYONE )
+ {
+ break;
+ }
}
- }
- }
+ }
}
return aName;