Bug 64490 - LibO Writer text highligthing not compatible with MS Word DOC and DOCX (highlighting transforms to background color)
Summary: LibO Writer text highligthing not compatible with MS Word DOC and DOCX (highl...
Status: CLOSED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: highest major
Assignee: Tamás Zolnai
URL:
Whiteboard: Confirmed:4.2.0.3:OSX target:5.0.0
Keywords:
: 37540 60892 75426 82935 (view as bug list)
Depends on:
Blocks: mab4.3
  Show dependency treegraph
 
Reported: 2013-05-12 13:52 UTC by Norbert X
Modified: 2020-11-20 12:53 UTC (History)
27 users (show)

See Also:
Crash report or crash signature:


Attachments
demo file with highlighting, which is not removable in MS Office 2003+ (9.00 KB, application/msword)
2013-05-12 13:52 UTC, Norbert X
Details
full diary with screenshots for comment 11 (301.78 KB, application/vnd.oasis.opendocument.text)
2013-10-08 12:04 UTC, Norbert X
Details
exported docx - from step 5 (see comment 11) (40.34 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2013-10-08 12:05 UTC, Norbert X
Details
Three files from Windows version of 4.2.0.4. (13.79 KB, application/x-zip-compressed)
2014-01-31 20:25 UTC, Romano Giannetti
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Norbert X 2013-05-12 13:52:13 UTC
Created attachment 79194 [details]
demo file with highlighting, which is not removable in MS Office 2003+

Description of problem:
   Broken interoperability between LibreOffice writer and Microsoft Office Word.

Version-Release number of selected component (if applicable):
* Debian 7 with LibreOffice 3.5.4.2 Build ID: 350m1(Build:2);
* Ubuntu 12.04.2 LTS with LibreOffice 3.5.7.2 Build ID: 350m1(Build:2)
* Ubuntu 12.10 with Version 3.6.2.2 (Build ID: 360m1(Build:2));
* openSUSE 12.3 "Dartmouth" with Version 3.6:build-304 (Build ID: 360m1(Build:304));
* Fedora 18 with Version 3.6.6.2 (Build ID: 3.6.6.2-5.fc18);
* Fedora 19 with Version 4.0.3.1 (Build ID: 4.0.3.1-2.fc19) and Version 4.0.3.3 (Build ID: 4.0.3.3-1.fc19);
* Ubuntu 13.04 with Version 4.0.2.2 (Build ID: 400m0(Build:2));
* Windows 7 Starter SP1 with LibreOffice 4.0.2.2 (ID сборки 4c82...49c3) and Версия 4.0.3.3 (ID сборки: 0eaa50a932c8f2199a615e1eb30f7ac74279539).



Steps to Reproduce:
1. Create a DOC/DOCX document with some text and mark in LibreOffice Writer. 
2. Use highlighting yellow marker from toolbar to mark some words. 
3. Save document.
4. Open document in MS Word 2003+ and try to change higlight color from yellow to white. 
5. Yellow highlighting is still present. There is only one way to remove it - change/remove its style from Styles and formatting sidebar.

  
Expected results:
   Highligting must be changed as it done in MS Office - via Highligting button, not from Styles.


Additional info:
   This bug has 9 years history.
Comment 1 Romano Giannetti 2013-05-12 14:18:51 UTC
Confirmed. I am not sure this is a bug --- could be simply a basic incompatibility in the design of the "OO.org" dinasty and the MS suite[1], but it is surely the most important (IMHO) interoperability problem, simply because it will bit you *for sure* ("Please comment on the highlighted part" --- "hey, I an unable to undo the highlighting, what have you done?"). 

     Romano 

[1] explication: I digged the RTF files and MS Word uses two different properties for background and highlighting, the latter with precedence on the former. Not being a developer, I do not know if LO has the separate concept... if no, I understand this could be almost impossible to fix (think backward compatibility of the files).
Comment 2 Julien Nabet 2013-05-18 14:50:54 UTC
Comment on attachment 79194 [details]
demo file with highlighting, which is not removable in MS Office 2003+

Mimetype fixed
Comment 3 Julien Nabet 2013-05-18 14:57:22 UTC
Michael/Miklos: this bug seems more general than fdo#37540. So I would put 37540 as a dup of this one.
For the moment I'll put this at New, even if I can't confirm myself since I don't have MsOffice, because 37540 describe a similar behaviour.

Anyway, the most important is it seems we got an incompatibility here. Any idea?
Comment 4 Romano Giannetti 2013-05-18 15:16:08 UTC
The bug#37540 and this one are clearly the same. I have MS office and I can produce all the test files you need --- simply tell me. 
In the bug#37540 I have attached an analysis of a RTF file that shows the problem. 
I had lost any hope that this one could be fixable... as I said, maybe it's not trivial at all.
Comment 5 Julien Nabet 2013-05-18 15:22:21 UTC
Romano: My entire previous comment was for both core devs quoted (Michael and Miklos) that I put on cc list. Sorry for the confusion.
Comment 6 ign_christian 2013-07-13 03:29:29 UTC
*** Bug 60892 has been marked as a duplicate of this bug. ***
Comment 7 engineer 2013-09-03 16:38:47 UTC
[writer][bullets] when highlighting is turned off for a text with bullets, the text is correctly displayed but the bullets are not.
reproduced on x86_64 linux, libreoffice-4.1.1.2
Comment 8 Norbert X 2013-10-07 10:08:35 UTC
Hello!

Bug is still exist in the latest Windows build of LibreOffice
(
LibreOffice 4.1.2.3
Версия: 4.1.2.3
ID сборки: 40b2d7fde7e8d2d7bc5a449dc65df4d08a7dd38
).

Please fix it as soon as possible.

Highlighting marker is used very often.
It breaks normal document exchange between Microsoft Office Word users and LO/OO users.
Comment 9 Norbert X 2013-10-07 10:11:17 UTC
I mean: "Highlighting marker is used very often.

But this bug breaks normal document exchange between Microsoft Office Word users and LO/OO users."
Comment 10 Caolán McNamara 2013-10-08 10:50:50 UTC
So docx is done as bug 65403 and bug 65404 so I'll mark this as a dup of that and leave bug 37540 open for the .doc which we need to double check to see if that's implemented yet or not

*** This bug has been marked as a duplicate of bug 65403 ***
Comment 11 Norbert X 2013-10-08 12:02:53 UTC
Hello!

Thank you for your great work and for your commit, Zolnai Tamas!

I downloaded a latest daily build from here (http://dev-builds.libreoffice.org/daily/master/Win-x86@39/current/master~2013-10-08_08.41.40_LibreOfficeDev_4.2.0.0.alpha0_Win_x86.msi).
{
Version: 4.2.0.0.alpha0+
Build ID: 8850633fe4cdac306c35caab1a0d14c13d9df864
TinderBox: Win-x86@39, Branch:master, Time: 2013-10-08_08:41:40
}

It seem that bug is not fixed (wrong version?).
I can not remove highlighting in Word using DOCX and highlighting marker.

What I did:
0. Open LibreOffice Writer 4.2
1. I wrote some text
2. Set a highlight of its fragment
3. Got yellow highlight of selected fragment
4. Saved this file as fdo64490.odt (Ctrl+S) and fdo64490.docx (Ctrl+Shift+S)
5. Opened fdo64490.docx with Microsoft Office Word 2007 (12.0.6683.5001) SP3 MSO (12.0.6683.5000)
6. I tried to remove highlighting with white marker
   But highlightment remains.
7. If I try to remove higlightment with background button
– it works

So I do not know what was changed as it works like before. Highlightning is 
replaced by shading (background) again.

I created two attachments - fdo64490.odt (full diary with screenshots) and fdo64490.docx (exported docx - from step 5).
Comment 12 Norbert X 2013-10-08 12:04:55 UTC
Created attachment 87274 [details]
full diary with screenshots for comment 11
Comment 13 Norbert X 2013-10-08 12:05:35 UTC
Created attachment 87275 [details]
exported docx - from step 5 (see comment 11)
Comment 14 Tamás Zolnai 2013-10-08 12:52:06 UTC
Hi,

My patch only makes able to display highlighting imported from DOCX files and export it back to a new DOCX file. I didn't even know that LibreOffice has a highlight feature (and as I see by know it's just a toolbar item working as a simple character background, not a really existing feature). So the bug isn't solved, however my patch contains implementation of a highlight attribute so the next step should be to link the toolbar item with this new attribute instead of character background and then it will be exported/imported well to/from DOCX.

So I reopen the bug. 

(In reply to comment #11)
> Hello!
> 
> Thank you for your great work and for your commit, Zolnai Tamas!
> 
> I downloaded a latest daily build from here
> (http://dev-builds.libreoffice.org/daily/master/Win-x86@39/current/
> master~2013-10-08_08.41.40_LibreOfficeDev_4.2.0.0.alpha0_Win_x86.msi).
> {
> Version: 4.2.0.0.alpha0+
> Build ID: 8850633fe4cdac306c35caab1a0d14c13d9df864
> TinderBox: Win-x86@39, Branch:master, Time: 2013-10-08_08:41:40
> }
> 
> It seem that bug is not fixed (wrong version?).
> I can not remove highlighting in Word using DOCX and highlighting marker.
> 
> What I did:
> 0. Open LibreOffice Writer 4.2
> 1. I wrote some text
> 2. Set a highlight of its fragment
> 3. Got yellow highlight of selected fragment
> 4. Saved this file as fdo64490.odt (Ctrl+S) and fdo64490.docx (Ctrl+Shift+S)
> 5. Opened fdo64490.docx with Microsoft Office Word 2007 (12.0.6683.5001) SP3
> MSO (12.0.6683.5000)
> 6. I tried to remove highlighting with white marker
>    But highlightment remains.
> 7. If I try to remove higlightment with background button
> – it works
> 
> So I do not know what was changed as it works like before. Highlightning is 
> replaced by shading (background) again.
> 
> I created two attachments - fdo64490.odt (full diary with screenshots) and
> fdo64490.docx (exported docx - from step 5).
Comment 15 Romano Giannetti 2013-10-08 14:16:07 UTC
Hi. 
Just notice that this bug is here since the start of time --- the linked bug on apache.org is from 2004, but I am sure there are traces of it before that date. I was trying to find the 

One of the problems is that this is not really a bug; it's a difference in design between OO and derivatives and MS Office and so it can be marked as a "interoperability problem".

It has been repeatedly marked as a low-importance issue; I am still advocating that this problem is the *main* reason I have to run MS Office under Crossover in my daily job. So my humble opinion is that this issue should be marked as very important (as is in bug https://bugs.freedesktop.org/show_bug.cgi?id=37540 ). 

Thanks!
Comment 16 Sergey Krylov 2013-11-11 19:45:12 UTC
Have the samee problem
Comment 17 retired 2014-01-27 10:36:48 UTC
Confirmed:4.2.0.3:OSX

Open test file, marked color is not removable when opened with MS Word 2011.
Comment 18 Romano Giannetti 2014-01-30 15:21:06 UTC
Shouldn't this bug being marked as a duplicate of https://bugs.freedesktop.org/show_bug.cgi?id=37540 ? They are basically the same issue.
Comment 19 Norbert X 2014-01-30 15:47:44 UTC
*** Bug 37540 has been marked as a duplicate of this bug. ***
Comment 20 Norbert X 2014-01-30 15:49:48 UTC
Marked bug 37540 as duplicate of this bug because of better explanation of the problem (see attachments of bug 64490 - they are useful for performing tests against this bug).
Comment 21 Romano Giannetti 2014-01-31 20:25:09 UTC
Created attachment 93149 [details]
Three files from Windows version of 4.2.0.4.

If you open the .doc or .docx file in Microsoft Windows, you can't remove the highlighting.
Comment 22 Romano Giannetti 2014-01-31 20:25:50 UTC
Still here in 4.2.0.4 (tested on windows --- but should be the same).
Comment 23 Chris Peñalver 2014-02-02 23:27:41 UTC
Romano Giannetti, please do not adjust the Version. This is not the latest version the problem is reproducible in, but the earliest. For more on this, please see https://wiki.documentfoundation.org/QA/BugReport .
Comment 24 Romano Giannetti 2014-02-03 03:22:55 UTC
Ok --- sorry for the noise; I though the "release" was where the bug was lately confirmed. 

The bug is still here in 4.2.0.4; I attached the files hoping to help developers.  

BTW, the problem is not here since 3.3.2 as stated in the bug #37540; it's here from the start of time (I have a report from 2004 against OO.org, but it's older). I start to think that this is some fundamental difference by design and it is not easily fixable.
Comment 25 Romano Giannetti 2014-02-03 03:30:43 UTC
@nrbntx: Norbert, normally when you mark a bug as duplicate you mark the newest one as a duplicate of the oldest --- not the other way around... I understand you had quite a bit of nice attacchments here, but the effect of doing that is

1) the older bug was marked as high/major and this one is marked as medium/normal

2) now the launchpad bugtracker marked the bug 295014 as invalid (it is tracking 37540) 

I do not know if it's possible to undo the thing. I certainly was not be able to change the tracking on launchpad...
Comment 26 Norbert X 2014-02-03 16:07:09 UTC
I made two changes (high/major and changed link from launchpad 295014 to this bug) to keep bugs in sync.
Thank you, Romano!
Comment 27 Norbert X 2014-02-03 16:09:40 UTC
I suggest to sync CC lists between LOO and AOO. What do you think?
Comment 28 Jorendc 2014-03-06 22:03:22 UTC
*** Bug 75426 has been marked as a duplicate of this bug. ***
Comment 29 Norbert X 2014-03-09 11:12:04 UTC
Bug exists in 4.3 development version:

Version: 4.3.0.0.alpha0+
Build ID: 335a8a84fe6349fd716d4978346cfff9c884dd9b
TinderBox: Win-x86@47-TDF, Branch:MASTER, Time: 2014-03-08_00:13:32

I marked it as a part of mab43.
Comment 30 Stefan Knorr (astron) 2014-03-09 13:19:57 UTC
@nrbrtx: Please note that a bug should only block a single MAB bug: the MAB bug for the oldest, still supported LibO version with which the bug is reproducible. If the bug is still relevant after the lifetime of that version, the bug is transferred to the next newer version.

Removing from mab4.2 and mab4.3.
Comment 31 Chris Sherlock 2014-03-31 09:27:45 UTC
Any GSoC participants who want to know what happens when they press the highlight toolbar button should review the SfxDispatcher mechanism. It calls on SfxTextShell::Execute(), the slot that it uses is SID_ATTR_CHAR_COLOR_EXT on line 1190 of sw/source/core/ui/textsh1.cxx.

I hope that helps a little bit. You'll probably also need to look at how Word handles highlighting in the docx format. I'll leave that as an exercise for the student :-)

Incidentally, if you ever want to work out what a button uses, then put a breakpoint on SfxDispatcher::Execute - that's how I worked out this.
Comment 32 Daniel Scherer 2014-04-04 19:25:01 UTC
I'm not a developer too, don't know if it's easy or hard to solve, but I think this issue should be treated with high priority, because many users need to work with both softwares.
If someone have a solution, please send me an email. Thanks!
Comment 33 Romano Giannetti 2014-04-04 19:31:26 UTC
It *has* to be difficult. Otherwise why is it open since 2004? On december 1st it will be 10 years old... 

If I understand the issue, the main problem is that in MS Word there are different attributes for character background and highlight, while in LOO/AOO they are considered the same. If this is the case, making the change and maintaining compatibility with older version of LOO/AOO could be, well, difficult. 

Is my guess correct?
Comment 34 tommy27 2014-05-03 08:24:02 UTC
moving to mab4.2 list since 4.1.x is END OF LIFE
Comment 35 Romano Giannetti 2014-05-14 22:21:53 UTC
We are near to 4.3 release, and this bug is here (or in OO.org or in various incarnations of the suite) since 2004. 

The only thing that happens is that it is marked as a "must have" for the current version, and never taken care of. 

Could a developer comment if this is really impossible to fix? I can understand that if the internal data representation is completely different, this thing could be impossible to fix. 

It is a show-stopper for LO in my workplace --- I *have* to be able to interact with MS word and this highlight problem breaks even the simplest document. 

To support the claim that it is a 10-years-old bug: https://issues.apache.org/ooo/show_bug.cgi?id=24317
Comment 36 Björn Michaelsen 2014-05-15 09:27:40 UTC
(In reply to comment #35)
> We are near ...

Please refrain from adding comments to bugs without any additional information. Note that there are companies and individuals providing support if you urgently need a specific fix, but are unable to unable to help with triage or bugfixing yourself.
Comment 37 Romano Giannetti 2014-05-15 14:00:08 UTC
@Björn --- you are right, sorry. 

To add something constructive, I mention I have a workaround if the file is sufficiently simple to be able to save it in RTF: 

1) save the file in RTF format 
2) open it with a text editor (vi, gedit) 
3) substitute all occurrences of 

    "\chshdng0\chcfpat0\chcbpat7" 

   to 

     "\highlight7" 

4) Save it.

Now Word is (usually) able to edit the highlight in the file. I tested it only with simple files --- so YMMV.
Comment 38 Norbert X 2014-05-30 21:22:59 UTC
Please fix this bug. It is extremely annoing. I can't make normal document exchange with colleages, which use MSO 2007/2010 DOCX.

This bug make bad reputation of LibO and AOO for years. 

If you need donation, I'm ready to do it. 
But please fix this bug as soon as possible!!!
Comment 39 Norbert X 2014-06-13 20:03:27 UTC
It seems that MS Word-like highlighting is produced by sprmCHighlight SPRM [see 1, p. 58].

So I think that "Highlighting" marker must use this attribute for compatibility with MS Word user-experience.

I'm trying to fix it by myself, but it seems more difficult, than fixing related RTF-highlightning bug 79599.


1. http://download.microsoft.com/download/0/B/E/0BE8BDD7-E5E8-422A-ABFD-4342ED7AD886/Word97-2007BinaryFileFormat(doc)Specification.pdf
Comment 40 Romano Giannetti 2014-08-05 17:52:24 UTC
I haven't chacked 4.3 --- as anyone checked if this bug is still there?
Thanks!
Comment 41 Norbert X 2014-08-05 18:06:07 UTC
Hello, Romano!
Yes, the bug is still here. According to bug 65403 something gone wrong and for now highlight DOCX import is disabled.

As you can read from my comment 39 - I fixed highlight in RTF as you suggested before (in daily builds of LibO 4.4).
Comment 42 Björn Michaelsen 2014-08-21 12:17:23 UTC
(This is an automated message.)

Setting priority to highest as this is a MAB. This is part of an effort to make the importance of MAB reflected in priority too.
Comment 43 tommy27 2014-08-22 07:29:43 UTC
*** Bug 82935 has been marked as a duplicate of this bug. ***
Comment 44 Airova 2014-10-24 12:54:20 UTC
I just want to note that until this problem is fixed, I will be forced to use MS Office 2010 at work, and they are even considering forcing me to install it on my home computer for when I work from home. I hope it can be fixed soon. I vowed never to install MS Office on my personal computer. :( Thanks!
Comment 45 Norbert X 2014-11-20 20:20:52 UTC
Bug exists in:
1. LibreOffice 4.3.3.2 (Build ID: 430m0(Build:2)). 
2. LibreOffice 4.4.0.0.alpha2 (Build ID: 24f0a5815f581dd9a7f09d30213a379edee6e9ac).


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 47 tommy27 2014-11-25 19:28:22 UTC
moving this to mab4.3 list since 4.2.x reached end of life
Comment 48 Björn Michaelsen 2014-12-12 12:47:15 UTC
Version should be _oldest_ version were this is reproducable, thus updating.
Comment 49 Tamás Zolnai 2015-03-21 16:19:05 UTC
Fixed now:
http://cgit.freedesktop.org/libreoffice/core/log/?qt=range&q=8f01925d98dabdbf400c9263e08242267b2b9701..cfbb1f47acfbf3318071d20c73c44df8916a51fa

Will be available in the next LO release: 4.5.

How it works:
- Both shading and highlighting are preserved during import and export (from/to MSO formats).
- When on a specific text range we change the character background inside LibreOffice both highlighting and shading will be overwritten with LO character background.
- An option is added to choose how to export LO character background to MSO formats (as shading or as highlighting). This option is at: Options -> Tools -> Load/Save -> Microsoft. Default is highlighting.
Comment 50 Norbert X 2015-03-21 16:24:07 UTC
Dear Zolnai Tamás!
Thank you for you commits. I'll test them when they will be compiled into daily/nightly LibO build.

I think they will be useful in LibO 4.4 (EOL in 8 months at 25 October 2015) too.
Comment 51 Tamás Zolnai 2015-03-21 16:29:24 UTC
> - An option is added to choose how to export LO character background to MSO
> formats (as shading or as highlighting). This option is at: Options -> Tools
> -> Load/Save -> Microsoft. Default is highlighting.

Sorry, wrong order. It's actually at Tools -> Options -> Load/Save -> Microsoft
Comment 52 Tamás Zolnai 2015-03-21 16:38:16 UTC
(In reply to Norbert X from comment #50)
> Dear Zolnai Tamás!
> Thank you for you commits. I'll test them when they will be compiled into
> daily/nightly LibO build.
> 
> I think they will be useful in LibO 4.4 (EOL in 8 months at 25 October 2015)
> too.

Hi Norbert,

The problem is this bug fix touches the UI with adding a new option to Options dialog and UI changes are not allowed in bugfix releases.
Comment 53 Mike §chinagl 2015-05-21 15:26:22 UTC
This bug fix is mentioned in the release notes of the coming LibreOffice 5.0 (see release notes https://wiki.documentfoundation.org/ReleaseNotes/5.0). Therefore it would be wonderful if this feature really worked well, otherwise it should be mentioned in the release notes. In the notes it reads:
Both highlighting and shading are preserved during import / export of Microsoft Word documents. tdf#64490 (Tamás Zolnai)
Comment 54 Tamás Zolnai 2015-05-21 19:57:08 UTC
(In reply to Mike §chinagl from comment #53)
> This bug fix is mentioned in the release notes of the coming LibreOffice 5.0
> (see release notes https://wiki.documentfoundation.org/ReleaseNotes/5.0).
> Therefore it would be wonderful if this feature really worked well,
> otherwise it should be mentioned in the release notes. In the notes it reads:
> Both highlighting and shading are preserved during import / export of
> Microsoft Word documents. tdf#64490 (Tamás Zolnai)

It's not really clear for me what you mean. Is there something that doesn't work on the way you expect based on the release notes?

Or is it just about the difference between the bug report title (speaking only about highlighting) and the release notes (having both shading and highlighting)? For that case: This bug report mentioned only the most annoying part of the problem. Shading and highlighting are connected things and we had to handle both of them to solve this issue. So you can lean on the release notes, both attributes are preserved.
Comment 55 Maxim Monastirsky 2015-07-01 11:31:26 UTC
(In reply to Zolnai Tamás from comment #54)
> It's not really clear for me what you mean. Is there something that doesn't
> work on the way you expect based on the release notes?
Just ignore that. This text is copy-pasted to any bug referenced by the release notes.
Comment 56 Eran Dadan 2020-11-12 23:27:28 UTC Comment hidden (spam)