[Libreoffice-commits] core.git: editeng/source oox/source sd/source unotools/source vcl/generic

Thomas Arnhold thomas at arnhold.org
Mon May 27 08:42:53 PDT 2013


 editeng/source/items/textitem.cxx   |    4 ++--
 oox/source/export/drawingml.cxx     |    2 +-
 sd/source/filter/eppt/pptx-text.cxx |    4 ++--
 unotools/source/misc/fontcvt.cxx    |    1 +
 unotools/source/misc/fontdefs.cxx   |    1 +
 vcl/generic/glyphs/gcach_ftyp.cxx   |    4 ++--
 6 files changed, 9 insertions(+), 7 deletions(-)

New commits:
commit a0f85534a71e5b04a8ca21c12ab3f04335f34344
Author: Thomas Arnhold <thomas at arnhold.org>
Date:   Thu May 23 19:49:08 2013 +0200

    be case-insensitive for open/starsymbol comparison
    
    Change-Id: I7a342c809a723f5f9c03271c6145d9c367cea6de
    Reviewed-on: https://gerrit.libreoffice.org/4015
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/editeng/source/items/textitem.cxx b/editeng/source/items/textitem.cxx
index c026f1d..51995af 100644
--- a/editeng/source/items/textitem.cxx
+++ b/editeng/source/items/textitem.cxx
@@ -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()));
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 6f28d92..6d73d3d 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -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" ) {
diff --git a/sd/source/filter/eppt/pptx-text.cxx b/sd/source/filter/eppt/pptx-text.cxx
index adadc44..22c713f 100644
--- a/sd/source/filter/eppt/pptx-text.cxx
+++ b/sd/source/filter/eppt/pptx-text.cxx
@@ -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);
diff --git a/unotools/source/misc/fontcvt.cxx b/unotools/source/misc/fontcvt.cxx
index 67cf552..93d7f99 100644
--- a/unotools/source/misc/fontcvt.cxx
+++ b/unotools/source/misc/fontcvt.cxx
@@ -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"
diff --git a/unotools/source/misc/fontdefs.cxx b/unotools/source/misc/fontdefs.cxx
index 4132b5d..0932c17 100644
--- a/unotools/source/misc/fontdefs.cxx
+++ b/unotools/source/misc/fontdefs.cxx
@@ -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
diff --git a/vcl/generic/glyphs/gcach_ftyp.cxx b/vcl/generic/glyphs/gcach_ftyp.cxx
index e34b38d..0dfab94 100644
--- a/vcl/generic/glyphs/gcach_ftyp.cxx
+++ b/vcl/generic/glyphs/gcach_ftyp.cxx
@@ -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 );


More information about the Libreoffice-commits mailing list