Bug 99602 - FILESAVE: subscript in character style not converted into docx
Summary: FILESAVE: subscript in character style not converted into docx
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Justin L
URL:
Whiteboard: target:6.4.0 target:6.3.3 target:6.5....
Keywords: bibisected, bisected, filter:docx, regression
Depends on:
Blocks: DOCX-Character
  Show dependency treegraph
 
Reported: 2016-05-01 09:14 UTC by Jelle
Modified: 2022-06-24 18:39 UTC (History)
8 users (show)

See Also:
Crash report or crash signature:


Attachments
File with subscripted texts using different mechanisms (11.06 KB, application/vnd.oasis.opendocument.text)
2016-05-01 09:14 UTC, Jelle
Details
resulting PDF in daily 20160502 (11.10 KB, application/pdf)
2016-05-03 12:29 UTC, Cor Nouws
Details
resulting PDF in 4.0.0.1 (11.42 KB, application/pdf)
2016-05-03 12:29 UTC, Cor Nouws
Details
Subscript test file with better descriptions saved in LibreOffice 6.0.5.2 (12.18 KB, application/vnd.oasis.opendocument.text)
2018-07-10 04:38 UTC, Jelle
Details
Screenshot of subscript test file saved and opened in LO 6.0 as .odt (138.51 KB, image/png)
2018-07-10 04:40 UTC, Jelle
Details
Screenshot of subscript test file saved and opened in LO 6.0 as .docx (137.43 KB, image/png)
2018-07-10 04:42 UTC, Jelle
Details
Screenshot of subscript test file saved and opened in LO 6.0 as .doc (139.92 KB, image/png)
2018-07-10 04:42 UTC, Jelle
Details
Screenshot of subscript test file saved and opened in LO 3.3 as .odt (89.20 KB, image/png)
2018-07-10 04:43 UTC, Jelle
Details
Screenshot of subscript test file saved and opened in LO 3.3 as .docx (91.94 KB, image/png)
2018-07-10 04:44 UTC, Jelle
Details
Screenshot of subscript test file saved and opened in LO 3.3 as .doc (89.79 KB, image/png)
2018-07-10 04:44 UTC, Jelle
Details
tdf99602_charStyleSubscript3.odt: nasty example of non-default complications (11.24 KB, application/vnd.oasis.opendocument.text)
2019-12-07 08:07 UTC, Justin L
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jelle 2016-05-01 09:14:12 UTC
Created attachment 124759 [details]
File with subscripted texts using different mechanisms

When a subscript is defined as part of a character style it is lost upon conversion into a docx file. It is kep when converting into a doc file, but with potential changes to relative size and positioning.

The attached file is my test file with subscripted text added in different ways. Check out the paragraph styles used for the different subscript formats.

I have only tested this on an Intel PC under Xubuntu 14.04 Linux (64bit).

When I convert this into a docx file then all the subscripts applied through a character style are lost. When I convert it into a doc file it tries to apply subscript formatting from the character style, but relative font size and positioning are wrong. The subscript formatting is only retained when it is applied without using a character style.

Superscript gives the same problems, although I have not made a test file to try all the different permutations for this.

I do wonder if this is a regression because I do not recall having this problem in earlier version of LibreOffice, although I may simply not have been paying enough attention to what happened to subscripts on conversion to MS Word formats.
Comment 1 Cor Nouws 2016-05-03 12:28:08 UTC
Thanks for reporting Jelle,

(In reply to Jelle from comment #0)
> Created attachment 124759 [details]
> File with subscripted texts using different mechanisms

Nice.

I have converted the file to docx in recent daily build and in version 4.0.0.1.
Then reopened the file and exported to PDF.
There is no difference for me in these versions.
The positioning in 2nd, 3rd and 4th option is all lost: text is at base line. But the size looks ~OK.

I will attach my pdf files
Comment 2 Cor Nouws 2016-05-03 12:29:17 UTC
Created attachment 124809 [details]
resulting PDF in daily 20160502
Comment 3 Cor Nouws 2016-05-03 12:29:59 UTC
Created attachment 124810 [details]
resulting PDF in 4.0.0.1
Comment 4 raal 2016-05-03 12:56:50 UTC
I can confirm with Version: 5.2.0.0.alpha0+ and 4.5; win7

Cor, click on subscript text and you will see on the toolbar that "subscript button" is not "pressed" in docx.
Comment 5 QA Administrators 2018-06-26 02:44:50 UTC Comment hidden (obsolete)
Comment 6 Terrence Enger 2018-06-30 17:51:58 UTC
Working on debian-buster in daily Linux dbgutil bibisect repository
version 2018-06-30, I see that in the newly created .docx when
reopened in LO the line ...

   This is text with asubscript created with a character style with
   also different position

has the word "subscript" in a smaller font as expected, but its
baseline is raised to the baseline of the rest of the line.

I am deeming the bug still to be present.
Comment 7 Jelle 2018-07-01 09:53:53 UTC
As requested in e-mail from bugzilla-daemon@bugs.documentfoundation.org on 26 Jun 2018 I just tried it again in LibreOffice 6.0.

Info from Help - About LibreOffice is as follows:
Version: 6.0.5.2
Build ID: 1:6.0.5~rc2-0ubuntu0.18.04.1~lo1
CPU threads: 8; OS: Linux 4.15; UI render: default; VCL: gtk3; 
Locale: en-NZ (en_NZ.UTF-8); Calc: group

I can confirm the bug is still present.

The .docx file does change the font size resulting from the character subscript style, but it does not change the position on the line. It still stays on the same height as regular characters.

The .doc file also changes the position of the subscripted characters, but to different levels of the original in the .odt file.
Comment 8 Jelle 2018-07-07 02:54:57 UTC
I have also just tried it in LibreOffice 3.3, as suggested by last e-mail I received. This is LibreOffice 3.3.0.4 in a virtual machine running Xubuntu Linux 16.04.

To some degree the bug already existed then, although its behaviour in 3.3 was better than it is now. As a result I have added 'regression' to the keywords, but also changed the version to 'inherited from OOo'.

The file saved in .doc format looks pretty much the same in version 3.3 as in 6.0. Subscript heights are different from the baseline, but also different from original .odt document.

The file saved in .docx format looks better in version 3.3 than in 6.0. The subscript height is different from the .odt original, and also different from the .doc version, but at least it is not on the baseline. 

All this relates to subscripts set with a character style. A subscript created with Ctrl-Shift-B looks OK in all versions.

I hope that provides some more info.
Comment 9 Xisco Faulí 2018-07-09 10:58:41 UTC
Hello Jelle,
Could you please add a screenshot comparing LibreOffice 3.3 and master to see what have changed and make it easier to investigate the regression ?
Comment 10 Jelle 2018-07-10 04:38:50 UTC
Created attachment 143414 [details]
Subscript test file with better descriptions saved in LibreOffice 6.0.5.2
Comment 11 Jelle 2018-07-10 04:40:56 UTC
Created attachment 143415 [details]
Screenshot of subscript test file saved and opened in LO 6.0 as .odt
Comment 12 Jelle 2018-07-10 04:42:06 UTC
Created attachment 143416 [details]
Screenshot of subscript test file saved and opened in LO 6.0 as .docx
Comment 13 Jelle 2018-07-10 04:42:44 UTC
Created attachment 143417 [details]
Screenshot of subscript test file saved and opened in LO 6.0 as .doc
Comment 14 Jelle 2018-07-10 04:43:23 UTC
Created attachment 143418 [details]
Screenshot of subscript test file saved and opened in LO 3.3 as .odt
Comment 15 Jelle 2018-07-10 04:44:14 UTC
Created attachment 143419 [details]
Screenshot of subscript test file saved and opened in LO 3.3 as .docx
Comment 16 Jelle 2018-07-10 04:44:52 UTC
Created attachment 143421 [details]
Screenshot of subscript test file saved and opened in LO 3.3 as .doc
Comment 17 Jelle 2018-07-10 04:47:10 UTC
(In reply to Xisco Faulí from comment #9)

Thank you for your interest. I have uploaded the screenshots I took from results in Libreoffice 6.0 and 3.3. I also uploaded the testfile itself, which I edited to have a bit more extended descriptions of what is going on. I hope that helps.
Comment 18 Justin L 2019-01-31 09:13:07 UTC
Using bibisect-43all, we found that docx subscripted characters moved to the baseline on Aug 8-9 2012, likely the result of
author	Lubos Lunák2012-08-08 16:32:56 +0200
commit e70df84352d3670508a4666c97df44f82c1ce934
try somewhat harder to read w:position (bnc#773061)

This is the same range we found for bug 122421.
Comment 19 Justin L 2019-10-01 19:11:32 UTC
DOCX looked good earlier in 2012 because no matter what the value said, it just used default superscript/subscript values - which arguably is the better choice in this situation - especially since round-tripping the document doesn't do well with sub/superscripts.
https://cgit.freedesktop.org/libreoffice/core/commit/?h=libreoffice-6-2-8&id=e70df84352d3670508a4666c97df44f82c1ce934

I expect that IsStyleSheetImport() don't process the "deferCharacterProperty", so that is why it is now missing in docx.
Comment 20 Commit Notification 2019-10-04 10:50:12 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/8eb0d8daa526d1c53363954d4d8730cad55f1910

related tdf#99602 writerfilter: deferredCharProps unhandled in Styles

It will be available in 6.4.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 21 Justin L 2019-10-04 13:13:04 UTC
Proposed commits:
-https://gerrit.libreoffice.org/80178 related tdf#99602 writerfilter: deferredCharProps unhandled in Styles
-https://gerrit.libreoffice.org/80179 related tdf#99602 writerfilter TODO: subscript - use ParaStyle fontsize
-https://gerrit.libreoffice.org/80180 NFC writerfilter: preparation for adding CharProps to GetAnyProperty
-https://gerrit.libreoffice.org/80216 related tdf#99602 writerfilter TODO: subscript - use CharStyle fontsize

-https://gerrit.libreoffice.org/80217 related tdf#99602 docxoutput: fix incorrect rounding on subscripts
-https://gerrit.libreoffice.org/80218 related tdf#99602 ww8/rtfoutput: fix incorrect rounding on subscripts

-https://gerrit.libreoffice.org/80219 tdf#99602 writerfilter: import subscript into character style
Comment 22 Commit Notification 2019-10-07 07:30:33 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/875793d841165aaaaefa2c34b855e8f0f8a8c214

related tdf#99602 writerfilter TODO: subscript - use ParaStyle fontsize

It will be available in 6.4.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 23 Commit Notification 2019-10-07 07:38:14 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "libreoffice-6-3":

https://git.libreoffice.org/core/commit/2c2bc4f58233e88d59577a6fb49661955a7b50e2

related tdf#99602 writerfilter: deferredCharProps unhandled in Styles

It will be available in 6.3.3.

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 24 Commit Notification 2019-10-28 14:10:18 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/9b8052bba91ed616de77006cd0d3dee3965caece

related tdf#99602 writerfilter TODO: subscript - use CharStyle fontsize

It will be available in 6.4.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 25 Commit Notification 2019-10-31 07:54:01 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/aaa242a33b01e87c41f19fca871cafa857fe71dd

related tdf#99602 ww8/rtfoutput: fix incorrect rounding on subscripts

It will be available in 6.4.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 Commit Notification 2019-10-31 07:54:34 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

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

related tdf#99602 docxoutput: fix incorrect rounding on subscripts

It will be available in 6.4.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 27 Commit Notification 2019-11-06 10:31:08 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/d71cf6390a89ea6a4fab724e3a7996f28ca33661

tdf#99602 writerfilter: import subscript into character style

It will be available in 6.4.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 28 Commit Notification 2019-12-04 09:43:15 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/8f7010eb47119a2428b77f5d79fc8577d9914958

tdf#99602 writerfilter: export only default subscript in styles

It will be available in 6.5.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 29 Commit Notification 2019-12-06 10:21:09 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "libreoffice-6-4":

https://git.libreoffice.org/core/commit/35efcf0a8e2d33dc3e9c24254ca7767ac921cea5

tdf#99602 writerfilter: export only default subscript in styles

It will be available in 6.4.0.1.

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 30 Justin L 2019-12-07 07:42:26 UTC
After many commits mentioned here as well as fixes for bug 120412 and bug 127316, this bug report should be fixed in LO 6.4.

DOCX: Please note that the character-style subscripts are set to automatic/default values intentionally, regardless of what the user entered for relative size/position. NOT doing that in direct formatting caused lots of these problems in the first place, and adding a style into the mix only complicates it that much more. It is better to let the computer be smart about subscripts, rather than to pretend that we can make print-perfect matching between two completely different ways of describing subscripts/superscripts.
Comment 31 Justin L 2019-12-07 08:07:16 UTC
Created attachment 156387 [details]
tdf99602_charStyleSubscript3.odt: nasty example of non-default complications

Anyone who wants to pretend that LO and MSO can compatibly interchange settings should make this example work perfectly in .doc and .docx format...

The character style specifies the position and relative size, and direct formatting specifies the fontsize.  Good luck.