summaryrefslogtreecommitdiff
path: root/unotools
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 /unotools
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 'unotools')
-rw-r--r--unotools/inc/unotools/fontdefs.hxx9
-rw-r--r--unotools/source/misc/fontcvt.cxx2
-rw-r--r--unotools/source/misc/fontdefs.cxx8
3 files changed, 18 insertions, 1 deletions
diff --git a/unotools/inc/unotools/fontdefs.hxx b/unotools/inc/unotools/fontdefs.hxx
index df79a0f26eb2..c5e99ef01f42 100644
--- a/unotools/inc/unotools/fontdefs.hxx
+++ b/unotools/inc/unotools/fontdefs.hxx
@@ -88,6 +88,15 @@ UNOTOOLS_DLLPUBLIC String GetNextFontToken( const String& rTokenStr, xub_StrLen&
UNOTOOLS_DLLPUBLIC void GetEnglishSearchFontName( String& 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/unotools/source/misc/fontcvt.cxx b/unotools/source/misc/fontcvt.cxx
index 6aaef61d6481..4f94f71628e9 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", "Forcing a bullet substition from 0x" <<
diff --git a/unotools/source/misc/fontdefs.cxx b/unotools/source/misc/fontdefs.cxx
index 7785e80757e1..8ef9962f3c39 100644
--- a/unotools/source/misc/fontdefs.cxx
+++ b/unotools/source/misc/fontdefs.cxx
@@ -583,4 +583,12 @@ int FontNameHash::operator()( const String& rStr ) const
return nHash;
}
+bool IsStarSymbol(const OUString &rFontName)
+{
+ sal_uInt16 nIndex = 0;
+ OUString sFamilyNm(GetNextFontToken(rFontName, nIndex));
+ return (sFamilyNm.equalsIgnoreAsciiCase("starsymbol") ||
+ sFamilyNm.equalsIgnoreAsciiCase("opensymbol"));
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */