Bug 142693 - Libreoffice Writer is not reading user page sizes from docx file
Summary: Libreoffice Writer is not reading user page sizes from docx file
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.4.0.3 release
Hardware: All All
: medium normal
Assignee: Attila Szűcs
URL:
Whiteboard: target:7.3.0 target:7.2.0.2
Keywords: bibisected, bisected, regression
: 143397 143740 (view as bug list)
Depends on:
Blocks: DOCX-Page
  Show dependency treegraph
 
Reported: 2021-06-07 04:29 UTC by abhay_homepage
Modified: 2022-06-23 08:58 UTC (History)
7 users (show)

See Also:
Crash report or crash signature:


Attachments
Example file from Writer (8.96 KB, application/vnd.oasis.opendocument.text)
2021-06-07 11:07 UTC, NISZ LibreOffice Team
Details
The example file saved by Writer to Docx (4.27 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2021-06-07 11:08 UTC, NISZ LibreOffice Team
Details
The docx file opened in Writer and Word (87.60 KB, image/png)
2021-06-07 11:13 UTC, NISZ LibreOffice Team
Details

Note You need to log in before you can comment on or make changes to this bug.
Description abhay_homepage 2021-06-07 04:29:37 UTC
Description:
Libreoffice Writer is used to create a .docx file with page size of A1 dimensions.
As A1 dimension is not a standard available in page styles, user page style with dimensions of 23.4 inch X 33.1 inch is applied.
This is saved into the .docx file. The same is visible even when opening the file in MS Office. 
But when the file is again opened in Libreoffice Writer, the page sizes somehow reset to 0 inch x 0 inch.
Upon setting the page size manually, the display of pages is back to as it was previously. 
Please help fixing the User page sizes not getting applied correctly for docx files.

Steps to Reproduce:
1.create a .docx file
2.change page size to user dimensions like A1 paper size (23.4inch X 33.1inch)
3.save the file and close
4.reopen the file to see that page dimensions reset to 0inch x 0inch

Actual Results:
page sizes reset to 0inch X 0inch

Expected Results:
actual page size from user sizes should get applied


Reproducible: Always


User Profile Reset: No


OpenGL enabled: Yes

Additional Info:
Seen in previous 7.X releases of Libreoffice also.
Comment 1 NISZ LibreOffice Team 2021-06-07 11:07:32 UTC
Created attachment 172674 [details]
Example file from Writer

This demonstrates A1 paper size from Writer.
Comment 2 NISZ LibreOffice Team 2021-06-07 11:08:15 UTC
Created attachment 172675 [details]
The example file saved by Writer to Docx
Comment 3 NISZ LibreOffice Team 2021-06-07 11:13:31 UTC
Created attachment 172676 [details]
The docx file opened in Writer and Word

Seems like the reopening is incorrect, the custom paper size becomes 4.1 x 4.1 cm in Writer and nothing is visible of the paper.
Word 2019 seems to import it correctly as 59.39 x 84.4 cm (minus a 0.01 cm rounding error) and the example sentence is readable correctly. 
Even resaving in Word works, despite its UI having a 55.87 x 55.87 cm limit on custom paper size - but it handles correctly the sizes greater than that, apparently.


Version: 7.2.0.0.alpha1+ (x64) / LibreOffice Community
Build ID: 3b57ebb445df8a2bc3d916ea79f8af45e20e4e62
CPU threads: 4; OS: Windows 10.0 Build 18363; UI render: default; VCL: win
Locale: hu-HU (hu_HU); UI: en-US
Calc: CL
Comment 4 abhay_homepage 2021-06-15 06:43:48 UTC Comment hidden (no-value)
Comment 5 Gabor Kelemen (allotropia) 2021-07-17 10:15:15 UTC
*** Bug 143397 has been marked as a duplicate of this bug. ***
Comment 6 Commit Notification 2021-07-26 15:06:49 UTC
Attila Szűcs committed a patch related to this issue.
It has been pushed to "master":

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

tdf#142693 DOCX import: fix zeroing huge page sizes

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.
Comment 7 László Németh 2021-07-26 15:09:16 UTC
It seems, this is a regression from commit 4d1621136c464b462a598571ecdcfe2ae119d8c7
"Fix ignoring large twips values like MSO does (cp#1000087)".
Comment 8 Commit Notification 2021-07-27 08:33:22 UTC
Attila Szűcs committed a patch related to this issue.
It has been pushed to "libreoffice-7-2":

https://git.libreoffice.org/core/commit/446771fe3e91eb7d154e86b9c6a614374110e9ca

tdf#142693 DOCX import: fix zeroing huge page sizes

It will be available in 7.2.0.2.

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.
Comment 9 Timur 2021-07-27 08:48:55 UTC
Yes. That regression is from 44max.
Comment 10 BogdanB 2021-07-30 17:51:12 UTC
Working well in
Version: 7.3.0.0.alpha0+ / LibreOffice Community
Build ID: 5aa74aa1e6fac571f99146ebcb6adc9feb1459ad
CPU threads: 4; OS: Linux 5.8; UI render: default; VCL: gtk3
Locale: ro-RO (ro_RO.UTF-8); UI: en-US
TinderBox: Linux-rpm_deb-x86_64@86-TDF, Branch:master, Time: 2021-07-28_19:35:14
Calc: threaded
Comment 11 NISZ LibreOffice Team 2021-08-05 14:35:55 UTC
*** Bug 143740 has been marked as a duplicate of this bug. ***