Bug 52286 - FILESAVE as .RTF will show subscript and superscript with normal font height instead of reduced height
Summary: FILESAVE as .RTF will show subscript and superscript with normal font height ...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
3.5.3 release
Hardware: Other All
: medium normal
Assignee: Miklos Vajna
URL:
Whiteboard: BSA target:4.1.0 target:4.0.0.2 targe...
Keywords: filter:rtf, regression
Depends on:
Blocks:
 
Reported: 2012-07-20 04:31 UTC by freeseek
Modified: 2015-12-17 12:07 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Sample Document (8.99 KB, application/vnd.oasis.opendocument.text)
2012-07-20 07:00 UTC, Rainer Bielefeld Retired
Details

Note You need to log in before you can comment on or make changes to this bug.
Description freeseek 2012-07-20 04:31:49 UTC
Problem description: 
When saving a document with superscript as an rtf file, the formatting of the superscripts changes, and reopening the file presents a file different from the original one.

Steps to reproduce:
1. Create a new file, write some text, select some of it, and superscript it with Ctrl+Shift+P
2. Save the document as an rtf file
3. Exit and reopen the file

Current behavior:
superscript formatting changes. In the rtf, the \super keyword changes to the \up## keyword (# stand for numbers 0-9). This yields a different formatting. (changing the \up## back to \super with a text editor fixes the formatting). The same happens with subscripts (\sub becomes \dn##)

Expected behavior:
The formatting of superscripts should not change when saving as an rtf file

Platform (if different from the browser): 
              
Browser: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.1132.57 Safari/536.11
Comment 1 Rainer Bielefeld Retired 2012-07-20 06:59:08 UTC
[Reproducible] with "LibreOffice  3.5.5.3.  German UI/Locale [Build-ID: 7122e39-92ed229-498d286-15e43b4-d70da21] on German WIN7 Home Premium (64bit) and attached sample document. Saving it as .rtf still shows wubscript and superscript, but without reduced font size.

Still [Reproducible] with parallel installation of Master "LOdev " 3.7.0.0.alpha0+   - WIN7 Home Premium (64bit) ENGLISH UI [Build ID: 25608fb]" (tinderbox: 2008R2@20, pull time 2012-07-14 00:31:17)

This sounds very similar to "Bug 36538 - FILESAVE: RTF does not apply subscript font size reduction".
Was ok for me  with "LibreOffice 3.5.1.2 German UI/Locale [Build-ID: dc9775d-05ecbee-0851ad3-1586698-727bf66] on German WIN7 Home Premium (64bit), so it seems that the bug reappeared

@Miklós:
Can you please check?
Comment 2 Rainer Bielefeld Retired 2012-07-20 07:00:05 UTC
Created attachment 64416 [details]
Sample Document

Save as .rtf to reproduce the problem!
Comment 3 Rainer Bielefeld Retired 2012-07-20 07:07:48 UTC
This might be a combined FILEOPEN / FILESAVE problem?
May be fix for Bug 36538 was incomplete or some kine fo fFILEOPEN fix?

With 3.5.1 saved as .rtf looked ok when I reopened the document with 3.5.1. But bug reported here is visible for that .rtf with LibO 3.5.5 and MS Word Viewer.

When I save the sample document form 3.5.5, it will be shown with reported problem in 3.5.5 and MS WORD viewer. But strange, opening it with 3.5.1.2 shows subscript and superscript correctly
Comment 4 freeseek 2012-07-20 14:53:51 UTC
Just to clarify, the following command line will fix the rtf file:
sed -i -e 's/\\up[0-9]*/\\super/g' -e 's/\\dn[0-9]*/\\sub/g' input.rtf
It will then look okay when opened with LibreOffice. Of course, if you save the file again, then the problem re-surfaces again. I am in no way an expert in the rtf format. I discovered this by trial and error. I would bet this is a mishandling/forgetting of the \super and \sub keywords from LibreOffice side.
Comment 5 Not Assigned 2013-01-17 09:06:08 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=796e9a796603397c79e160610c8541e16dfc4c82

fdo#52286 fix RTF export of sub/super script font height



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 6 Miklos Vajna 2013-01-17 10:13:38 UTC
-4-0 review: https://gerrit.libreoffice.org/1731
-3-6 review: https://gerrit.libreoffice.org/1732
Comment 7 Not Assigned 2013-01-17 11:33:24 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "libreoffice-4-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=865471d966b6db24ece283a0c7a70ce1cea921fe&h=libreoffice-4-0

fdo#52286 fix RTF export of sub/super script font height


It will be available in LibreOffice 4.0.

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 8 Not Assigned 2013-01-17 11:44:38 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "libreoffice-3-6":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=598223e6f828f0e4bedf3f9840703d14f4316048&h=libreoffice-3-6

fdo#52286 fix RTF export of sub/super script font height


It will be available in LibreOffice 3.6.6.

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 9 Robinson Tryon (qubit) 2015-12-17 12:07:36 UTC
Migrating Whiteboard tags to Keywords: (filter:rtf)
Replace rtf_filter -> filter:rtf.
[NinjaEdit]