Bug 72511 - Comment note on a DOC from MS Word for Mac 2008 appears wrongly on Writer
Summary: Comment note on a DOC from MS Word for Mac 2008 appears wrongly on Writer
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.1.2.3 release
Hardware: All All
: medium minor
Assignee: Not Assigned
URL:
Whiteboard: target:24.8.0
Keywords:
Depends on:
Blocks: DOC-Comments
  Show dependency treegraph
 
Reported: 2013-12-09 09:34 UTC by Kumāra
Modified: 2024-05-16 18:53 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Comment note on a DOC from MS Word for Mac 2008 (6.68 KB, image/png)
2013-12-09 09:34 UTC, Kumāra
Details
See comment notes on pg2 (62.00 KB, application/msword)
2013-12-11 04:35 UTC, Kumāra
Details
comment with indent (9.90 KB, application/vnd.oasis.opendocument.text)
2015-04-19 18:46 UTC, Gordo
Details
A docx and a doc (16.26 KB, application/zip)
2015-04-25 15:51 UTC, Gordo
Details
comment indent.doc: modified version including a textbox with indented text (23.50 KB, application/msword)
2024-05-10 12:37 UTC, Justin L
Details
comment indent.pdf: how the DOCX file looks in Word 2019 (42.09 KB, application/pdf)
2024-05-16 18:49 UTC, Justin L
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kumāra 2013-12-09 09:34:28 UTC
Created attachment 90498 [details]
Comment note on a DOC from MS Word for Mac 2008

Comment note on a DOC from MS Word for Mac 2008 appears wrong on Writer. The attached shows the note (with name scrabbled). The whole string of text is "squeezed" to the right, forming a column of single characters.
Comment 1 Kumāra 2013-12-09 09:35:59 UTC
Sorry. Forgot to indicate platform.
Comment 2 retired 2013-12-10 09:25:27 UTC
Can you please provide a test document so this can be tested against and subsequently be confirmed. If your document contains sensitive data, please clear that or replace it with random information.

A step-by-step description of how to reproduce the issue is most helpful and will help to speed up the processing of this problem a lot.

Setting to NEEDINFO until more detail is provided.

After providing the requested info, please reset this bug to UNCONFIRMED. Thanks :)
Comment 3 Kumāra 2013-12-11 04:35:49 UTC
Created attachment 90596 [details]
See comment notes on pg2

Here you go. Notice that the note on pg1 is by me on LO. The 2 other notes on pg2 were done on a Word for Mac 2008.
Comment 4 Kumāra 2013-12-11 08:05:26 UTC
With the needed info provided, I set the status back to NEW.
Comment 5 QA Administrators 2015-04-19 03:21:18 UTC Comment hidden (obsolete)
Comment 6 Gordo 2015-04-19 18:46:13 UTC
Created attachment 114922 [details]
comment with indent

This bug was never confirmed.

The document that I attached was done without the use of MS Word.  The only way to correct the comment without deleting it is to use the Sidebar -> Properties -> Paragraph and change the Indent to 0.00cm.

In the original document, the Sidebar says the indent is 4.00cm, but if you copy the comment to a new document then the indent is 3.67cm.

Anyway,  MS Word seems to ignore the indents in the comments even though you can adjust it there.

Version: 4.4.2.2
Build ID: c4c7d32d0d49397cad38d62472b0bc8acff48dd6

Changed to UNCONFIRMED so that another set of eyes can look at this.
Comment 7 Kumāra 2015-04-23 04:08:30 UTC
(In reply to Gordo from comment #6)
> Created attachment 114922 [details]
> comment with indent
> 
> This bug was never confirmed.
> 
> The document that I attached was done without the use of MS Word.

Thanks for joining in, but if yours wasn't created with MS Word for Mac 2008, I wonder how it relates to the bug I reported.
Comment 8 Alex Thurgood 2015-04-25 14:19:09 UTC
Tested on :

Word for Mac 2015 15.9 (Preview) - comments appear fine.

Version: 5.0.0.0.alpha1+
Build ID: a1c01c510c9fbc6e2be9f4b9db12c3493939942a
Locale : fr_

The comments on page 2 and following are shifted to the right hand edge and spread vertically

Confirming bug.
Comment 9 Alex Thurgood 2015-04-25 14:29:08 UTC
The test document is allegedly in Word DOC 97-2004 format, at least according to Word / Mac Office 2015.

Even if I resave as DOCX and skip compatibility with previous format in Word, it still displays incorrectly in LO.

Note that even the first comment with the hyperlink is truncated in LO, whereas in Word it isn't.
Comment 10 Alex Thurgood 2015-04-25 14:33:01 UTC
All of this being said, it is unlikely that a problem created with Word 2008 for Mac will be corrected, unless it can be shown that a similar document produced on Word 97-2004 on Windows shows the same erroneous behaviour on import into LO.

Word 2008 for Mac is EOL, and developer resources are too low on the ground to be able to debug import problems with documents that were made with it. I am leaving the bug report open, but don't hold your breath about a fix.
Comment 11 Gordo 2015-04-25 15:51:16 UTC
Created attachment 115093 [details]
A docx and a doc

These attachments were created in MS Word 2013 on Windows.  I added the indentation to the comment then saved as docx.  I then saved the docx as a doc.

MS Word shows the indentation in the docx.  Writer does not.
MS Word does not show the indentation in the doc.  Writer does.

In Word for Mac, if you create a new document with a comment and save as doc, does it always show an indentation when opened in Writer?  Was there any round tripping involved?
Comment 12 Kumāra 2015-04-27 10:40:07 UTC
It's only once I had to deal with such a doc. So, downgrading it to minor.
Comment 13 QA Administrators 2016-09-20 09:33:47 UTC Comment hidden (obsolete)
Comment 14 Roman Kuznetsov 2018-12-19 13:53:07 UTC
still repro in

Version: 6.3.0.0.alpha0+
Build ID: 2b9739b9b009de93efa4f24995469c3bb9d82261
CPU threads: 4; OS: Windows 6.1; UI render: default; VCL: win; 
TinderBox: Win-x86@42, Branch:master, Time: 2018-12-18_23:09:56
Locale: ru-RU (ru_RU); UI-Language: en-US
Calc: threaded
Comment 15 Justin L 2020-04-24 09:18:21 UTC
repro 7.0+.  LO indents doc comment, but not docx.

(In reply to Gordo from comment #11)
> MS Word [2013] shows the indentation in the docx.  Writer does not.

However, using Word 2016, it does not indent either the doc or the docx.


So I looked for the reason why Writer does not indent for docx (and you will notice that in the paragraph properties the margin is 0). The reason is because of an exception :-)
writerfilter/source/dmapper/DomainMapper_Impl.cxx:1663: ::finishParagraph calling TextAppend->finishParagraph
writerfilter/source/dmapper/DomainMapper_Impl.cxx:1893: finishParagraph() com.sun.star.beans.UnknownPropertyException message: Unknown property: ParaStyleName

So, because of an exception with unknown comment property ParaStyleName, it ignores all of the following properties (like <w:ind w:left="2268"/>). In other words, docx works by accident...
Comment 16 Justin L 2020-04-24 10:48:10 UTC
I need to backpedal a bit on Word 2016 not displaying the indent for DOCX. It does to some extent. For example, I can enter a negative indent, and some text moves out of sight. However, it is using a different scale, because it certainly does not indent as much as I say, because 4cm is closer to 1, and 10cm is closer to 2.

For interest sake, see a similar DOCX problem for comment character attributes in commit https://cgit.freedesktop.org/libreoffice/core/commit/?id=deabda6b38417e4c7037c0d0274a4f81b338e552

I will confirm that Word 2016 doesn't do any indenting for DOC.
Comment 17 QA Administrators 2022-04-25 03:27:06 UTC Comment hidden (obsolete, spam)
Comment 18 QA Administrators 2024-04-25 03:16:24 UTC Comment hidden (obsolete, spam)
Comment 19 Justin L 2024-05-08 15:04:14 UTC
The file "Why 'One Beat Slow' (v1.1)-2 lzed1.doc" from comment 0 is fixed by
LO 7.6 commit db115bec9254417ef7a3faf687478fe5424ab378
Author: Michael Stahl on Tue Feb 14 18:03:55 2023 +0100
    tdf#78510 sw,cui: split SvxLRSpaceItem for SwTextNode, SwTextFormatColl

It also fixed "comment indent.doc" from comment 11.
Comment 20 Justin L 2024-05-08 15:11:47 UTC
(In reply to Gordo from comment #11)
> MS Word shows the indentation in the docx.  Writer does not.
repro 24.8+ with "comment index.docx" from comment 11 - still with exception.
Comment 21 Justin L 2024-05-08 17:35:20 UTC
I thought it would have been fixed in 24.2 via bug 103064, but I guess not.

editeng/source/uno/unotext.cxx SvxPropertyValuesToItemSet
  const SfxItemPropertyMapEntry *pEntry
      = pPropSet->getPropertyMap().getByName( rProp.Name );
  if (!pEntry)
     throw beans::UnknownPropertyException( "Unknown property: " + rProp.Name );
Comment 22 Justin L 2024-05-08 17:45:11 UTC
The exception could be avoided with
+    if (aParaStyle && IsInComments())
+    {
+        pParaContext->Erase(PROP_PARA_STYLE_NAME);
+    }
     aProperties = comphelper::sequenceToContainer< std::vector<beans::PropertyValue> >(pPropertyMap->GetPropertyValues());
Comment 23 Justin L 2024-05-09 12:24:07 UTC
(In reply to Justin L from comment #19)
> The file "Why 'One Beat Slow' (v1.1)-2 lzed1.doc" from comment 0 is fixed ...
> It also fixed "comment indent.doc" from comment 11.
I can only imagine that this is actually a mistake. The comment paragraph in MS Word clearly has a 4cm indent, but in LO it is a 0cm indent. So, likely this problem will come back again. If so, it seems reasonable to intentionally remove the indent, since it simply is ignored in MSO 2003/2010 as well.
Comment 24 Justin L 2024-05-10 12:37:05 UTC
Created attachment 194074 [details]
comment indent.doc: modified version including a textbox with indented text

(In reply to Justin L from comment #23)
> I can only imagine that this is actually a mistake.
Definitely a regression, as seen by the textbox's now non-indented contents.

I assume it is related to this part of mstahl's commit message:
   "Leave editengine and non-paragraph usages of SvxLRSpaceItem as-is for now."
Comment 25 Commit Notification 2024-05-16 07:54:39 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/7fcd5ac42086f1374c3bd5eb2be9a59e6f38f2e3

tdf#72511 tdf#78510 ww8import: recombine into SvxLRSpaceItem for EE

It will be available in 24.8.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 26 Justin L 2024-05-16 18:49:11 UTC
Created attachment 194156 [details]
comment indent.pdf: how the DOCX file looks in Word 2019

> (In reply to Gordo from comment #11)
> > MS Word [2013] shows the indentation in the docx.  Writer does not.
> 
(Paraphrasing Justin L from comment #16)
> However, using Word 2016+, it does not fully indent the docx.
Still true in MS Word 2019 - the 4cm comment indent looks more like 1cm. So, since MS Word is also very buggy in this area, it doesn't look like anything worth "fixing".

Since the title of this report is about the DOC format, and that has been resolved, I'm going to close this report as FIXED.