Bug 59671 - FILESAVE Tab stop in right margin different in .doc export
Summary: FILESAVE Tab stop in right margin different in .doc export
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
(earliest affected) rc
Hardware: All All
: medium normal
Assignee: Not Assigned
Keywords: bibisected, bisected, filter:doc, regression
Depends on:
Reported: 2013-01-21 17:59 UTC by Jaime Velasco Juan
Modified: 2016-12-24 18:13 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:

screenshot showing the difference (79.00 KB, image/png)
2013-01-21 17:59 UTC, Jaime Velasco Juan
sample documents (8.32 KB, application/zip)
2013-01-21 18:02 UTC, Jaime Velasco Juan
screenshot of MSWord 2013 after opening rightTab.odt (the LO format) (41.60 KB, image/jpeg)
2016-12-17 11:00 UTC, Justin L

Note You need to log in before you can comment on or make changes to this bug.
Description Jaime Velasco Juan 2013-01-21 17:59:45 UTC
Created attachment 73394 [details]
screenshot showing the difference

Steps to reproduce:

Create new Writer document and set a right aligned tab stop past the right margin. Type [tab] and some text. The text will end aligned to the right margin. Save document as .odt and also export as .doc

Open again both files.

Expected result:

Both documents should look the same.

Actual result:

the .odt file will look as expected but the .doc one will have the text beyond the right margin (I hope the diagram shows it clearly).

 page border                                 right margin
 /          left margin                        /    right-aligned tab stop
|          /                                  |     /      right page border
|         |                                   |    |        /
|         |                                   |    +       |

                               Some text in ODT
                                    Some text in DOC


Word 2003 will show the exported .doc file with the text beyond the margin, just like Libreoffice.
Comment 1 Jaime Velasco Juan 2013-01-21 18:02:22 UTC
Created attachment 73395 [details]
sample documents
Comment 2 Joel Madero 2013-01-21 22:29:25 UTC
Verified as a regression, doesn't exist in 3.6, exists in 4.1 master.

Marking as:

New (confirmed)
Normal (can prevent high quality work)
Highest (regression + preventing high quality work + .doc interoperability + very common use of Writer could affect a lot of people)

Will bibisect shortly
Comment 3 Joel Madero 2013-01-21 22:40:21 UTC
Outside of the range of our bibisect package. Every step came out good through bibisect, tested again with 4.1 master and confirmed there is a problem - looks like a patch near release of RC1
Comment 4 Michael Stahl (CIB) 2013-01-23 22:59:49 UTC
between beta 2 and rc 1...
this was introduced with:

commit 908bcce46c54e999916b32dffef34d34f21878d4
Author: Miklos Vajna <vmiklos@suse.cz>
Date:   Tue Jan 8 11:57:13 2013 +0100

    n#793998 sw: add TabOverMargin compat mode
    In case the right margin is larger then the tab position (e.g. the right
    margin of 7cm, there is a tab position at 16cm and right margin begins
    at 9cm), we have a conflicting case.  In Word, the tab has priority, so
    in this conflicting case, the text can be outside the specified margin.
    In Writer, the right margin has priority. Add a compat flag to let
    the tab have priority in Writer as well for Word formats.
    This is similar to TabOverflow, but that was only applied to left tabs
    and only in case there were no characters after the tabs in the

... which sounds nice but is probably not supposed to be turned on when loading the ODF file attached here?  it has this in settings.xml:

      <config:config-item config:name="TabOverMargin" config:type="boolean">false</config:config-item>

hmm... it appears it is always turned on when importing a Word format file,
the flag is not stored in such files.  is that even possible?

is it necessary to convert such tabs on export to Word formats
so the file looks the same in Word as the ODT did in Writer?
Comment 5 QA Administrators 2013-05-27 17:56:16 UTC
This isn't really bibisected but it's basically there as the patch has been identified.

Marking as bibisected
Comment 6 Björn Michaelsen 2014-01-17 00:43:39 UTC Comment hidden (obsolete)
Comment 7 Björn Michaelsen 2014-10-16 14:59:09 UTC Comment hidden (obsolete)
Comment 8 Robinson Tryon (qubit) 2015-12-13 11:09:28 UTC Comment hidden (obsolete)
Comment 9 Björn Michaelsen 2016-08-14 18:47:54 UTC
adding filt:doc keyword.
Comment 10 Xisco Faulí 2016-09-26 09:26:18 UTC
Adding Cc: to Miklos Vajna
Comment 11 Justin L 2016-12-17 10:56:48 UTC
I would suggest this is NOTABUG. The .doc file is doing exactly what it is told to do. Just because ODT doesn't do what it is told to do is somewhat irrelevant.

The fact that MSWord displays the .doc (and .docx btw) file identically to LO is a good indication that LO is doing this correctly.  Doing something correctly now is not a regression.

There is no interoperability problem here right?  Since both Word and LO open it the same way, it is easily shared.  The only problem is format "convertability" and that is because the user has chosen settings that do not match his intentions. (If you want your right tab to end at the right margin, the marker ought to be placed there, and not at some random location beyond that point.) The lack of CCs over 4 years confirms that this will not affect a lot of people. Resetting priority to be medium.

P.S.  MSWord uses the actually position of the right-tab in the *ODT* file as well, the interoperability problem actually comes from incorrectly designed ODT itself. (I wasn't going to change the status at first, but because of this I will actually change the status to notabug.)

IMHO, the only thing that could possibly be done at this point is to reset the right tab to be flush with the right margin when loading an ODT format, OR to change ODF so that it also is allowed to bTabOverMargin.
Comment 12 Justin L 2016-12-17 11:00:44 UTC
Created attachment 129717 [details]
screenshot of MSWord 2013 after opening rightTab.odt (the LO format)