summaryrefslogtreecommitdiff
path: root/sw/source/filter
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2020-02-24 09:44:36 +0100
committerMiklos Vajna <vmiklos@collabora.com>2020-02-24 13:20:17 +0100
commit634a9ba15d65b6fdc506326e6b49b4b957c5cfcb (patch)
tree708f8359f35a80fac70f9dfde4496aba6c6715f3 /sw/source/filter
parent5e8b6d3b721ba8730bc7a5b335418340e3f89c3e (diff)
tdf#130812 DOC import: fix unexpected transparency of text
DOC can have black with transparency set to 0xff, and that is meant to be just black. Allow COL_AUTO, though; the rendering will not consider that as transparent anyway. Other than that, DOC does not support text with transparency, it's a DOCX-only feature. Change-Id: I33f61b54b8ebd7958845063ae61900182d6f5e80 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89321 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'sw/source/filter')
-rw-r--r--sw/source/filter/ww8/ww8par6.cxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx
index 992409d562c8..15b3cca4ca34 100644
--- a/sw/source/filter/ww8/ww8par6.cxx
+++ b/sw/source/filter/ww8/ww8par6.cxx
@@ -3589,6 +3589,13 @@ void SwWW8ImplReader::Read_TextForeColor(sal_uInt16, const sal_uInt8* pData, sho
else
{
Color aColor(msfilter::util::BGRToRGB(SVBT32ToUInt32(pData)));
+
+ // At least when transparency is 0xff and the color is black, Word renders that as black.
+ if (aColor.GetTransparency() && aColor != COL_AUTO)
+ {
+ aColor.SetTransparency(0);
+ }
+
NewAttr(SvxColorItem(aColor, RES_CHRATR_COLOR));
if (m_pCurrentColl && m_xStyles)
m_xStyles->mbTextColChanged = true;