summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorThomas Arnhold <thomas@arnhold.org>2013-05-28 10:53:03 +0200
committerLuboš Luňák <l.lunak@suse.cz>2013-06-07 11:56:33 +0200
commitd04ef1f208d6a32ffa3bdb56b951f85854bca897 (patch)
tree7c9b3a99874aafa5e344e3e5b302d8ae77d6b61b /vcl
parent46f61ee3997c4c6e1a1dca8b2986f31f0e4a6167 (diff)
Make use of IsStarSymbol()
Reviewed-on: https://gerrit.libreoffice.org/4077 Reviewed-by: Luboš Luňák <l.lunak@suse.cz> Tested-by: Luboš Luňák <l.lunak@suse.cz> Signed-off-by: Luboš Luňák <l.lunak@suse.cz> Conflicts: include/unotools/fontdefs.hxx oox/source/export/drawingml.cxx sw/source/filter/ww8/writerhelper.cxx sw/source/filter/ww8/writerhelper.hxx vcl/generic/fontmanager/fontsubst.cxx vcl/generic/glyphs/gcach_ftyp.cxx vcl/source/gdi/outdev3.cxx Change-Id: I7a2e3a6f11bbaaaff50e8163e4ce3e2583b1d03c
Diffstat (limited to 'vcl')
-rw-r--r--vcl/generic/fontmanager/fontsubst.cxx7
-rw-r--r--vcl/generic/glyphs/gcach_ftyp.cxx8
-rw-r--r--vcl/source/filter/wmf/wmfwr.cxx6
-rw-r--r--vcl/source/gdi/metaact.cxx6
-rw-r--r--vcl/source/gdi/outdev3.cxx3
5 files changed, 9 insertions, 21 deletions
diff --git a/vcl/generic/fontmanager/fontsubst.cxx b/vcl/generic/fontmanager/fontsubst.cxx
index 23ac9688522e..af54328fe67e 100644
--- a/vcl/generic/fontmanager/fontsubst.cxx
+++ b/vcl/generic/fontmanager/fontsubst.cxx
@@ -33,6 +33,7 @@
#include "salprn.hxx"
#include "region.h"
+#include <unotools/fontdefs.hxx>
#include <list>
// ===========================================================================
@@ -161,8 +162,7 @@ bool FcPreMatchSubstititution::FindFontSubstitute( FontSelectPattern &rFontSelDa
if( rFontSelData.IsSymbolFont() )
return false;
// StarSymbol is a unicode font, but it still deserves the symbol flag
- if( 0 == rFontSelData.maSearchName.CompareIgnoreCaseToAscii( "starsymbol", 10)
- || 0 == rFontSelData.maSearchName.CompareIgnoreCaseToAscii( "opensymbol", 10) )
+ if ( IsStarSymbol(rFontSelData.maSearchName) )
return false;
//see fdo#41556 and fdo#47636
@@ -230,8 +230,7 @@ bool FcGlyphFallbackSubstititution::FindFontSubstitute( FontSelectPattern& rFont
if( rFontSelData.IsSymbolFont() )
return false;
// StarSymbol is a unicode font, but it still deserves the symbol flag
- if( 0 == rFontSelData.maSearchName.CompareIgnoreCaseToAscii( "starsymbol", 10)
- || 0 == rFontSelData.maSearchName.CompareIgnoreCaseToAscii( "opensymbol", 10) )
+ if ( IsStarSymbol(rFontSelData.maSearchName) )
return false;
const FontSelectPattern aOut = GetFcSubstitute( rFontSelData, rMissingCodes );
diff --git a/vcl/generic/glyphs/gcach_ftyp.cxx b/vcl/generic/glyphs/gcach_ftyp.cxx
index ac2000d37a03..c2075295adf5 100644
--- a/vcl/generic/glyphs/gcach_ftyp.cxx
+++ b/vcl/generic/glyphs/gcach_ftyp.cxx
@@ -32,6 +32,7 @@
#include <graphite2/Font.h>
#include <graphite_layout.hxx>
#endif
+#include <unotools/fontdefs.hxx>
#include "tools/poly.hxx"
#include "basegfx/matrix/b2dhommatrix.hxx"
@@ -929,13 +930,8 @@ void ServerFont::FetchFontMetric( ImplFontMetricData& rTo, long& rFactor ) const
rTo.mnOrientation = GetFontSelData().mnOrientation;
//Always consider [star]symbol as symbol fonts
- if (
- (rTo.GetFamilyName().EqualsIgnoreCaseAscii("OpenSymbol")) ||
- (rTo.GetFamilyName().EqualsIgnoreCaseAscii("StarSymbol"))
- )
- {
+ if ( IsStarSymbol( rTo.GetFamilyName() ) )
rTo.mbSymbolFlag = true;
- }
if( maSizeFT )
pFTActivateSize( maSizeFT );
diff --git a/vcl/source/filter/wmf/wmfwr.cxx b/vcl/source/filter/wmf/wmfwr.cxx
index c9baef6b36f5..b5cca9df5cd0 100644
--- a/vcl/source/filter/wmf/wmfwr.cxx
+++ b/vcl/source/filter/wmf/wmfwr.cxx
@@ -502,12 +502,6 @@ void WMFWriter::WMFRecord_Ellipse(const Rectangle & rRect)
WriteRectangle(rRect);
}
-bool IsStarSymbol(const String &rStr)
-{
- return rStr.EqualsIgnoreCaseAscii("starsymbol") ||
- rStr.EqualsIgnoreCaseAscii("opensymbol");
-}
-
void WMFWriter::WMFRecord_Escape( sal_uInt32 nEsc, sal_uInt32 nLen, const sal_Int8* pData )
{
#ifdef OSL_BIGENDIAN
diff --git a/vcl/source/gdi/metaact.cxx b/vcl/source/gdi/metaact.cxx
index b1bc2bc334d1..448d4209fa4c 100644
--- a/vcl/source/gdi/metaact.cxx
+++ b/vcl/source/gdi/metaact.cxx
@@ -26,6 +26,7 @@
#include <vcl/metaact.hxx>
#include <vcl/graphictools.hxx>
#include <basegfx/matrix/b2dhommatrixtools.hxx>
+#include <unotools/fontdefs.hxx>
// ========================================================================
@@ -3437,9 +3438,8 @@ MetaFontAction::MetaFontAction( const Font& rFont ) :
// we change the textencoding to RTL_TEXTENCODING_UNICODE here, which seems
// to be the right way; changing the textencoding at other sources
// is too dangerous at the moment
- if( ( ( maFont.GetName().SearchAscii( "StarSymbol" ) != STRING_NOTFOUND )
- || ( maFont.GetName().SearchAscii( "OpenSymbol" ) != STRING_NOTFOUND ) )
- && ( maFont.GetCharSet() != RTL_TEXTENCODING_UNICODE ) )
+ if ( IsStarSymbol( maFont.GetName() )
+ && ( maFont.GetCharSet() != RTL_TEXTENCODING_UNICODE ) )
{
maFont.SetCharSet( RTL_TEXTENCODING_UNICODE );
}
diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx
index f7640f8ba204..3679d5a0881a 100644
--- a/vcl/source/gdi/outdev3.cxx
+++ b/vcl/source/gdi/outdev3.cxx
@@ -745,8 +745,7 @@ PhysicalFontFace::PhysicalFontFace( const ImplDevFontAttributes& rDFA, int nMagi
{
// StarSymbol is a unicode font, but it still deserves the symbol flag
if( !mbSymbolFlag )
- if( 0 == GetFamilyName().CompareIgnoreCaseToAscii( "starsymbol", 10)
- || 0 == GetFamilyName().CompareIgnoreCaseToAscii( "opensymbol", 10) )
+ if ( IsStarSymbol( GetFamilyName() ) )
mbSymbolFlag = true;
}