Bug 106692 - FILEOPEN: RTF: Incorrect paragraph break at the beginning of the document
Summary: FILEOPEN: RTF: Incorrect paragraph break at the beginning of the document
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
5.4.0.0.alpha0+
Hardware: All All
: medium normal
Assignee: Michael Stahl
QA Contact:
URL:
Whiteboard: target:5.4.0 target:5.3.3
Keywords: bibisected, bisected, filter:rtf, regression
Depends on:
Blocks:
 
Reported: 2017-03-22 11:16 UTC by Xisco Faulí
Modified: 2017-04-10 14:26 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 Xisco Faulí 2017-03-22 11:16:44 UTC
Steps to reproduce:
1. Open attachment 93817 [details] from bug 74817

Expected behaviour: TOC should be in the first page
Observed behaviour: TOC is at the end of second page

Reproduced in

Version: 5.4.0.0.alpha0+
Build ID: 4ba483beccc99d336d0e0bec47b5fd6823b16c16
CPU threads: 4; OS: Linux 4.8; UI render: default; VCL: gtk3; 
Locale: ca-ES (ca_ES.UTF-8); Calc: group
Comment 1 Xisco Faulí 2017-03-22 11:17:56 UTC
Regression introduced by ( bisected with bibisect-linux-64-5.4 ):

author	Michael Stahl <mstahl@redhat.com>	2017-02-23 14:33:55 (GMT)
committer	Michael Stahl <mstahl@redhat.com>	2017-02-23 15:42:38 (GMT)
commit	10e733908038407791f9c14af2a86417cc4a653c (patch)
tree	62c3c794739912b642b5adfbdbed2be00176a4ec
parent	78e25558e86188314b9b72048b8ddca18697cb86 (diff)
writerfilter: RTF import: hex-escaped \r and \n create paragraph break
... in Word 2010, while the spec doesn't say what they do.
So just handle \'0d and \'0a like \par.

This fixes an assert failure on importing lp556169-2.rtf, where
insertTextPortion was called with a string containing "\r", which split
the paragraph and that messed up the SwPaM.

Adding Cc: to Michael Stahl
Comment 2 Commit Notification 2017-04-07 20:58:27 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "master":

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

tdf#106692 writerfilter: RTF import: fix \'0d in \leveltext

It will be available in 5.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 3 Michael Stahl 2017-04-07 20:59:34 UTC
fixed on master
Comment 4 Commit Notification 2017-04-10 14:26:06 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "libreoffice-5-3":

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

tdf#106692 writerfilter: RTF import: fix \'0d in \leveltext

It will be available in 5.3.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.