Created attachment 66590 [details] Saved file with character styles RTF importer in LO manages to fail import character styles which it has itself created.
Can't reproduce with LO 3.6.1.2 (rus) on Win7x64.
Proof?
Dear Urmas, what kind of proof do you need? I see the same picture as in MS Word Viewer, i.e. four words with different formatting applied. This isn't meant to offend someone; it just indicates that this problem is not reproducible in some specific environment. Thus, it may indicate that the problem is related to some OS(es), or some plugins installed, or something else. By the way, you failed to indicate your OS, so it may be difficult for devs to track the problem.
And how the styles applied to those four word are called? They are lost.
Aha. So this bug is about loss of character style names, not the styles themselves. This misunderstanding happens when reporter ignores bug reporting guidelines and omits the "what is done", "what is expected" and "what happens instead" report sections :) Reproducible under the abovementioned environment. This is the minimal RTF to reproduce: {\rtf1\ansi {\stylesheet; {\*\cs16\ul Anot;} {\*\cs15\i ForeignTxt;} } {\cs16\ul Text } with {\cs15\i character } formatting \par } The word "Text" should have character style "Anot", and "character" should have "ForeignTxt" style applied. But in LO Writer (v. 3.6.2.2) the style is basic. While preparing this testcase, I came across another bug: if I remove semicolon that goes just after "\stylesheet" then the first style in the stylesheet is ignored. In MS Word Viewer (as well as in MS Word) everything works OK.
Status should be NEW (confirmed) according to comment #5. Also improved the summary according to that comment and added Whiteboard tag.
OK, I can confirm that this problem is still REPRODUCIBLE with * LibreOffice 3.6.3.2 (Build ID: 58f22d5) * LOdev 4.0.0.0.alpha0+ (Build ID: 32315e; pull time: 2012-11-13 00:32:26) It is already reproducible with * LibreOffice 3.5.0rc3 (Build-ID: 7e68ba2-a744ebf-1f241b7-c506db1-7d53735) so set Version field to that number (first version in which the bug appears). But it is NOT reproducible with * LibreOffice 3.3.0, OOO330m19 (Build:6), tag libreoffice-3.3.0.4 * LibreOffice 3.4.0, OOO340m1 (Build:12) These Versions import the character styles (more or less) correctly. So this is a regression (added keyword). Also changed the Summary again, to make the problem clear: The custom character styles are all replaced by “Default”; the document uses local formatting instead of character styles now.
@ Miklós Vajna: Hi Miklós, this is a remaining problem of our new RTF import filter. I fear it is not easy to fix this ;-) But it would be nice if you could do something about it, because especially people who like to use character styles (instead of direct/local formatting) for document markup will be angry that all their work is lost, if they open their RTF files with LibreOffice and find that the “Default” character style is used everywhere ... Thank you very much!
@ Mike Kaganski: (In reply to comment #5) > While preparing this testcase, I came across another bug: if I remove > semicolon that goes just after "\stylesheet" then the first style in the > stylesheet is ignored. In MS Word Viewer (as well as in MS Word) everything > works OK. Could you please file a separate (new) bug report for this problem, if it is still reproducible with LibreOffice 3.6.3? (If you CC me: bugs@eikota.de about the new bug report, I will confirm it.) Thank you very much!
I don't see the problem on master (as of today), but I see the problem on -3-6 (as of today). Probably I forgot to backport a fix or so.
OK, I think I know what's going on here. By accident, this works in a debug-enabled build. Will fix it properly in a bit.
Miklos Vajna committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=41890bf714803969515578b47e63fa9730ea7090 fdo#54473 fdo#57133 fix RTF import of character styles 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.
Resolved in master, -3-6 review: https://gerrit.libreoffice.org/1235
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=3d43dc3318a0692287e877b2e70e873372d2c248&g=libreoffice-3-6 fdo#54473 fdo#57133 fix RTF import of character styles It will be available in LibreOffice 3.6.5. 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.
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 Urmas’ attached sample document is now imported correctly, including the character styles. @ Miklós: Thank you very much for fixing this issue! As I have argued in comment #8, under some circumstances this little bug could have been very annoying, therefore I regard your fix as very important. @ Urmas and Mike Kaganski: Thank you very much for noticing and analyzing this issue!
Migrating Whiteboard tags to Keywords: (filter:rtf) Replace rtf_filter -> filter:rtf. [NinjaEdit]