Bug 57589 - FILEOPEN - A particular docx has a black background where text should be
Summary: FILEOPEN - A particular docx has a black background where text should be
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
3.6.3.2 release
Hardware: All All
: medium normal
Assignee: Justin L
URL:
Whiteboard: interoperability target:6.2.0
Keywords: bibisected, bisected, filter:docx, regression
Depends on:
Blocks: DOCX Regressions-DrawingLayer-FillStyles
  Show dependency treegraph
 
Reported: 2012-11-27 01:21 UTC by Alistair Leslie-Hughes
Modified: 2018-08-22 13:43 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
Sample Document that hightlights the issue (14.34 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2012-11-27 01:21 UTC, Alistair Leslie-Hughes
Details
rtf file of the same document (31.19 KB, application/rtf)
2012-11-27 01:23 UTC, Alistair Leslie-Hughes
Details
In LO4.3(01feb2014) only headers of tables are blacked (57.98 KB, image/png)
2014-02-03 15:47 UTC, Alexandr
Details
How it looks in Libreoffice 5.0.0.5 (55.97 KB, image/jpeg)
2015-08-20 09:57 UTC, Xisco Faulí
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alistair Leslie-Hughes 2012-11-27 01:21:53 UTC
Created attachment 70631 [details]
Sample Document that hightlights the issue

Open the Attached docx file.  

Every place that the text should be has a black background, and possible the text is black was well.

This document opens fine in Word.
Comment 1 Alistair Leslie-Hughes 2012-11-27 01:23:08 UTC
Created attachment 70632 [details]
rtf file of the same document

This is what the docx contents should look like.
Comment 2 billhook 2012-11-27 10:14:21 UTC
Confirmed on LO 3.6.4.1 Windows Vista 32bit.

The sample docx opened correctly in Office 2007.
Comment 3 Jorendc 2013-11-03 19:36:56 UTC
Still reproducible using Mac OSX 10.9 with LibreOffice Version: 4.1.3.2
Build ID: 70feb7d99726f064edab4605a8ab840c50ec57a
Comment 4 Alexandr 2014-02-03 15:47:35 UTC
Created attachment 93291 [details]
In LO4.3(01feb2014) only headers of tables are blacked

In LibreOffice 4.1.4.2 and 4.2.0.3 whole text is invisible due to black background. But in LibreOffice 4.3.0.0.alpha0+ Build ID: 599b3c91dc5bd9c04e70b38246acac9914a6b219 TinderBox: Linux-rpm_deb-x86_64@46-TDF, Branch:master, Time: 2014-02-01_23:39:30 the situation is much better: only tables' headers are blacked. I attach a screenshot that demonstrate the progress and remaining problems.
Comment 5 Joel Madero 2015-05-02 15:43:35 UTC Comment hidden (obsolete)
Comment 6 Alexandr 2015-05-04 15:36:52 UTC
Completely reproducible in LibreOffice 4.3.3 and 5.0.0.0 alpha1 on Debian. Every place that the text should be has a black background as it was said in the description, not as in comment 4.
Comment 7 Xisco Faulí 2015-08-20 09:57:16 UTC
Created attachment 118042 [details]
How it looks in Libreoffice 5.0.0.5

Problem still present in

Version: 5.0.0.5
Build ID: 1b1a90865e348b492231e1c451437d7a15bb262b
Locale: es-ES (es_ES)

on Windows 7 (64-bit)
Comment 8 Robinson Tryon (qubit) 2015-12-13 12:18:25 UTC Comment hidden (obsolete)
Comment 9 Xisco Faulí 2016-11-17 09:39:59 UTC
Regression introduced by:

author	Armin Le Grand <alg@apache.org>	2014-06-02 15:00:50 (GMT)
committer	Miklos Vajna <vmiklos@collabora.co.uk>	2014-07-01 11:30:09 (GMT)
commit 7d9bb549d498d6beed2c4050c402d09643febdfa (patch)
tree 2caf67e36c9ccd058268b003cf2bc39b9b102b53
parent a5e137eb1d37361c60175e8fba780fc46b377a23 (diff)

Related: #i124638# Second step of DrawingLayer FillAttributes...
for Writer objects, now added support for Paragraph and PageStyle (including
Header and Footer) for direct attributes and style attributes

Adding Cc: to Armin Le Grand
Comment 10 Xisco Faulí 2017-09-04 20:22:57 UTC
Still reproducible in

Version: 6.0.0.0.alpha0+
Build ID: 04d70c0999c716f5465631eca50945915ec607c4
CPU threads: 4; OS: Linux 4.10; UI render: default; VCL: gtk3; 
Locale: ca-ES (ca_ES.UTF-8); Calc: group
Comment 11 Justin L 2017-10-28 15:52:01 UTC
Round-tripping the original document in MSWord 2003 fixes the black problem for LO. Perhaps this can be round-tripped in other versions of Office first to see if it basically is a corrupt document.
Comment 12 Justin L 2018-08-18 10:44:02 UTC
So, every paragraph style seems to have black specified as the background area color.  (I see a big black blob where the paragraph styles should be seen).
Comment 13 Justin L 2018-08-18 14:31:30 UTC
The problem is that LO isn't parsing #-denoted colors, but just failing to zero (aka black) because

> OOXMLHexValue::OOXMLHexValue(const char * pValue)
> : mnValue(rtl_str_toUInt32(pValue, 16))
doesn't handle # hex notation and so the following fails:

<w:style w:type="paragraph" w:default="1" w:styleId="Normal">
  <w:name w:val="Normal"/>
  <w:pPr>
    <w:shd w:fill="#ffffff"/>
Comment 14 Justin L 2018-08-18 16:39:03 UTC
proposed fix at https://gerrit.libreoffice.org/59295 tdf#57589
Comment 15 Commit Notification 2018-08-21 04:37:00 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=7d01ce4021bafde8184355f46d1cbe2c370767e1

tdf#57589 writerfilter: support hash-encoded colors

It will be available in 6.2.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 16 Xisco Faulí 2018-08-22 13:43:25 UTC
Verified in

Version: 6.2.0.0.alpha0+
Build ID: 60bc26354763fa3461db49a3e827da552484150d
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3; 
Locale: ca-ES (ca_ES.UTF-8); Calc: threaded

@Justin Luth, Thanks for fixing this!!!