Bug 114309 - FILESAVE: RTF: columns/section lost after RT
Summary: FILESAVE: RTF: columns/section lost after RT
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:7.3.0
Keywords: bibisected
Depends on:
Blocks: RTF
  Show dependency treegraph
 
Reported: 2017-12-07 12:57 UTC by Xisco Faulí
Modified: 2021-11-24 12:54 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Comparison before and after the RT (211.87 KB, image/png)
2017-12-07 12:57 UTC, Xisco Faulí
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Xisco Faulí 2017-12-07 12:57:27 UTC
Created attachment 138276 [details]
Comparison before and after the RT

Steps to reproduce:
1. Open attachment 107303 [details] from bug 84645
2. Save it as .RTF
3. Open the new file

Observed behaviour: second column is displayed right after the first column instead of next to it. see screenshot

Reproduced in

Version: 6.1.0.0.alpha0+
Build ID: 495ac1bc97f3deea8e13cb1a2b9f59d087873c3f
CPU threads: 4; OS: Linux 4.10; UI render: default; VCL: gtk3; 
Locale: en-US (ca_ES.UTF-8); Calc: group threaded

[Bug found by office-interoperability-tools]
Comment 1 Xisco Faulí 2017-12-07 12:58:51 UTC
Regression introduced by:

author	Justin Luth <justin_luth@sil.org>	2017-11-07 09:29:30 +0300
committer	Justin Luth <justin_luth@sil.org>	2017-11-09 05:40:08 +0100
commit afc96d263959d10e457b54a574f0829d20e99df4 (patch)
tree 66f0aa20534e80f2ee53412436eb2c3c450fc64a
parent 6502ebb0e977f6bea305e5e1598520a6b8b9f770 (diff)
tdf#112352 ooxmlimport: ALWAYS treat 1st nextpage w/cols as cont
fix 5.4 regression from 4605bd46984125a99b0e993b71efa6edb411699f.

When there are columns, if a nextpage section doesn't contain any
other "page style" details we treat it as a continuous break,
If we don't, the column info becomes part of the style itself,
and not just a section property.

However, the very first section is troublesome - by definition it DOES
contain page style details, and so if the document starts with columns,
the default style would gain the column attribute. Usually that
results in a mess, so lets make sure that we avoid that also in
the case where headers/footers are defined.

Bisected with: bibisect-linux64-6.0

Adding Cc: to Justin Luth
Comment 2 Xisco Faulí 2017-12-07 14:54:57 UTC
Attachment 81700 [details] from bug 66373 is also affected by the same problem.
Comment 3 Justin L 2017-12-16 14:17:22 UTC
This is not a true regression - the RTF just happened to look better starting in 5.4. The original file has a section with 2 columns in it, and a page-style with one column. The round-tripped file has no sections, but a default page style with 2 columns, which is completely incorrect even though it visually looks accurate.

bibisect43all-3.6: also round-trips as 2 columns page-style
bibisect42all-4.2: round-trips adding a section each time, and only one column.
bibisect43all-4.3: round-trips with section/2 columns (but with an extra CR on line 1, and an extra, empty section added for each round-trip.)
bibisect44max: round-trips as no sections, single column
-columns/section lost in c4a5f8c1afd42acb52d0ae9b4d6f42f3e87364d5
-the extra initial CR is fixed by 75c5679a96437caa6041d2550562f2a4db80d586

LO 4.3 was a complete mess, with this document doing all kinds of different things at various stages, and lots of "git bisect skip" failures.

In the case (like this document) where there is only one section, we might be able to get away with simulating that by defining the columns in the page style instead.  writerfilter/source/dmapper/PropertyMap.cxx:
    const bool bTreatAsContinuous = ...
        && !rDM_Impl.GetIsLastSectionGroup()
Comment 4 QA Administrators 2019-11-24 03:35:39 UTC Comment hidden (obsolete)
Comment 5 Roman Kuznetsov 2019-11-24 07:51:31 UTC
still repro in

Версия: 6.5.0.0.alpha0+ (x64)
ID сборки: 32dcf3f0fdafcf44457842a8aa4f54d30d856ca9
Потоков ЦП: 4; ОС:Windows 10.0 Build 17763; Отрисовка ИП: GL; VCL: win; 
Локаль: ru-RU (ru_RU); Язык интерфейса: ru-RU
Calc: threaded
Comment 6 QA Administrators 2021-11-24 04:31:24 UTC Comment hidden (obsolete, spam)
Comment 7 Xisco Faulí 2021-11-24 10:42:22 UTC
Issue fixed by

author	Justin Luth <justin.luth@collabora.com>	2020-12-10 16:48:06 +0300
committer	Miklos Vajna <vmiklos@collabora.com>	2020-12-15 09:28:43 +0100
commit 8787a45f9cbb5dce61b20817ef0e549b5a227a95 (patch)
tree 533944cbbcc2373e7aa0e2b00e4b468b5458dcd8
parent 2b0333d09526d85ea70ab4dfdba2c3593724c80d (diff)
tdf#118711 writerfilter: don't hardcode default page description
Comment 8 Commit Notification 2021-11-24 12:54:43 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/da4b873245b9f5a096048e2370041c6278ebaf4a

tdf#114309: sw_rtfexport: Add unittest

It will be available in 7.3.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.