be case-insensitive for open/starsymbol comparison

Change-Id: I7a342c809a723f5f9c03271c6145d9c367cea6de
Reviewed-on: https://gerrit.libreoffice.org/4015
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
This commit is contained in:
Thomas Arnhold
2013-05-23 19:49:08 +02:00
committed by Caolán McNamara
parent 34c2e88458
commit a0f85534a7
6 changed files with 9 additions and 7 deletions

View File

@@ -374,8 +374,8 @@ SfxPoolItem* SvxFontItem::Clone( SfxItemPool * ) const
SvStream& SvxFontItem::Store( SvStream& rStrm , sal_uInt16 /*nItemVersion*/ ) const
{
sal_Bool bToBats =
GetFamilyName().EqualsAscii( "StarSymbol", 0, sizeof("StarSymbol")-1 ) ||
GetFamilyName().EqualsAscii( "OpenSymbol", 0, sizeof("OpenSymbol")-1 );
GetFamilyName().EqualsIgnoreCaseAscii( "StarSymbol", 0, sizeof("StarSymbol")-1 ) ||
GetFamilyName().EqualsIgnoreCaseAscii( "OpenSymbol", 0, sizeof("OpenSymbol")-1 );
rStrm << (sal_uInt8) GetFamily() << (sal_uInt8) GetPitch()
<< (sal_uInt8)(bToBats ? RTL_TEXTENCODING_SYMBOL : GetSOStoreTextEncoding(GetCharSet()));

View File

@@ -1077,7 +1077,7 @@ void DrawingML::WriteParagraphNumbering( Reference< XPropertySet > rXPropSet, sa
// instead of a Unicode encoding the encoding RTL_TEXTENCODING_SYMBOL was used.
// Because there might exist a lot of damaged documemts I added this two lines
// which fixes the bullet problem for the export.
if ( aFontDesc.Name == "StarSymbol" )
if ( aFontDesc.Name.equalsIgnoreAsciiCase("StarSymbol") )
aFontDesc.CharSet = RTL_TEXTENCODING_MS_1252;
} else if ( aPropName == "BulletRelSize" ) {

View File

@@ -798,7 +798,7 @@ void ParagraphObj::ImplGetNumberingLevel( PPTExBulletProvider& rBuProv, sal_Int1
// instead of a Unicode encoding the encoding RTL_TEXTENCODING_SYMBOL was used.
// Because there might exist a lot of damaged documemts I added this two lines
// which fixes the bullet problem for the export.
if ( aFontDesc.Name == "StarSymbol" )
if ( aFontDesc.Name.equalsIgnoreAsciiCase("StarSymbol") )
aFontDesc.CharSet = RTL_TEXTENCODING_MS_1252;
}
@@ -884,7 +884,7 @@ void ParagraphObj::ImplGetNumberingLevel( PPTExBulletProvider& rBuProv, sal_Int1
case SVX_NUM_CHAR_SPECIAL : // Bullet
{
if ( aFontDesc.Name.equals("starsymbol") || aFontDesc.Name.equals("opensymbol") )
if ( aFontDesc.Name.equalsIgnoreAsciiCase("starsymbol") || aFontDesc.Name.equalsIgnoreAsciiCase("opensymbol") )
{
rtl_TextEncoding eChrSet = aFontDesc.CharSet;
cBulletId = msfilter::util::bestFitOpenSymbolToMSFont(cBulletId, eChrSet, aFontDesc.Name);

View File

@@ -1438,6 +1438,7 @@ const ConvertChar* ConvertChar::GetRecodeData( const String& rOrgFontName, const
OUString aOrgName( rOrgFontName );
GetEnglishSearchFontName( aOrgName );
OUString aMapName( rMapFontName );
// clean up and lowercase font name
GetEnglishSearchFontName( aMapName );
if( aMapName == "starsymbol"

View File

@@ -525,6 +525,7 @@ OUString GetSubsFontName( const OUString& rName, sal_uLong nFlags )
sal_Int32 nIndex = 0;
OUString aOrgName = GetNextFontToken( rName, nIndex );
// clean up and lowercase font name
GetEnglishSearchFontName( aOrgName );
// #93662# do not try to replace StarSymbol with MS only font

View File

@@ -921,8 +921,8 @@ void ServerFont::FetchFontMetric( ImplFontMetricData& rTo, long& rFactor ) const
//Always consider [star]symbol as symbol fonts
if (
(rTo.GetFamilyName() == "OpenSymbol" ) ||
(rTo.GetFamilyName() == "StarSymbol" )
(rTo.GetFamilyName().equalsIgnoreAsciiCase("OpenSymbol")) ||
(rTo.GetFamilyName().equalsIgnoreAsciiCase("StarSymbol"))
)
{
rTo.SetSymbolFlag( true );