From ffb34388060090f3f627d74b903499aa80c6de1e Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 17 Dec 2012 15:49:52 +0000 Subject: Resolves: fdo#31055 fallback to a default bullet on symbol lack a) fix up some entries in Wingdings for which we do have a suitable mapping after all b) on complete failure for mapping to OpenSymbol show a default bullet, which is better than no glyph c) document that the original tables were against StarSymbol which had extra glyphs (and/or I thought it had) (cherry picked from commit 0d777f33a1d818a7fd27d755e54db64823f46636) Change-Id: I5e43cc0a5216e76d00b7df1a69967e08c3656e21 Reviewed-on: https://gerrit.libreoffice.org/1402 Reviewed-by: Miklos Vajna Tested-by: Miklos Vajna --- unotools/source/misc/fontcvt.cxx | 44 +++++++++++++++++++++++++--------------- 1 file changed, 28 insertions(+), 16 deletions(-) diff --git a/unotools/source/misc/fontcvt.cxx b/unotools/source/misc/fontcvt.cxx index b65a1cce01b5..3ab6913b4840 100644 --- a/unotools/source/misc/fontcvt.cxx +++ b/unotools/source/misc/fontcvt.cxx @@ -30,18 +30,17 @@ #include #include -#ifndef _STLP_MAP #include -#endif -#ifndef _STLP_VECTOR #include -#endif -#ifndef _STLP_ALGORITHM #include -#endif -#ifndef _STLP_FUNCTIONAL #include -#endif +#include + +//These conversion tables were designed for StarSymbol. OpenSymbol +//originally didn't have the same code points as StarSymbol, and +//then gained some extra code points, but there are still potentially +//various holes in OpenSymbol which were filled by StarSymbol, i.e. +//destination mapping points which are empty in OpenSymbol //======================================================================= // note: the character mappings that are only approximations @@ -316,17 +315,17 @@ static const sal_Unicode aWingDings2Tab[224] = 0xe569, 0xe56a, 0xe56b, 0xe56c, 0xe56d, 0xe56e, 0xe56f, 0xe570, 0xe571, 0xe572, 0xe573, 0xe574, - 0xe575, 0xe576, 0xe577, 0xe578, + 0xe575, 0, 0, 0xe578, // F0a0 0xe579, 0xe57a, 0xe57b, 0xe57c, - 0xe57d, 0xe57e, 0xe57f, 0xe580, - 0xe581, 0xe582, 0xe583, 0xe584, - 0xe585, 0xe586, 0xe587, 0xe588, + 0, 0, 0, 0, + 0, 0, 0, 0xe584, + 0xe585, 0, 0xe586, 0, // F0b0 - 0xe589, 0xe58a, 0xe58b, 0xe58c, + 0, 0, 0, 0, 0xe58d, 0xe58e, 0xe58f, 0xe590, - 0xe591, 0xe592, 0xe593, 0xe594, - 0xe595, 0xe596, 0xe597, 0xe598, + 0, 0, 0xe593, 0xe594, + 0, 0, 0, 0xe587, // F0c0 0xe599, 0xe59a, 0xe59b, 0xe59c, 0xe59d, 0xe59e, 0xe59f, 0xe5a0, @@ -343,7 +342,7 @@ static const sal_Unicode aWingDings2Tab[224] = 0xe5c1, 0xe5c2, 0xe5c3, 0xe5c4, 0xe5c5, 0xe5c6, 0xe5c7, 0xe5c8, // F0f0 - 0xe5c9, 0, 0xe5cb, 0xe5cc, + 0xe5c9, 0, 0xe5cb, 0xe477, 0xe5cd, 0xe5ce, 0xe5cf, 0xe5d0, 0x203b, 0x2042, 0, 0, 0, 0, 0, 0 @@ -1364,7 +1363,20 @@ sal_Unicode ConvertChar::RecodeChar( sal_Unicode cChar ) const cIndex -= 0xF000; // recode the symbol if( cIndex>=0x0020 && cIndex<=0x00FF ) + { cRetVal = mpCvtTab[ cIndex - 0x0020 ]; + + if (!cRetVal && mpSubsFontName) + { + if (!strcmp(mpSubsFontName, "OpenSymbol") || (!strcmp(mpSubsFontName, "StarSymbol"))) + { + cRetVal = 0xE12C; + SAL_WARN( "unotools", "Forcing a bullet substition from 0x" << + rtl::OUString::valueOf(cChar, 16) << " to 0x" << + rtl::OUString::valueOf(cRetVal, 16)); + } + } + } } return cRetVal ? cRetVal : cChar; -- cgit