Bug 65403 - FILEOPEN: DOCX Import of text with highlighting and character shading loses highlighting
Summary: FILEOPEN: DOCX Import of text with highlighting and character shading loses h...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.0.3.3 release
Hardware: All All
: medium normal
Assignee: Not Assigned
QA Contact: Jorendc
URL:
Whiteboard: BSA target:4.2.0
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-05 09:19 UTC by Adam CloudOn
Modified: 2015-03-21 16:09 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
DOCX containing text with highlighting *and* character shading (11.42 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2013-06-05 09:19 UTC, Adam CloudOn
Details
Screenshot comparison between MS Word and LibreOffice (116.15 KB, image/png)
2013-09-21 17:26 UTC, Adam CloudOn
Details
attachment for comment 11 (50.87 KB, application/zip)
2014-11-20 20:11 UTC, Norbert X
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Adam CloudOn 2013-06-05 09:19:35 UTC
Created attachment 80329 [details]
DOCX containing text with highlighting *and* character shading

Problem description: 
When loading a DOCX in LO that has text with highlighting *AND* character shading - the highlighting is not shown.
When loading the same DOCX in Word - the highlighting *is* shown on the text.
The only effect you see of the character shading is in the spaces between the words that have highlighting. Word does not do overlapping of the character shading and the text highlighting, but it *does not* lose the information, 
meaning - if you remove the highlighting from one of the words in Word, you *will* see the character shading on that word.

This is related to the bug I opened here:
https://www.libreoffice.org/bugzilla/show_bug.cgi?id=65399
(that bug speaks about the character shading itself only)

Steps to reproduce:
1. Open the attached DOCX in LO
2. There is no highlighting on the text - only a dark-gray shading to the entire text.

Current behavior:
LO colors the entire text with dark-gray character shading.

Expected behavior:
LO should show the text with highlighted colors and between the words show the light-gray character shading.
              
Operating System: Windows 8
Version: 4.0.3.3 release
Comment 1 Jorendc 2013-06-08 09:15:34 UTC
I can confirm that using Mac OSX 10.8.3 with LibreOffice 4.1.0 beta 2, with Word for Mac 2011. Thanks again for these clear bug reports ;-)!

Kind regards,
Joren
Comment 2 Adam CloudOn 2013-09-21 17:26:27 UTC
Created attachment 86278 [details]
Screenshot comparison between MS Word and LibreOffice
Comment 3 Commit Notification 2013-09-29 09:37:01 UTC
Zolnai Tamas committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=8b949134441056a1455d67ddfdd7e0bc5f2ee682

fdo#65403, fdo#65404 DOCX export/import of character highlight



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 4 Caolán McNamara 2013-10-08 10:50:50 UTC
*** Bug 64490 has been marked as a duplicate of this bug. ***
Comment 5 Tamás Zolnai 2014-08-04 10:00:02 UTC
Import of highlight character attribute was set back to the previous state with merging it with character shading into one character background:
http://cgit.freedesktop.org/libreoffice/core/commit/?id=b5e60724ac73bb0e62b249145a8931fd6166bb69

Importing highlight as a second character border causes regressions and makes highlight uneditable on UI. It should be disabled until the full highlight support is implemented.
Comment 6 Norbert X 2014-08-04 11:08:22 UTC
If it may help - I have made some changes ( 
http://cgit.freedesktop.org/libreoffice/core/commit/?id=7eafd8ccac56d7503b4287dfa3acac2cf0560b20
) to highlight handling in RTF (see bug 79599), Miklos Vajna have reviewed them on Gerrit ( https://gerrit.libreoffice.org/#/c/9776/ ).
Comment 7 Norbert X 2014-08-07 13:45:53 UTC
Tested on Version: 4.3.0.4
Build ID: 430m0(Build:4)
on Ubuntu 12.04 LTS from PPA

= there is no bug.
Comment 8 Norbert X 2014-08-07 13:48:27 UTC
Tested self-compiled 4.3 with patch to bug 79599 (see comment 6) - I can't reproduces this bug. 
So my changes in DomainMapper are not related to this bug.
Comment 9 Timur 2014-10-03 08:04:21 UTC
How come that:
- I can't reproduce this with LO 4.2.6.3 (OK) but 
- I can with 4.3.2.2 (NOK)?
Comment 10 Timur 2014-11-18 19:03:01 UTC
I can't reproduce the bug with LO 4.2.6.3 and 4.3.0.3 (OK) but 
I can with 4.2.7.2, 4.3.1.2, 4.3.2.2, 4.3.4.1 and 4.4.0 alpha2 (NOK)

(In reply to Norbert X from comment #6)
> If it may help - I have made some changes ( 
> http://cgit.freedesktop.org/libreoffice/core/commit/
> ?id=7eafd8ccac56d7503b4287dfa3acac2cf0560b20
> ) to highlight handling in RTF (see bug 79599), Miklos Vajna have reviewed
> them on Gerrit ( https://gerrit.libreoffice.org/#/c/9776/ ).

The correct ones were published by Aug 3, 2014. Norbert's comment and change was on Aug 4, 2014. Can this be related?
Comment 11 Norbert X 2014-11-20 19:13:50 UTC
Original description does not describe version of Word in which the file was created.

For saving DOC and DOCX files I used:
1. I use MS Word 2003 SP3 (11.8169.8172) as file saver - DOC document with Highlight and Shading.
2. I use MS Word 2007 SP3 (12.0.6612.1000 SP3 MSO 12.0.6607.1000) - DOCX document with Highlight and Shading.

For opening DOC and DOCX files I used:
* LibreOffice 4.3.3.2 (Build ID: 430m0(Build:2)) - I see both highlight and shading, I can remove highlighting (with "Highlighting" button) in LibO, and I can remove shading (with "Background color" button). 
* LibreOffice 4.4.0.0.alpha2 (Build ID: 24f0a5815f581dd9a7f09d30213a379edee6e9ac) - I see both highlight and shading, I can remove highlighting (with "Highlighting" button) in LibO, but can't remove shading (with "Background color" button).

I tested 4.3.3.2 and 4.4.0 about bug 79599 - it is fixed in these versions. 


IMHO we have one more example of Microsoft pronouncing of term "Open Standards".
Comment 12 Norbert X 2014-11-20 20:11:22 UTC
Created attachment 109778 [details]
attachment for comment 11
Comment 13 Norbert X 2014-11-20 20:18:11 UTC
As a conclusion I can say the following - I can't fix bug 65403, bug 65404, bug 64490 by myself (they are more difficult than bug 79599). But I'm ready to test changes.

But these bugs brake normal document exchange between MS Word' and LibO Writer' users, so they should be fixed as soon as possible in LibO 4.3 and upcoming 4.4.
Developers can use my attachments: DOC-to-ODT [1] and ODT-to-DOC [2] for round-trip testing.


1. https://bugs.freedesktop.org/attachment.cgi?id=109778
2. https://bugs.freedesktop.org/attachment.cgi?id=109775
Comment 14 Tamás Zolnai 2015-03-21 16:07:13 UTC
Fixed now:
http://cgit.freedesktop.org/libreoffice/core/log/?qt=range&q=8f01925d98dabdbf400c9263e08242267b2b9701..cfbb1f47acfbf3318071d20c73c44df8916a51fa

DOCX import does not loose highlighting or shading. Both will be there in the document until on a specific text range they are overwritten by LibreOffice editing (applying character background).
Comment 15 Tamás Zolnai 2015-03-21 16:09:23 UTC
(In reply to Zolnai Tamás from comment #14)
> Fixed now:
> http://cgit.freedesktop.org/libreoffice/core/log/
> ?qt=range&q=8f01925d98dabdbf400c9263e08242267b2b9701..
> cfbb1f47acfbf3318071d20c73c44df8916a51fa

Fixed on master, will be available in the next LO release: 4.5.