summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--editeng/source/items/textitem.cxx4
-rw-r--r--include/unotools/fontdefs.hxx9
-rw-r--r--oox/source/export/drawingml.cxx2
-rw-r--r--sd/source/filter/eppt/pptx-text.cxx2
-rw-r--r--sw/source/filter/ww8/writerhelper.cxx8
-rw-r--r--sw/source/filter/ww8/writerhelper.hxx12
-rw-r--r--sw/source/filter/ww8/writerwordglue.cxx2
-rw-r--r--sw/source/filter/ww8/wrtw8num.cxx5
-rw-r--r--unotools/source/misc/fontcvt.cxx2
-rw-r--r--unotools/source/misc/fontdefs.cxx8
-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
15 files changed, 34 insertions, 50 deletions
diff --git a/editeng/source/items/textitem.cxx b/editeng/source/items/textitem.cxx
index 51995af6f8d9..f9f342e44575 100644
--- a/editeng/source/items/textitem.cxx
+++ b/editeng/source/items/textitem.cxx
@@ -373,9 +373,7 @@ SfxPoolItem* SvxFontItem::Clone( SfxItemPool * ) const
SvStream& SvxFontItem::Store( SvStream& rStrm , sal_uInt16 /*nItemVersion*/ ) const
{
- sal_Bool bToBats =
- GetFamilyName().EqualsIgnoreCaseAscii( "StarSymbol", 0, sizeof("StarSymbol")-1 ) ||
- GetFamilyName().EqualsIgnoreCaseAscii( "OpenSymbol", 0, sizeof("OpenSymbol")-1 );
+ sal_Bool bToBats = IsStarSymbol( GetFamilyName() );
rStrm << (sal_uInt8) GetFamily() << (sal_uInt8) GetPitch()
<< (sal_uInt8)(bToBats ? RTL_TEXTENCODING_SYMBOL : GetSOStoreTextEncoding(GetCharSet()));
diff --git a/include/unotools/fontdefs.hxx b/include/unotools/fontdefs.hxx
index 60c37d498045..d1bf77769a33 100644
--- a/include/unotools/fontdefs.hxx
+++ b/include/unotools/fontdefs.hxx
@@ -90,6 +90,15 @@ UNOTOOLS_DLLPUBLIC OUString GetNextFontToken( const OUString& rTokenStr, sal_Int
UNOTOOLS_DLLPUBLIC void GetEnglishSearchFontName( OUString& rName );
+/** Determine if the font is the special Star|Open Symbol font
+
+ @param rFontName
+ The FontName to test for being Star|Open Symbol
+
+ @return true if this is Star|Open Symbol
+*/
+UNOTOOLS_DLLPUBLIC bool IsStarSymbol(const OUString &rFontName);
+
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 6d73d3d3f3b8..8cbeead1f975 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -1483,7 +1483,7 @@ void DrawingML::WriteConnectorConnections( EscherConnectorListEntry& rConnectorE
sal_Unicode DrawingML::SubstituteBullet( sal_Unicode cBulletId, ::com::sun::star::awt::FontDescriptor& rFontDesc )
{
- if ( rFontDesc.Name.equalsIgnoreAsciiCase("starsymbol") || rFontDesc.Name.equalsIgnoreAsciiCase("opensymbol") )
+ if ( IsStarSymbol(rFontDesc.Name) )
{
rtl_TextEncoding eCharSet = rFontDesc.CharSet;
cBulletId = msfilter::util::bestFitOpenSymbolToMSFont(cBulletId, eCharSet, rFontDesc.Name);
diff --git a/sd/source/filter/eppt/pptx-text.cxx b/sd/source/filter/eppt/pptx-text.cxx
index 22c713fca6b1..e96a03f44636 100644
--- a/sd/source/filter/eppt/pptx-text.cxx
+++ b/sd/source/filter/eppt/pptx-text.cxx
@@ -884,7 +884,7 @@ void ParagraphObj::ImplGetNumberingLevel( PPTExBulletProvider& rBuProv, sal_Int1
case SVX_NUM_CHAR_SPECIAL : // Bullet
{
- if ( aFontDesc.Name.equalsIgnoreAsciiCase("starsymbol") || aFontDesc.Name.equalsIgnoreAsciiCase("opensymbol") )
+ if ( IsStarSymbol(aFontDesc.Name) )
{
rtl_TextEncoding eChrSet = aFontDesc.CharSet;
cBulletId = msfilter::util::bestFitOpenSymbolToMSFont(cBulletId, eChrSet, aFontDesc.Name);
diff --git a/sw/source/filter/ww8/writerhelper.cxx b/sw/source/filter/ww8/writerhelper.cxx
index 228bc59ff5a5..664d5aa5316e 100644
--- a/sw/source/filter/ww8/writerhelper.cxx
+++ b/sw/source/filter/ww8/writerhelper.cxx
@@ -666,14 +666,6 @@ namespace sw
}
}
- bool IsStarSymbol(const OUString &rFontName)
- {
- sal_Int32 nIndex = 0;
- OUString sFamilyNm(GetNextFontToken(rFontName, nIndex));
- return (sFamilyNm.equalsIgnoreAsciiCase("starsymbol") ||
- sFamilyNm.equalsIgnoreAsciiCase("opensymbol"));
- }
-
Size GetSwappedInSize(const SwNoTxtNode& rNd)
{
Size aGrTwipSz(rNd.GetTwipSize());
diff --git a/sw/source/filter/ww8/writerhelper.hxx b/sw/source/filter/ww8/writerhelper.hxx
index 52bfba74b687..e411ac8fee03 100644
--- a/sw/source/filter/ww8/writerhelper.hxx
+++ b/sw/source/filter/ww8/writerhelper.hxx
@@ -747,18 +747,6 @@ namespace sw
*/
Polygon PolygonFromPolyPolygon(const PolyPolygon &rPolyPoly);
- /** Determine if the font is the special Star|Open Symbol font
-
- @param rFontName
- The FontName to test for being Star|Open Symbol
-
- @return true if this is Star|Open Symbol
-
- @author
- <a href="mailto:cmc@openoffice.org">Caol&aacute;n McNamara</a>
- */
- bool IsStarSymbol(const OUString &rFontName);
-
/** Make setting a drawing object's layer in a Writer document easy
diff --git a/sw/source/filter/ww8/writerwordglue.cxx b/sw/source/filter/ww8/writerwordglue.cxx
index af662eda04e7..e34b16cc539f 100644
--- a/sw/source/filter/ww8/writerwordglue.cxx
+++ b/sw/source/filter/ww8/writerwordglue.cxx
@@ -317,7 +317,7 @@ namespace myImplHelpers
String FindBestMSSubstituteFont(const String &rFont)
{
String sRet;
- if (sw::util::IsStarSymbol(rFont))
+ if ( IsStarSymbol(rFont) )
sRet.ASSIGN_CONST_ASC("Arial Unicode MS");
else
sRet = GetSubsFontName(rFont, SUBSFONT_ONLYONE | SUBSFONT_MS);
diff --git a/sw/source/filter/ww8/wrtw8num.cxx b/sw/source/filter/ww8/wrtw8num.cxx
index 82c54c19f778..61ffdee334b7 100644
--- a/sw/source/filter/ww8/wrtw8num.cxx
+++ b/sw/source/filter/ww8/wrtw8num.cxx
@@ -28,6 +28,7 @@
#include <paratr.hxx>
#include <charfmt.hxx>
#include <ndtxt.hxx>
+#include <unotools/fontcfg.hxx>
#include <com/sun/star/i18n/ScriptType.hpp>
#include <doctok/sprmids.hxx>
@@ -385,7 +386,7 @@ void MSWordExportBase::AbstractNumberingDefinitions()
sFontName = pBulletFont->GetName();
eFamily = pBulletFont->GetFamily();
- if ( sw::util::IsStarSymbol( sFontName ) )
+ if ( IsStarSymbol(sFontName) )
SubstituteBullet( sNumStr, eChrSet, sFontName );
// #i86652#
@@ -642,7 +643,7 @@ void WW8Export::BuildAnlvBulletBase(WW8_ANLV& rAnlv, sal_uInt8*& rpCh,
String sFontName = rFont.GetName();
sal_uInt16 nFontId;
- if (sw::util::IsStarSymbol(sFontName))
+ if ( IsStarSymbol(sFontName) )
{
/*
If we are starsymbol then in ww7- mode we will always convert to a
diff --git a/unotools/source/misc/fontcvt.cxx b/unotools/source/misc/fontcvt.cxx
index 93d7f9917780..2b44624c39a2 100644
--- a/unotools/source/misc/fontcvt.cxx
+++ b/unotools/source/misc/fontcvt.cxx
@@ -1354,7 +1354,7 @@ sal_Unicode ConvertChar::RecodeChar( sal_Unicode cChar ) const
if (!cRetVal && mpSubsFontName)
{
- if (!strcmp(mpSubsFontName, "OpenSymbol") || (!strcmp(mpSubsFontName, "StarSymbol")))
+ if ( IsStarSymbol( OUString::createFromAscii(mpSubsFontName) ) )
{
cRetVal = 0xE12C;
SAL_WARN( "unotools.misc", "Forcing a bullet substition from 0x" <<
diff --git a/unotools/source/misc/fontdefs.cxx b/unotools/source/misc/fontdefs.cxx
index 0932c172c300..b81a5b38c012 100644
--- a/unotools/source/misc/fontdefs.cxx
+++ b/unotools/source/misc/fontdefs.cxx
@@ -597,4 +597,12 @@ int FontNameHash::operator()( const String& rStr ) const
return nHash;
}
+bool IsStarSymbol(const OUString &rFontName)
+{
+ sal_Int32 nIndex = 0;
+ OUString sFamilyNm(GetNextFontToken(rFontName, nIndex));
+ return (sFamilyNm.equalsIgnoreAsciiCase("starsymbol") ||
+ sFamilyNm.equalsIgnoreAsciiCase("opensymbol"));
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/generic/fontmanager/fontsubst.cxx b/vcl/generic/fontmanager/fontsubst.cxx
index 900125baa35f..22b3d837863b 100644
--- a/vcl/generic/fontmanager/fontsubst.cxx
+++ b/vcl/generic/fontmanager/fontsubst.cxx
@@ -32,6 +32,7 @@
#include "salprn.hxx"
#include "region.h"
+#include <unotools/fontdefs.hxx>
#include <list>
// ===========================================================================
@@ -160,8 +161,7 @@ bool FcPreMatchSubstititution::FindFontSubstitute( FontSelectPattern &rFontSelDa
if( rFontSelData.IsSymbolFont() )
return false;
// StarSymbol is a unicode font, but it still deserves the symbol flag
- if(rFontSelData.maSearchName.startsWithIgnoreAsciiCase( "starsymbol" )
- || rFontSelData.maSearchName.startsWithIgnoreAsciiCase( "opensymbol" ) )
+ if ( IsStarSymbol(rFontSelData.maSearchName) )
return false;
//see fdo#41556 and fdo#47636
@@ -229,8 +229,7 @@ bool FcGlyphFallbackSubstititution::FindFontSubstitute( FontSelectPattern& rFont
if( rFontSelData.IsSymbolFont() )
return false;
// StarSymbol is a unicode font, but it still deserves the symbol flag
- if(rFontSelData.maSearchName.startsWithIgnoreAsciiCase( "starsymbol" )
- || rFontSelData.maSearchName.startsWithIgnoreAsciiCase( "opensymbol" ) )
+ 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 0dfab940a40f..cdcfe4ca5fde 100644
--- a/vcl/generic/glyphs/gcach_ftyp.cxx
+++ b/vcl/generic/glyphs/gcach_ftyp.cxx
@@ -33,6 +33,7 @@
#include <graphite2/Font.h>
#include <graphite_layout.hxx>
#endif
+#include <unotools/fontdefs.hxx>
#include "tools/poly.hxx"
#include "basegfx/matrix/b2dhommatrix.hxx"
@@ -920,13 +921,8 @@ void ServerFont::FetchFontMetric( ImplFontMetricData& rTo, long& rFactor ) const
rTo.mnOrientation = GetFontSelData().mnOrientation;
//Always consider [star]symbol as symbol fonts
- if (
- (rTo.GetFamilyName().equalsIgnoreAsciiCase("OpenSymbol")) ||
- (rTo.GetFamilyName().equalsIgnoreAsciiCase("StarSymbol"))
- )
- {
+ if ( IsStarSymbol( rTo.GetFamilyName() ) )
rTo.SetSymbolFlag( true );
- }
if( maSizeFT )
pFTActivateSize( maSizeFT );
diff --git a/vcl/source/filter/wmf/wmfwr.cxx b/vcl/source/filter/wmf/wmfwr.cxx
index 1b862bab8005..385c3fd58a14 100644
--- a/vcl/source/filter/wmf/wmfwr.cxx
+++ b/vcl/source/filter/wmf/wmfwr.cxx
@@ -394,12 +394,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 ef702cc969cd..417c9d65dd2c 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 3281557b2ef0..359b82c2b5df 100644
--- a/vcl/source/gdi/outdev3.cxx
+++ b/vcl/source/gdi/outdev3.cxx
@@ -695,8 +695,7 @@ PhysicalFontFace::PhysicalFontFace( const ImplDevFontAttributes& rDFA, int nMagi
{
// StarSymbol is a unicode font, but it still deserves the symbol flag
if( !IsSymbolFont() )
- if( GetFamilyName().startsWithIgnoreAsciiCase( "starsymbol" )
- || GetFamilyName().startsWithIgnoreAsciiCase( "opensymbol" ) )
+ if ( IsStarSymbol( GetFamilyName() ) )
SetSymbolFlag( true );
}