Bug 44292 - FILEOPEN particular docx shows wrong number of columns
Summary: FILEOPEN particular docx shows wrong number of columns
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
3.5.0 RC1
Hardware: All All
: medium normal
Assignee: Noel Power
URL:
Whiteboard: target:3.6.0 target:3.5.4
Keywords: regression
: 44381 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-12-29 13:40 UTC by Cor Nouws
Modified: 2012-06-27 06:21 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
.docx file that crashes some Win versions .. and shows too much columns in others (1.23 MB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2011-12-29 13:40 UTC, Cor Nouws
Details
.odt version of the document - for reference/testing (1.21 MB, application/3dr)
2011-12-29 13:42 UTC, Cor Nouws
Details
doc with 2 columns, showing 4 in Libo (1.23 MB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2012-01-22 03:14 UTC, Luc
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Cor Nouws 2011-12-29 13:40:31 UTC
Created attachment 54957 [details]
.docx file that crashes some Win versions .. and shows too much columns in others

Attached a docx that has landscape page with two colums originally.

Opens with 4 columns in 350beta2 on Linux 32.
Opens Landscape in 350beta 2 on Win7 32 bits (virtualBox)
Others report that it crashes in 350beta on Windows (maybe 64 bits?)

For reference, also attached an .odt version of the document.

It opens fine on Ubuntu in 3.3.x and 3.4.x without crashing, however with the page orientation wrong (portrait in stead of landscape).
It crashes 3.4.2 on my Windows VM.
Comment 1 Cor Nouws 2011-12-29 13:42:38 UTC
Created attachment 54958 [details]
.odt version of the document - for reference/testing
Comment 2 Rainer Bielefeld Retired 2012-01-02 02:49:26 UTC
I reduced to 1 problem
<http://wiki.documentfoundation.org/BugReport#General_information>

A"Number of columns" problem is [Reproducible] with Parallel Dev-Installation of  "LibreOffice 3.5.0 Beta2- WIN7 Home Premium (64bit) English UI [Build-ID : 8589e48-760cc4d-f39cf3d-1b2857e-60db978]. Opening the sample document with MS WORD Viewer I see 2 columns. Opened with Beta2 and also 3.4.5 document show only 1 column.

Worked fine  with "LibreOffice Portable 3.3.3  - WIN7  Home Premium (64bit) German UI [OOO330m19 (Build:301  Tag 3.3.3.1)]", 2 columns shown with that version.

I will have to check for DUPs, currently Bugzilla is grunding :-(

@Cor
For other problems (Page orientation) please open separate Bugs with reference to sample documents here.

For the crash problem I submited "44381 - FILEOPEN particular .docx causes CRASH"
Comment 3 Luc 2012-01-22 03:14:19 UTC
Created attachment 55946 [details]
doc with 2 columns, showing 4 in Libo

doc with 2 columns, showing 4 in Libo 3.5rc1; or crashes libo in early versions (for sure in 3.3.4)
Comment 4 Rainer Bielefeld Retired 2012-01-22 09:24:11 UTC
More or less [Reproducible] with "Sample 2012-01-22 11:14" and  "LibreOffice 3.5.0 RC1 German UI/Locale [Build-ID: b6c8ba5-8c0b455-0b5e650-d7f0dd3-b100c87] on German WIN7 Home Premium (64bit), only 1 column!

All versions before 3.4 and 3.5 before 3.5.0Beta2 seem to crash with that document.

Ok with 3.3:
"Sample 2012-01-22 11:14" shows 2 Columns in  "LibreOffice Portable 3.3.0  - WIN7  Home Premium (64bit) German UI [OOO330m19 (Build:6) tag libreoffice-3.3.0.4]". Same with MS WORD VIEWER.

@Luc:
<http://wiki.documentfoundation.org/BugReport_Details#Version>

@Cédric:
Please feel free to reassign (or reset Assignee to default) if it’s not your area or if provided information is not sufficient. Please set Status to ASSIGNED if you accept this Bug.
Comment 5 Caolán McNamara 2012-05-06 12:44:34 UTC
caolanm->noelp: this is triggered by

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

If I revert that we get back to two columns instead of four.

Problem is that sections are hosted inside page styles in writer. While in word there is basically "just sections". In writer if a page style is set to two columns then sections which have two columns gives an output of four columns and here we've ended up with a page-style that has two columns and a section with two columns.

Problem is most obvious in that a page style which has two columns can't have a section inside it which has the result of one column which fills the entire page.

I don't know what the problem of bnc#693238 was, but FWIW maybe wwSectionManager::InsertSegments in the ww8 filter might be useful for re-use here ? Otherwise some machinery to set page style columns to 1 if any sections with > 1 column are hosted in it, filling in with whatever fake sections are necessary to make it work out ok
Comment 6 Caolán McNamara 2012-05-06 12:48:52 UTC
*** Bug 44381 has been marked as a duplicate of this bug. ***
Comment 7 Noel Power 2012-05-10 07:43:37 UTC
(In reply to comment #5)
> caolanm->noelp: this is triggered by
> 
> http://cgit.freedesktop.org/libreoffice/core/commit/?id=cd1c434c4bd4756fa1355e906cb2e8de4aae0618
> 
> If I revert that we get back to two columns instead of four.
> 
> Problem is that sections are hosted inside page styles in writer. While in word
> there is basically "just sections". In writer if a page style is set to two
> columns then sections which have two columns gives an output of four columns
> and here we've ended up with a page-style that has two columns and a section
> with two columns.
> 
> Problem is most obvious in that a page style which has two columns can't have a
> section inside it which has the result of one column which fills the entire
> page.
> 
> I don't know what the problem of bnc#693238 was, but FWIW maybe
> wwSectionManager::InsertSegments in the ww8 filter might be useful for re-use
> here ? Otherwise some machinery to set page style columns to 1 if any sections
> with > 1 column are hosted in it, filling in with whatever fake sections are
> necessary to make it work out ok

Sorry about the delay responding, you set the owner to the *other* username I first set up that has the email address I read infrequently ( probably I should delete it or something )
iirc it was something to do with page margins that weren't being applied, I don't really remember. Whatever it was I obviously didn't understand fully the implications of the change.
I guess you want to revert that right ? ( I suppose we should do that at least on the 3.5 branch ) 
I suppose your explanations about pagestyles and sections make sense ( at least to someone who has a clue ;-) unfortunately I don't )
I hope I can try and understand what to do to fix this properly :-)
Comment 8 Caolán McNamara 2012-05-10 12:37:03 UTC
yeah, probably best to revert it in the short term anyway. sections/page styles is a general problem with mapping word stuff to writer stuff. Word effectively just has "sections" and we've got pages that can have sections inside them and the mapping is necessarily tricky
Comment 9 Not Assigned 2012-05-11 02:03:15 UTC
Noel Power committed a patch related to this issue.
It has been pushed to "master":

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

Revert "another partial fix for bnc#693238" ( and fixes fdo#44292 )
Comment 10 Not Assigned 2012-05-11 08:37:34 UTC
Noel Power committed a patch related to this issue.
It has been pushed to "libreoffice-3-5":

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

Revert "another partial fix for bnc#693238" ( and fixes fdo#44292 )


It will be available in LibreOffice 3.5.4.
Comment 11 Noel Power 2012-06-27 04:25:24 UTC
miklos feel free to reassign this, I am victimising you because I seem to recall that you have messed about with page styles and I cocked up with my attempt to fix this ( and lets face it, I don't know much about writer )