Bug 57133 - FILEOPEN RTF DATALOSS: Character style is ignored when semicolon after "\stylesheet" is absent
Summary: FILEOPEN RTF DATALOSS: Character style is ignored when semicolon after "\styl...
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
3.5.0 release
Hardware: All All
: low minor
Assignee: Miklos Vajna
URL:
Whiteboard: target:4.0.0 target:3.6.5
Keywords: filter:rtf, regression
Depends on: 54473
Blocks:
  Show dependency treegraph
 
Reported: 2012-11-14 22:13 UTC by Mike Kaganski
Modified: 2015-12-17 12:08 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Kaganski 2012-11-14 22:13:28 UTC
When preparing a testcase for Bug 54473, I came across this bug: when there's no semicolon between "\stylesheet" keyword and the first character style, the first style is ignored, i.e. its formatting is not applied to the corresponding text. Here is the testcase:

{\rtf1\ansi
{\stylesheet
{\*\cs16\ul Anot;}
{\*\cs15\i ForeignTxt;}
}
{\cs16\ul Text }
with 
{\cs15\i character }
formatting
\par }

This testcase only differs from the testcase from Bug 54473 comment 5 in one character (absent semicolon after "\stylesheet"). Opening it in Writer, the word "Text" displays not underlined (unlike the testcase from the abovementioned bug). Both MS Word Viewer and MS Word show this file OK.

Notes:
1. This testcase was artificially crafted, so it is not known if this kind of bug may be encountered "in the wild"; thus the priority is low. However, it is still a bug, because it violates the standard.
2. This problem is mentioned in a comment in Bug 54473, so it may happen that it will get fixed by a fix to that bug; thus making this bug depend on Bug 54473 to check when it changes its state. However, it doesn't mean that they necessarily stem from one root.
Comment 1 Roman Eisele 2012-11-15 09:51:45 UTC
Thank you very much for your bug report!

Also REPRODUCIBLE on Mac OS X (10.6.8, Intel), so changed Platform to All/All,
with
* LibreOffice 3.5.0 (Build-ID: 7e68ba2-a744ebf-1f241b7-c506db1-7d53735)
* LibreOffice 3.6.3.2
* LOdev 4.0.0.0.alpha0+ (Build ID: 32315e; pull time: 2012-11-13 00:32:26)

NOT reproducible with
* LibreOffice 3.3.0, OOO330m19 (Build:6), tag libreoffice-3.3.0.4
* LibreOffice 3.4.0, OOO340m1 (Build:12)

So this is a regression compared to the old RTF reader;
adapted Version field (should show the 1st version which is known to contain
the problem) and added “regression” keyword. Added whiteboard tag.


I have to confess that I do not know enough about the RTF standard to judge
if the file without the semicolon after “\stylesheet” is correct.

But when the old versions of LibreOffice (and OOo/AOO!), MS Office, and even simple RTF readers like Apple’s TextEdit *do* read the version without semicolon correctly (like the one with semicolon), LibreOffice should read the file without semicolon, too ...
Comment 2 Roman Eisele 2012-11-15 09:55:32 UTC
@ Miklós Vajna:

Hi Miklós,

this is yet another little RTF reader issue. It is of minor importance compared to other problems, so probably not urgent. But nevertheless it would be nice if you could add this issue to your agenda ...

Thank you very much!
Comment 3 Miklos Vajna 2012-12-04 09:40:44 UTC
Thanks for the separate report, though in this case a oneliner fix will resolve both bugs. :-) I'll push it in a bit when I'm ready with the unit test for this.
Comment 5 Roman Eisele 2012-12-13 08:17:05 UTC
VERIFIED as FIXED on Mac OS X (10.6.8, Intel) with

  Version 4.0.0.0.beta1 (Build ID: 87906242e87d3ddb2ba9827818f2d1416d80cc7)
  TinderBox: MacOSX TDF Release, Branch:libreoffice-4-0,
  Time: 2012-12-05_22:13:37

Mike Kaganski’s test case is now imported correctly with *and* without the semicolon.


@ Miklós:
Thank you very much for fixing this issue!
Comment 6 Roman Eisele 2012-12-13 08:19:35 UTC
For the record:
(In reply to comment #4)
> -3-6 review: https://gerrit.libreoffice.org/1235

Miklós’ patch has been pushed to the 3.6 branch with
http://cgit.freedesktop.org/libreoffice/core/commit/?h=libreoffice-3-6&id=3d43dc3318a0692287e877b2e70e873372d2c248

So this fix will appear in LibreOffice 3.6.5 (and 4.0.0, of course).

Added missing Whiteboard tags (“target:4.0.0 target:3.6.5”).
Comment 7 Robinson Tryon (qubit) 2015-12-17 12:08:45 UTC Comment hidden (obsolete)