Bug 45394 - [FORMATTING] wrong formatting of rtf file
Summary: [FORMATTING] wrong formatting of rtf file
Status: CLOSED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
3.4.5 release
Hardware: x86 (IA32) Linux (All)
: medium major
Assignee: Miklos Vajna
URL:
Whiteboard: bibisected35 bibisected35older target...
Keywords: filter:rtf, regression
Depends on:
Blocks:
 
Reported: 2012-01-30 04:55 UTC by Dmitry Yakimov
Modified: 2015-12-15 11:54 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
test case, open in LO and in Microsoft Word (98.60 KB, application/zip)
2012-01-30 04:59 UTC, Dmitry Yakimov
Details
Example how bad RTF works in LO (10.45 KB, application/gzip)
2012-03-07 13:07 UTC, Lukasz Wieczorek
Details
rtf comparison in 3.4.5 and 3.5.1 (461.60 KB, image/png)
2012-03-21 01:31 UTC, Vladimir
Details
Converted Report.rtf t pdf format (48.92 KB, application/pdf)
2012-03-22 02:53 UTC, Lukasz Wieczorek
Details
expected layout (278.97 KB, application/pdf)
2012-03-26 07:33 UTC, Lukasz Wieczorek
Details
expected layout in ms word format (258.00 KB, application/msword)
2012-03-26 07:34 UTC, Lukasz Wieczorek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dmitry Yakimov 2012-01-30 04:55:59 UTC
In comparison to Microsoft Word it breaks all formatting
Comment 1 Dmitry Yakimov 2012-01-30 04:59:15 UTC
Created attachment 56322 [details]
test case, open in LO and in Microsoft Word
Comment 2 s-joyemusequna 2012-01-31 08:16:09 UTC
Confirmed  with Windows XP and Windows Vista 64.
LibO 3.4.5: totally unusable, one single page instead of 29.
LibO 3.5 RC2: much much better but not yet fully OK. Basically small glitches.
Comment 3 s-joyemusequna 2012-02-14 11:28:24 UTC
Tested with LibO 3.4.4 (Windows XP). It looks fine (compared to Word 2007).

Result: works with LO 3.4.4, unusable with LO 3.4.5, much better but not good with 3.5.0.

This is a regression.
Comment 4 Dmitry Yakimov 2012-02-14 22:43:11 UTC
I have to note that speed of loading this file in 3.5.0 is very slow, ~5 minutes or so. It is impossible to use it.
Comment 5 s-joyemusequna 2012-02-15 03:11:37 UTC
Correction: it works with LibO 3.3.4 (was 3.4.4).

Another bug with the pattern "LibO 3.3 OK, LibO 3.4 unusable, LibO 3.5 much better but not OK": Bug 45910

I confirm also the loading speed: < 1 s with Word 2007, < 2 s with LiBO 3.3, about 5 minutes (!!) with LiBO 3.5 (100% CPU work load). See also Bug 44736 

Setting importance to "major". Importance of Bug 44736 should probably be set to major too (many RTF files affected).
Comment 6 Björn Michaelsen 2012-03-01 08:53:36 UTC
Regression does appear in oldest version of bibisect-3.5.tar.lzma and must be older.
Comment 7 Lukasz Wieczorek 2012-03-07 13:07:26 UTC
Created attachment 58145 [details]
Example how bad RTF works in LO
Comment 8 Lukasz Wieczorek 2012-03-07 13:09:26 UTC
I attached a very crappy example of RTF document with many objects- it even crashes MS Word on regular basis. Anyway in LO3.5 it is completely unreadable.
Comment 9 Vladimir 2012-03-21 01:31:56 UTC
Created attachment 58799 [details]
rtf comparison in 3.4.5 and 3.5.1

Content is generated by some propietary libs, may be "crystal reports".
Unfortunately it is a part of currently irreplaceable production software complex. LO 3.5.1 is totaly unusable with it.
Comment 10 Vladimir 2012-03-21 01:32:21 UTC
Confirming. RTF import in clearly broken.
Is there any way to switch to old filter in 3.5?

Attached image with two renders of rtf file generated by some (sadly) vital proprietary crap. The upper image is from 3.4.5, lower is in 3.5.1. Screenshots were taken on windows 7, but in linux it is the same. Not a single object in correct place.

Unfortunately, I can't attach rtf itself, because it is generated, and can not be created without sensible data, or altered without ruining it further.
Comment 11 Jean-Baptiste Faure 2012-03-21 14:44:27 UTC
@Lukasz: are you sure that your file is valid RTF? Abiword says that it encounters some errors and WordPad what seems to be the RTF code itself.
LO 3.3.4 shows an empty table.
Could you attach a PDF, a .doc or a ODT of the same document showing what we you see ?

Best regards. JBF
Comment 12 Lukasz Wieczorek 2012-03-22 02:51:51 UTC
(In reply to comment #11)
> @Lukasz: are you sure that your file is valid RTF? Abiword says that it
> encounters some errors and WordPad what seems to be the RTF code itself.
> LO 3.3.4 shows an empty table.
>
Jean,

I downloaded attached file, unzip it, open and converted to pdf in LO 3.5.1.2. Will upload it in a minute.
Comment 13 Lukasz Wieczorek 2012-03-22 02:53:20 UTC
Created attachment 58853 [details]
Converted Report.rtf t pdf format
Comment 14 Jean-Baptiste Faure 2012-03-23 13:57:39 UTC
(In reply to comment #11)
> @Lukasz: are you sure that your file is valid RTF? Abiword says that it
> encounters some errors and WordPad what seems to be the RTF code itself.
> LO 3.3.4 shows an empty table.
> Could you attach a PDF, a .doc or a ODT of the same document showing what we
> you see ?

Sorry, my English is too bad :-) Last sentence should be read as follows :
Could you attach a PDF, a .doc or a ODT of the same document showing what we should see (when it is correctly displayed) ?
 
Best regards. JBF
Comment 15 Lukasz Wieczorek 2012-03-26 07:32:17 UTC
Jean,

I uploaded docs in two format which present expected layout.

Have a nice day!
Comment 16 Lukasz Wieczorek 2012-03-26 07:33:33 UTC
Created attachment 59069 [details]
expected layout
Comment 17 Lukasz Wieczorek 2012-03-26 07:34:13 UTC
Created attachment 59070 [details]
expected layout in ms word format
Comment 18 Miklos Vajna 2012-03-29 03:01:29 UTC
I can confirm that the table at the start of the document is missing (the text is available as normal paragraphs only), it seems this is caused by the importer not handling tables at the start of the document which have only empty cells in their first rows. I'll try to fix this soon.
Comment 19 Lukasz Wieczorek 2012-03-29 03:41:25 UTC
Miklos, 

The problem is that this is not a table, but the whole document consist of a bunch of floating OLE objects, so this documents even crashes any version of MS Office while editing... I know, I know, the person who choose this format instead of regular html table should hang, but ones this opens correctly, LO will better than any MSO :).
Comment 20 Not Assigned 2012-03-29 06:57:25 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "master":

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

fdo#45394 fix RTF import of tables with empty first row
Comment 21 Not Assigned 2012-03-29 06:57:52 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=6b7942f5ac0498414931a0e7842aa96452b7a04d

fdo#45394 fix RTF import of custom fonts in substreams
Comment 22 Miklos Vajna 2012-03-29 07:08:01 UTC
Lukasz, Vladimir,

Sorry, looks like your test documents are not related to this bug. To avoid confusion (when a single bug number refers to independent issues) please open a separate bugreport for independent issues.

I'll close this bug once Dmitry's original document is imported correctly in master (and as usual, will request cherry-picking the fixes to -3-5 as well).

Miklos
Comment 23 Not Assigned 2012-03-30 01:50:59 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=0827e813f9b5afcec393bad7894c4ec1954d88f1

testcase for fdo#45394
Comment 24 Miklos Vajna 2012-03-30 01:57:48 UTC
Fixed in master, marking as resolved.
Comment 25 Lukasz Wieczorek 2012-03-31 12:54:12 UTC
> 
> Sorry, looks like your test documents are not related to this bug. To avoid
> confusion (when a single bug number refers to independent issues) please open a
> separate bugreport for independent issues.
> 
> Miklos

Miklos,

I sumbitted another bug to separate our issues- 48132
Comment 26 Not Assigned 2012-04-10 04:13:12 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "libreoffice-3-5":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=a19a526648175e5c7091ea08293e62cc756b4d0c&g=libreoffice-3-5

fdo#45394 fix RTF import of tables with empty first row


It will be available in LibreOffice 3.5.3.
Comment 27 Not Assigned 2012-04-10 04:13:40 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "libreoffice-3-5":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=606dd9f18806ad3f659041e395eed870139699d2&g=libreoffice-3-5

fdo#45394 fix RTF import of custom fonts in substreams


It will be available in LibreOffice 3.5.3.
Comment 28 Dmitry Yakimov 2012-04-10 04:29:55 UTC
Thank you very much! Will it fix slow loading of rtf file?
Comment 29 Miklos Vajna 2012-04-13 01:56:44 UTC
Dmitry,

The fix just affects the result of the import, not the speed of it. For the speed, we have bug 44736.

Miklos
Comment 30 Jean-Baptiste Faure 2012-04-15 09:20:13 UTC
(In reply to comment #25)
> > [...]
> I sumbitted another bug to separate our issues- 48132

Thank you. I will mark your attachments as obsolete in this bug report. They are available in bug 48132 (use the word "bug" before the bug number to instruct bugzilla to create a link to the bug report).

Best regards. JBF
Comment 31 Jean-Baptiste Faure 2012-04-30 09:33:08 UTC
Verified in LO 3.5.3 rc2. Closing. Thank you.
Comment 32 Robinson Tryon (qubit) 2015-12-15 11:54:25 UTC
Migrating Whiteboard tags to Keywords: (rtf_filter -> filter:rtf)
[NinjaEdit]