diff options
author | Caolán McNamara <caolan.mcnamara@collabora.com> | 2023-08-28 20:54:50 +0100 |
---|---|---|
committer | Caolán McNamara <caolan.mcnamara@collabora.com> | 2023-08-29 09:26:34 +0200 |
commit | 7f1c2b6ccf318d3b6bbf46f6559b2a3017a72821 (patch) | |
tree | 0ba4b4a50e5744c6eb9ff7783ae904c69bd02245 /oox/source/drawingml/textrun.cxx | |
parent | 16d43b7c5396d6382926d514dc9ce10b3ce94cba (diff) |
pptx using Wingdings didn't fallback to OpenSymbol
<a:sym typeface="Wingdings" pitchFamily="2" charset="2"/>
^
The charset indicating that it was symbol encoded wasn't
applied.
There are quite a few uses of GetFontData so make this
an optional request and only apply it right now to the
problematic case.
Change-Id: Ie1c4b9ac38c2bf5f0867d64eddea853a6dd05aad
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156230
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'oox/source/drawingml/textrun.cxx')
-rw-r--r-- | oox/source/drawingml/textrun.cxx | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/oox/source/drawingml/textrun.cxx b/oox/source/drawingml/textrun.cxx index 6bfc3701fedb..3eca13d4ad8f 100644 --- a/oox/source/drawingml/textrun.cxx +++ b/oox/source/drawingml/textrun.cxx @@ -19,6 +19,7 @@ #include <drawingml/textrun.hxx> +#include <com/sun/star/awt/CharSet.hpp> #include <com/sun/star/frame/XModel.hpp> #include <com/sun/star/text/ControlCharacter.hpp> #include <com/sun/star/beans/XPropertySet.hpp> @@ -67,6 +68,7 @@ sal_Int32 TextRun::insertAt( Any aOldFontName = xState->getPropertyDefault("CharFontName"); Any aOldFontPitch = xState->getPropertyDefault("CharFontPitch"); Any aOldFontFamily = xState->getPropertyDefault("CharFontFamily"); + Any aOldFontCharSet = xState->getPropertyDefault("CharFontCharSet"); TextCharacterProperties aTextCharacterProps( rTextCharacterStyle ); @@ -104,15 +106,17 @@ sal_Int32 TextRun::insertAt( OUString aFontName; sal_Int16 nFontFamily = 0, nFontPitch = 0; + bool bSymbolEnc(false); bool bReset = false; // Direct formatting for symbols. - if (bSymbol && aTextCharacterProps.maSymbolFont.getFontData(aFontName, nFontPitch, nFontFamily, rFilterBase)) + if (bSymbol && aTextCharacterProps.maSymbolFont.getFontData(aFontName, nFontPitch, nFontFamily, &bSymbolEnc, rFilterBase)) { aPropSet.setAnyProperty(PROP_CharFontName, Any(aFontName)); aPropSet.setAnyProperty(PROP_CharFontPitch, Any(nFontPitch)); aPropSet.setAnyProperty(PROP_CharFontFamily, Any(nFontFamily)); + aPropSet.setAnyProperty(PROP_CharFontCharSet, Any(bSymbolEnc ? css::awt::CharSet::SYMBOL : css::awt::CharSet::DONTKNOW)); bReset = true; } @@ -126,6 +130,7 @@ sal_Int32 TextRun::insertAt( aPropSet.setAnyProperty(PROP_CharFontName, aOldFontName); aPropSet.setAnyProperty(PROP_CharFontPitch, aOldFontPitch); aPropSet.setAnyProperty(PROP_CharFontFamily, aOldFontFamily); + aPropSet.setAnyProperty(PROP_CharFontCharSet, aOldFontCharSet); } nIndex += nCount; |