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>
This commit is contained in:
@@ -580,10 +580,6 @@ include/unotools/fontcfg.hxx:85
|
|||||||
enum ImplFontAttrs AllSubscript
|
enum ImplFontAttrs AllSubscript
|
||||||
include/unotools/fontcfg.hxx:86
|
include/unotools/fontcfg.hxx:86
|
||||||
enum ImplFontAttrs AllSerifStyle
|
enum ImplFontAttrs AllSerifStyle
|
||||||
include/unotools/fontdefs.hxx:31
|
|
||||||
enum SubsFontFlags PS
|
|
||||||
include/unotools/fontdefs.hxx:32
|
|
||||||
enum SubsFontFlags HTML
|
|
||||||
include/unotools/fontdefs.hxx:70
|
include/unotools/fontdefs.hxx:70
|
||||||
enum DefaultFontType LATIN_DISPLAY
|
enum DefaultFontType LATIN_DISPLAY
|
||||||
include/unotools/fontdefs.hxx:71
|
include/unotools/fontdefs.hxx:71
|
||||||
|
@@ -129,8 +129,6 @@ struct UNOTOOLS_DLLPUBLIC FontNameAttr
|
|||||||
OUString Name;
|
OUString Name;
|
||||||
::std::vector< OUString > Substitutions;
|
::std::vector< OUString > Substitutions;
|
||||||
::std::vector< OUString > MSSubstitutions;
|
::std::vector< OUString > MSSubstitutions;
|
||||||
::std::vector< OUString > PSSubstitutions;
|
|
||||||
::std::vector< OUString > HTMLSubstitutions;
|
|
||||||
FontWeight Weight;
|
FontWeight Weight;
|
||||||
FontWidth Width;
|
FontWidth Width;
|
||||||
ImplFontAttrs Type;
|
ImplFontAttrs Type;
|
||||||
|
@@ -27,14 +27,12 @@
|
|||||||
enum class SubsFontFlags
|
enum class SubsFontFlags
|
||||||
{
|
{
|
||||||
ONLYONE = 0x01,
|
ONLYONE = 0x01,
|
||||||
MS = 0x02,
|
MS = 0x02
|
||||||
PS = 0x04,
|
|
||||||
HTML = 0x08,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
namespace o3tl
|
namespace o3tl
|
||||||
{
|
{
|
||||||
template<> struct typed_flags<SubsFontFlags> : is_typed_flags<SubsFontFlags, 0x0f> {};
|
template<> struct typed_flags<SubsFontFlags> : is_typed_flags<SubsFontFlags, 0x03> {};
|
||||||
}
|
}
|
||||||
|
|
||||||
UNOTOOLS_DLLPUBLIC OUString GetSubsFontName( const OUString& rName, SubsFontFlags nFlags );
|
UNOTOOLS_DLLPUBLIC OUString GetSubsFontName( const OUString& rName, SubsFontFlags nFlags );
|
||||||
|
@@ -38,12 +38,12 @@
|
|||||||
</prop>
|
</prop>
|
||||||
<prop oor:name="SubstFontsPS" oor:type="xs:string">
|
<prop oor:name="SubstFontsPS" oor:type="xs:string">
|
||||||
<info>
|
<info>
|
||||||
<desc>Contains a list of substitute fonts used in a PostScript context (for example, EPS export).</desc>
|
<desc>Unused. Used to contain a list of substitute fonts used in a PostScript context (for example, EPS export).</desc>
|
||||||
</info>
|
</info>
|
||||||
</prop>
|
</prop>
|
||||||
<prop oor:name="SubstFontsHTML" oor:type="xs:string">
|
<prop oor:name="SubstFontsHTML" oor:type="xs:string">
|
||||||
<info>
|
<info>
|
||||||
<desc>Contains a list of substitute fonts used in a HTML context (for example, HTML import/export).</desc>
|
<desc>Unused. Used to contain a list of substitute fonts used in a HTML context (for example, HTML import/export).</desc>
|
||||||
</info>
|
</info>
|
||||||
</prop>
|
</prop>
|
||||||
<prop oor:name="FontWeight" oor:type="xs:string">
|
<prop oor:name="FontWeight" oor:type="xs:string">
|
||||||
|
@@ -1002,8 +1002,6 @@ void FontSubstConfiguration::readLocaleSubst( const OUString& rBcp47 ) const
|
|||||||
// strings for subst retrieval, construct only once
|
// strings for subst retrieval, construct only once
|
||||||
OUString const aSubstFontsStr ( "SubstFonts" );
|
OUString const aSubstFontsStr ( "SubstFonts" );
|
||||||
OUString const aSubstFontsMSStr ( "SubstFontsMS" );
|
OUString const aSubstFontsMSStr ( "SubstFontsMS" );
|
||||||
OUString const aSubstFontsPSStr ( "SubstFontsPS" );
|
|
||||||
OUString const aSubstFontsHTMLStr ( "SubstFontsHTML" );
|
|
||||||
OUString const aSubstWeightStr ( "FontWeight" );
|
OUString const aSubstWeightStr ( "FontWeight" );
|
||||||
OUString const aSubstWidthStr ( "FontWidth" );
|
OUString const aSubstWidthStr ( "FontWidth" );
|
||||||
OUString const aSubstTypeStr ( "FontType" );
|
OUString const aSubstTypeStr ( "FontType" );
|
||||||
@@ -1032,8 +1030,6 @@ void FontSubstConfiguration::readLocaleSubst( const OUString& rBcp47 ) const
|
|||||||
aAttr.Name = pFontNames[i];
|
aAttr.Name = pFontNames[i];
|
||||||
fillSubstVector( xFont, aSubstFontsStr, aAttr.Substitutions );
|
fillSubstVector( xFont, aSubstFontsStr, aAttr.Substitutions );
|
||||||
fillSubstVector( xFont, aSubstFontsMSStr, aAttr.MSSubstitutions );
|
fillSubstVector( xFont, aSubstFontsMSStr, aAttr.MSSubstitutions );
|
||||||
fillSubstVector( xFont, aSubstFontsPSStr, aAttr.PSSubstitutions );
|
|
||||||
fillSubstVector( xFont, aSubstFontsHTMLStr, aAttr.HTMLSubstitutions );
|
|
||||||
aAttr.Weight = getSubstWeight( xFont, aSubstWeightStr );
|
aAttr.Weight = getSubstWeight( xFont, aSubstWeightStr );
|
||||||
aAttr.Width = getSubstWidth( xFont, aSubstWidthStr );
|
aAttr.Width = getSubstWidth( xFont, aSubstWidthStr );
|
||||||
aAttr.Type = getSubstType( xFont, aSubstTypeStr );
|
aAttr.Type = getSubstType( xFont, aSubstTypeStr );
|
||||||
|
@@ -529,37 +529,18 @@ OUString GetSubsFontName( const OUString& rName, SubsFontFlags nFlags )
|
|||||||
const utl::FontNameAttr* pAttr = utl::FontSubstConfiguration::get().getSubstInfo( aOrgName );
|
const utl::FontNameAttr* pAttr = utl::FontSubstConfiguration::get().getSubstInfo( aOrgName );
|
||||||
if ( pAttr )
|
if ( pAttr )
|
||||||
{
|
{
|
||||||
for( int i = 0; i < 3; i++ )
|
if( nFlags & SubsFontFlags::MS && !pAttr->MSSubstitutions.empty() )
|
||||||
{
|
|
||||||
const ::std::vector< OUString >* pVector = nullptr;
|
|
||||||
switch( i )
|
|
||||||
{
|
{
|
||||||
case 0:
|
for( const auto& rSubstitution : pAttr->MSSubstitutions )
|
||||||
if( nFlags & SubsFontFlags::MS && !pAttr->MSSubstitutions.empty() )
|
if( ! ImplIsFontToken( rName, rSubstitution ) )
|
||||||
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 )
|
|
||||||
{
|
{
|
||||||
i = 4;
|
ImplAppendFontToken( aName, rSubstitution );
|
||||||
break;
|
if( nFlags & SubsFontFlags::ONLYONE )
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return aName;
|
return aName;
|
||||||
|
Reference in New Issue
Block a user