libreoffice/bsc1201095.patch
Danilo Spinella 8d612db3a1 Accepting request 1031287 from LibreOffice:7.4
- Fix bsc#1201095 - LO-L3: Text box shows that does not show in PowerPoint
  * bsc1201095.patch

OBS-URL: https://build.opensuse.org/request/show/1031287
OBS-URL: https://build.opensuse.org/package/show/LibreOffice:Factory/libreoffice?expand=0&rev=1042
2022-10-26 13:02:12 +00:00

48 lines
2.3 KiB
Diff

From 37e5c4fcbacb73138fe47bf12e27961a47b11af3 Mon Sep 17 00:00:00 2001
From: Sarper Akdemir <sarper.akdemir@collabora.com>
Date: Mon, 17 Oct 2022 09:06:20 +0300
Subject: [PATCH] tdf#151547 pptx import: workaround for COL_AUTO collision
In the current implementation of ::Color, it is not possible
to have fully transparent white text (since it collides with
COL_AUTO and gets interpreted as Automatic Color).
Implement a workaround for import of fully transparent white
text color so that it isn't interpreted as the magic value
COL_AUTO (i.e. instead of fully transparent #FFFFFF import
as fully transparent #FFFFFE).
Change-Id: Ide750093ef8a89f1424ddd8f4e9ee1e18209f2ad
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141439
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit adfdd2bee4d1d59bf1ee372d9c242cf0b691e423)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141748
Reviewed-by: Andras Timar <andras.timar@collabora.com>
---
.../drawingml/textcharacterproperties.cxx | 8 +++++-
.../tdf151547-transparent-white-text.pptx | Bin 0 -> 32731 bytes
sd/qa/unit/import-tests2.cxx | 23 ++++++++++++++++++
3 files changed, 30 insertions(+), 1 deletion(-)
create mode 100644 sd/qa/unit/data/pptx/tdf151547-transparent-white-text.pptx
diff --git a/oox/source/drawingml/textcharacterproperties.cxx b/oox/source/drawingml/textcharacterproperties.cxx
index 7be4d89ae57c..e7bc36763049 100644
--- a/oox/source/drawingml/textcharacterproperties.cxx
+++ b/oox/source/drawingml/textcharacterproperties.cxx
@@ -142,7 +142,13 @@ void TextCharacterProperties::pushToPropMap( PropertyMap& rPropMap, const XmlFil
if (aColor.hasTransparency())
{
- rPropMap.setProperty(PROP_CharTransparence, aColor.getTransparency());
+ const auto nTransparency = aColor.getTransparency();
+ rPropMap.setProperty(PROP_CharTransparence, nTransparency);
+
+ // WORKAROUND: Fully transparent white has the same value as COL_AUTO, avoid collision
+ if (nTransparency == 100
+ && aColor.getColor(rFilter.getGraphicHelper()).GetRGBColor() == COL_AUTO.GetRGBColor())
+ rPropMap.setProperty(PROP_CharColor, ::Color(ColorTransparency, 0xFFFFFFFE));
}
}