Bug 123189 - DOCX FILEOPEN Table level fill color setting in DOCX documents is ignored by Microsoft Word but not by LibreOffice Writer
Summary: DOCX FILEOPEN Table level fill color setting in DOCX documents is ignored by ...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.3.0.0.alpha0+
Hardware: All All
: medium normal
Assignee: László Németh
URL:
Whiteboard: target:6.3.0
Keywords:
: 102520 (view as bug list)
Depends on:
Blocks: DOCX-Tables
  Show dependency treegraph
 
Reported: 2019-02-05 14:07 UTC by Gabor Kelemen (allotropia)
Modified: 2024-04-16 07:15 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Example file from Word 2013 (17.56 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2019-02-05 14:07 UTC, Gabor Kelemen (allotropia)
Details
Screenshot of the document in Word and Writer (108.03 KB, image/png)
2019-02-05 14:08 UTC, Gabor Kelemen (allotropia)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gabor Kelemen (allotropia) 2019-02-05 14:07:35 UTC
Created attachment 148921 [details]
Example file from Word 2013

Microsoft Word stores the table level background fill color setting in OOXML (DOCX) files, but doesn't actually use it. This causes problems, when there is a fill color set on the table level, but the fill color of the individual cells is set to auto.

This bug can only be reproduced by using Microsoft Word.

Steps to reproduce:
    1. Create a new text document in Microsoft Word.
    2. Insert a 1 column wide, 3 row height table.
    3. Select the whole table and set the background fill color for the whole table to black.
    4. select the second and third rows and change the background fill to auto.
    5. Delete the first row of the table.
    6. Save the file as DOCX.
    7. Open the file both in LibreOffice Writer and Microsoft Word.

Actual results:
The background in LibreOffice Writer turns black because the table level setting is interpreted.

Expected results:
LibreOffice Writer should ignore the table level background color fill setting and just use the per cell level settings just like Microsoft Word does.

Additional details:
After poking around on the user interface and getting an understanding what actually happens on the XML level I determined, that Microsoft Word doesn't actually have a table level background fill color option despite what it tells:

1. The user can set a table level fill color but this just actually turns all individual cell setting at once. This is evident if you change individual cells fill color after changing the “table” fill color: When you check the “table” level setting you will actually see the background color of the selected cell and not what was formerly set as “table” level setting.

2. Changing the fill color of an individual cell to “auto” turns it into color of the background behind the table, and not the color of the table, because the table doesn't actually have a color, only the cells have. This behavior is the complete opposite of what LibreOffice Writer does, which actually has a real table level background fill property.

3. Despite all of the above, if a table level fill color was set when the document was edited it is still stored in the XML file somewhere between <w:tbl> (table) and the first <w:tc> (table cell) tag (so, as a table level setting) in a tag like this: <w:shd w:val="clear" w:color="auto" w:fill="000000" w:themeFill="text1"/>. This setting is kept in the file even if every single cell has been altered or deleted after the table level fill color was set – and despite that Microsoft Word doesn't even have a “real” table level fill color setting. The best thing to do is probably ignore this altogether when importing a DOCX file.

Version: 6.3.0.0.alpha0+
Build ID: fcc5fc76c33de566cb2d02be541dcbde29d1eb8a
CPU threads: 4; OS: Windows 6.3; UI render: GL; VCL: win; 
Locale: hu-HU (hu_HU); UI-Language: en-US
Calc: threaded
Comment 1 Gabor Kelemen (allotropia) 2019-02-05 14:08:10 UTC
Created attachment 148922 [details]
Screenshot of the document in Word and Writer
Comment 2 Commit Notification 2019-02-05 23:38:51 UTC
László Németh committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/+/82fb7f9f90a3ba9d53b3412124e513aa78ddca10%5E%21

tdf#123189 DOCX import: skip table bkground color

It will be available in 6.3.0.

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

Affected users are encouraged to test the fix and report feedback.
Comment 3 Gabor Kelemen (allotropia) 2019-11-16 14:45:52 UTC
*** Bug 102520 has been marked as a duplicate of this bug. ***
Comment 4 KiaraLhotsky 2023-09-15 13:42:52 UTC
Thanks for such a detailed explanation
Comment 5 KaylaSimson 2023-09-15 13:44:47 UTC
The DOCX table settings offer remarkable convenience for organizing information seamlessly. It's like paying for research paper expertise at essayshark( https://essayshark.com/pay-for-research-paper.html ) - efficient, precise, and tailored to your needs. The ease of use and customization options make it a valuable tool for presenting data effectively. Just like at essayshark.com, where you pay for research paper assistance, DOCX tables simplify the process, ensuring a polished result every time.
Comment 6 Teatger 2024-01-22 07:42:47 UTC
You can see the result at https://drift-boss.io
Comment 7 Sharon Thomas 2024-04-16 07:15:59 UTC
(In reply to Commit Notification from comment #2)
> László Németh committed a patch related to this issue.
> It has been pushed to "master":
> 
> https://git.libreoffice.org/core/+/ https://poppyplaytimechapter3.io
> 82fb7f9f90a3ba9d53b3412124e513aa78ddca10%5E%21
> 
> tdf#123189 DOCX import: skip table bkground color
> 
> It will be available in 6.3.0.
> 
> The patch should be included in the daily builds available at
> https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
> information about daily builds can be found at:
> https://wiki.documentfoundation.org/Testing_Daily_Builds
> 
> Affected users are encouraged to test the fix and report feedback.

Thanks for the source.