Bug 117229 - FILESAVE XLSX Page header+footer margins overwritten with values in wrong units
Summary: FILESAVE XLSX Page header+footer margins overwritten with values in wrong units
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
5.4.5.1 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: filter:xlsx
Depends on:
Blocks: XLSX-Header-Footer
  Show dependency treegraph
 
Reported: 2018-04-25 11:33 UTC by Gabor Kelemen (allotropia)
Modified: 2024-09-18 19:35 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
Simple xlsx with default margins (16.83 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2018-04-25 11:33 UTC, Gabor Kelemen (allotropia)
Details
The same file saved by LO 5.4 (6.74 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2018-04-25 11:35 UTC, Gabor Kelemen (allotropia)
Details
Page margin settings in Excel 2013 - original file (12.21 KB, image/png)
2018-04-25 11:35 UTC, Gabor Kelemen (allotropia)
Details
Page margin settings in Excel 2013 - LO-exported file (12.08 KB, image/png)
2018-04-25 11:36 UTC, Gabor Kelemen (allotropia)
Details
header margin doesn't look the same with Calc or Excel (10.58 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2024-09-18 19:21 UTC, Jérôme
Details
header margin when printed with Excel 2021 into pdf with PdfCreator (5.68 KB, application/pdf)
2024-09-18 19:25 UTC, Jérôme
Details
header margin when printed with LO 7.3.7.2 into pdf with PdfCreator (23.66 KB, application/pdf)
2024-09-18 19:27 UTC, Jérôme
Details
header margin when exported as pdf with LO 24.2.6.2 (into snap) (9.29 KB, application/pdf)
2024-09-18 19:30 UTC, Jérôme
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gabor Kelemen (allotropia) 2018-04-25 11:33:34 UTC
Created attachment 141625 [details]
Simple xlsx with default margins

Attached simple XLSX contains by default the following margin settings in xl/worksheets/sheet1.xml:

<pageMargins left="0.7" right="0.7" top="0.75" bottom="0.75" header="0.3" footer="0.3"/>

This results in 1,91 cm top/bottom margins, 1,78 cm left/right margins and 0,76 cm header/footer margins in Excel – so the above values are in inches.

Without any changes to header/footer settings, or enabling them in the Page dialog, this is converted into:

<pageMargins left="0.7" right="0.7" top="0.75" bottom="0.75" header="0.511805555555555" footer="0.511805555555555"/>

These header-footer values roughly match the default 0,5 cm default in the Page window.

Opening this file in Excel causes the header-footer to become 1,3 cm - or ~0,51 inches.

The header and footer values should remain unchanged by a simple resave, and custom values should be converted to inches before saving.
Comment 1 Gabor Kelemen (allotropia) 2018-04-25 11:35:08 UTC
Created attachment 141626 [details]
The same file saved by LO 5.4
Comment 2 Gabor Kelemen (allotropia) 2018-04-25 11:35:44 UTC
Created attachment 141627 [details]
Page margin settings in Excel 2013 - original file
Comment 3 Gabor Kelemen (allotropia) 2018-04-25 11:36:16 UTC
Created attachment 141628 [details]
Page margin settings in Excel 2013 - LO-exported file
Comment 4 Buovjaga 2018-05-17 10:29:54 UTC
Repro.

Win 8.1 32-bit
MSO 2013
LibO Version: 6.1.0.0.alpha1+
Build ID: 23c5125148a8110d88385b29570bf0b7d4400458
CPU threads: 4; OS: Windows 6.3; UI render: default; 
TinderBox: Win-x86@42, Branch:master, Time: 2018-05-12_00:15:25
Locale: fi-FI (fi_FI); Calc: group
Comment 5 QA Administrators 2019-11-07 03:34:52 UTC Comment hidden (obsolete)
Comment 6 manfred.benesch 2020-09-13 10:11:55 UTC
This bug is still present in 

Version: 7.0.1.2
Build ID: 7cbcfc562f6eb6708b5ff7d7397325de9e764452
CPU threads: 8; OS: Linux 5.8; UI render: default; VCL: kf5
Locale: de-DE (de_DE.UTF-8); UI: en-US
Calc: threaded
Comment 7 Regina Henschel 2020-09-13 13:47:00 UTC
I don't think, that it is a problem with units. The values are correct in case header/footer have content. In that case it is:
LO top margin + LO header height + LO header spacing = Excel top margin
and
Excel header position = LO top margin

For example, an Excel setting with top margin 20mm and header position 6mm is divided in LO into top margin 6mm + header height 3,88mm + header spacing 10,12mm.
Because in LO the header is not inside the margin, but belongs to the body area, the Excel header position 6mm becomes the top margin in LO. And to get the total of Excel margin a suitable spacing is used.

These rules are not used, if header/footer are empty.
Comment 8 QA Administrators 2022-09-14 03:38:03 UTC Comment hidden (obsolete)
Comment 9 Jérôme 2024-09-18 19:21:54 UTC
Created attachment 196527 [details]
header margin doesn't look the same with Calc or Excel

I have a similar issue with the attached file that I saved with Microsoft Office LTSC Professionnel Plus 2021.
Comment 10 Jérôme 2024-09-18 19:25:20 UTC
Created attachment 196528 [details]
header margin when printed with Excel 2021 into pdf with PdfCreator

Excel version : LTSC Professionnel Plus 2021
OS: x86-64 Windows 10
Comment 11 Jérôme 2024-09-18 19:27:19 UTC
Created attachment 196529 [details]
header margin when printed with LO 7.3.7.2 into pdf with PdfCreator

Libreoffice version : 7.3.7.2 x86-64
OS : Windows 10 x86-64
Comment 12 Jérôme 2024-09-18 19:30:32 UTC
Created attachment 196530 [details]
header margin when exported as pdf with LO 24.2.6.2 (into snap)

Version: 24.2.6.2 (X86_64) / LibreOffice Community
Build ID: 8e9a753d9daaea75c34b417ba1bdf556bf2fc5b3
CPU threads: 4; OS: Linux 6.1; UI render: default; VCL: gtk3
Locale: fr-FR (fr_FR.UTF-8); UI: fr-FR
Calc: threaded

OS : GNU/Linux (Debian 12)