Bug 52389 - FILEOPEN: Last character deleted in some RTF files
Summary: FILEOPEN: Last character deleted in some RTF files
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
3.5.5.3 release
Hardware: All All
: medium minor
Assignee: Miklos Vajna
URL:
Whiteboard: target:3.7.0 target:3.6.3
Keywords: filter:rtf, regression
Depends on:
Blocks:
 
Reported: 2012-07-23 11:33 UTC by wojciech
Modified: 2015-12-17 12:07 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
RTF created in Windows (MSWORD); the last character should be an exclamation mark. (15.78 KB, application/rtf)
2012-09-12 08:37 UTC, wojciech
Details

Note You need to log in before you can comment on or make changes to this bug.
Description wojciech 2012-07-23 11:33:53 UTC
In version 3.5.5.3 (and older 3.5 versions) upon opening an RTF document the last character of the document "disappears".
Comment 1 Ronildo Matsuura 2012-08-07 13:09:34 UTC
I am having the same problem! I'm tested v3.5.4, v.3.5.5 and v3.6.0.4rc
Comment 2 Roman Eisele 2012-08-23 11:41:19 UTC
@wojciech,
@Ronildo Matsuura:

Thank you very much for your bug report! However, I have some problems to reproduce it; obviously not every RTF document is truncated when opening it with LibreOffice.

Therefore: could you please attach a sample RTF document (regardless of its contents) which, whenever you open it with LibreOffice, shows the problem, i.e. that the last character "disappears"?

This would be very very helpful to fix the problem.
Thank you very much!


(Hint: To "attach" a sample RTF document, just come back to this page:
  https://bugs.freedesktop.org/show_bug.cgi?id=52389
and click on "Add an attachment", then select your RTF file.)
Comment 3 Roman Eisele 2012-09-03 13:56:29 UTC
@wojciech,
@Ronildo Matsuura:

Thank you very much for your bug report! However, I have some problems to
reproduce it; obviously not every RTF document is truncated when opening it
with LibreOffice.

Therefore: could you please attach a sample RTF document (regardless of its
contents) which, whenever you open it with LibreOffice, shows the problem, i.e.
that the last character "disappears"?

This would be very very helpful to fix the problem.
Thank you very much!

(Repeated because I forgot to add Ronildo Matsuura's e-mail address the last time.)
Comment 4 wojciech 2012-09-12 08:37:44 UTC
Created attachment 67026 [details]
RTF created in Windows (MSWORD); the last character should be an exclamation mark.
Comment 5 Roman Eisele 2012-09-12 13:22:46 UTC
Thank you very much for the sample file! Now I can confirm reproduce the issue ...


REPRODUCIBLE with
* LibreOffice 3.5.6.2 (Build-ID: e0fbe70-dcba98b-297ab39-994e618-0f858f0);
* LibreOffice 3.6.1.2 (Build ID: e29a214),
  both with German langpack installed;
* LOdev 3.7.0.0.alpha0+, Build ID: 2df0884, Pull time: 2012-09-11 01:28:39,
  US English langpack installed,
all on Mac OS X 10.6.8 (Intel).

In all these versions, the last words of the sample file read “Zapraszamy do oglądania”, without final interpunctation.

But even simple RTF readers (like Apple’s TextEdit) show that there is a ‘!’ at the end of the last sentence, so that the last words should read “Zapraszamy do oglądania!” The same result is shown by older LibreOffice versions:
* LibreOffice 3.3.0
* LibreOffice 3.4.0
* LibreOffice 3.4.6
on the same machine all correctly import the final ‘!’; therefore added keyword “regression”.
Comment 6 Roman Eisele 2012-09-12 13:26:24 UTC
@ Miklós Vanja:

Hello Miklós,
this is a very simple bug in the new RTF filter -- the last character is missing from some RTF files when we open them with LibreOffice >= 3.5. I hope it should be rather simple to fix this issue. Please take a look at it.

Thank you very much!
Comment 7 Miklos Vajna 2012-09-21 09:15:10 UTC
Reproduced, will have a look.

Roman: you never know how hard a fix is till you have it. :-)
Comment 8 Not Assigned 2012-09-21 10:11:57 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "master":

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

fdo#52389 fix RTF import of paragraph without RTF_PAR at the end of the doc



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 Miklos Vajna 2012-09-21 10:16:13 UTC
Resolved in master, -3-6 review request: https://gerrit.libreoffice.org/663
Comment 10 Not Assigned 2012-09-21 12:13:11 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=363029af2207dc890939e31850aba82263c97ec6&g=libreoffice-3-6

fdo#52389 fix RTF import of paragraph without RTF_PAR at the end of the doc


It will be available in LibreOffice 3.6.3.

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 11 Roman Eisele 2012-09-21 12:54:08 UTC
@ Miklós:

Thank you very much for taking this bug and for fixing it so quickly!

(In reply to comment #7)
> Roman: you never know how hard a fix is till you have it. :-)

How true! Of course, I only wrote: “I _hope_ it should be rather simple to fix this issue.” ;-)
Comment 12 Roman Eisele 2012-09-21 12:55:05 UTC
Assigned ex post to Miklós Vanja -- honour to whom honour belongs.
Comment 13 Robinson Tryon (qubit) 2015-12-17 12:07:42 UTC
Migrating Whiteboard tags to Keywords: (filter:rtf)
Replace rtf_filter -> filter:rtf.
[NinjaEdit]