tdf#138223 oox: don't set highlight color if it is transparent
Probably when this was first implemented in 6.4,
it should have set a transparency threshold of when to accept
the color as the background (perhaps at 50%).
But since this has already been running for a while,
I only cancel it if it is fully transparent.
No existing unit tests matched this scenario.
I'm not making a unit test because the color really
ought to be set - it should just be transparent.
LO doesn't seem to have a character highlight
transparency capability, so this needs to be emulated.
Change-Id: I7b295894e529f8345cadc9b30bc43598a9a02e2b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125670
Tested-by: Jenkins
Reviewed-by: Justin Luth <jluth@mail.com>
(cherry picked from commit 283586c89a0542efb2d57a36ee3aad7cc5153ed5)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125465
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
diff --git a/oox/source/drawingml/textcharacterproperties.cxx b/oox/source/drawingml/textcharacterproperties.cxx
index 4eb5aca..ca1d2af 100644
--- a/oox/source/drawingml/textcharacterproperties.cxx
+++ b/oox/source/drawingml/textcharacterproperties.cxx
@@ -175,7 +175,7 @@ void TextCharacterProperties::pushToPropMap( PropertyMap& rPropMap, const XmlFil
}
// TODO If bUnderlineFillFollowText uFillTx (CT_TextUnderlineFillFollowText) is set, fill color of the underline should be the same color as the text
if( maHighlightColor.isUsed() )
if (maHighlightColor.isUsed() && maHighlightColor.getTransparency() != 100)
rPropMap.setProperty( PROP_CharBackColor, maHighlightColor.getColor( rFilter.getGraphicHelper() ));
else
rPropMap.setProperty( PROP_CharBackColor, sal_Int32(-1));