summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
Diffstat (limited to 'oox')
-rw-r--r--oox/source/drawingml/textcharacterproperties.cxx8
-rw-r--r--oox/source/export/drawingml.cxx24
2 files changed, 30 insertions, 2 deletions
diff --git a/oox/source/drawingml/textcharacterproperties.cxx b/oox/source/drawingml/textcharacterproperties.cxx
index 7ffeaeba8da2..9d568cd5cabb 100644
--- a/oox/source/drawingml/textcharacterproperties.cxx
+++ b/oox/source/drawingml/textcharacterproperties.cxx
@@ -111,6 +111,7 @@ void TextCharacterProperties::pushToPropMap( PropertyMap& rPropMap, const XmlFil
if ( maFillProperties.moFillType.has() )
{
Color aColor = maFillProperties.getBestSolidColor();
+ bool bContoured = false;
// noFill doesn't exist for characters. Map noFill to 99% transparency
if (maFillProperties.moFillType.get() == XML_noFill)
@@ -124,7 +125,11 @@ void TextCharacterProperties::pushToPropMap( PropertyMap& rPropMap, const XmlFil
{
Color aLineColor = moTextOutlineProperties.get().maLineFill.getBestSolidColor();
sal_Int16 nLineTransparency = aLineColor.getTransparency();
- if (nLineTransparency < aColor.getTransparency())
+
+ // tdf#127696 If the text color is white (and the outline color doesn't dominate),
+ // then this is contoured text in LO.
+ if (nLineTransparency < aColor.getTransparency()
+ || (bContoured = aColor.getColor(rFilter.getGraphicHelper()) == COL_WHITE))
aColor = aLineColor;
}
rPropMap.setProperty(PROP_CharColor, aColor.getColor(rFilter.getGraphicHelper()));
@@ -133,6 +138,7 @@ void TextCharacterProperties::pushToPropMap( PropertyMap& rPropMap, const XmlFil
rPropMap.setProperty(PROP_CharColorTintOrShade, aColor.getTintOrShade());
rPropMap.setProperty(PROP_CharColorLumMod, aColor.getLumMod());
rPropMap.setProperty(PROP_CharColorLumOff, aColor.getLumOff());
+ rPropMap.setProperty(PROP_CharContoured, bContoured);
if (aColor.hasTransparency())
{
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 8581535357a0..d87c6cccddee 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -2201,9 +2201,31 @@ void DrawingML::WriteRunProperties( const Reference< XPropertySet >& rRun, bool
nTransparency = MAX_PERCENT - (nTransparency * PER_PERCENT);
}
+ bool bContoured = false;
+ if (GetProperty(rXPropSet, "CharContoured"))
+ bContoured = *o3tl::doAccess<bool>(mAny);
+
+ // tdf#127696 If the CharContoured is true, then the text color is white and the outline color is the CharColor.
+ if (bContoured)
+ {
+ mpFS->startElementNS(XML_a, XML_ln);
+ if (color == COL_AUTO)
+ {
+ mbIsBackgroundDark ? WriteSolidFill(COL_WHITE) : WriteSolidFill(COL_BLACK);
+ }
+ else
+ {
+ color.SetAlpha(255);
+ if (!WriteCharColor(rXPropSet))
+ WriteSolidFill(color, nTransparency);
+ }
+ mpFS->endElementNS(XML_a, XML_ln);
+
+ WriteSolidFill(COL_WHITE);
+ }
// tdf#104219 In LibreOffice and MS Office, there are two types of colors:
// Automatic and Fixed. OOXML is setting automatic color, by not providing color.
- if( color != COL_AUTO )
+ else if( color != COL_AUTO )
{
color.SetAlpha(255);
// TODO: special handle embossed/engraved