Bug 142854 - Headless converting gridless XLSX to XLSX or ODS opens with grid
Summary: Headless converting gridless XLSX to XLSX or ODS opens with grid
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: filters and storage (show other bugs)
Version:
(earliest affected)
7.2.0.0.alpha0+
Hardware: All All
: medium normal
Assignee: Attila Szűcs
URL:
Whiteboard: target:7.3.0 target:7.2.0.2
Keywords: bibisected, bisected, needsUXEval
Depends on:
Blocks: Commandline
  Show dependency treegraph
 
Reported: 2021-06-14 14:34 UTC by Timur
Modified: 2021-08-10 09:29 UTC (History)
3 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 Timur 2021-06-14 14:34:19 UTC
Headless converting XLSX to XLSX or ODS doesn't take hide grid checkbox.
instdir/program/soffice  --headless  --convert-to ods  --outdir /LibreOffice_Bug/  /LibreOffice_Bug/136148\ test.xlsx   && instdir/program/soffice  /LibreOffice_Bug/136148\ test.ods

Saving to XLSX NOK with 43all oldest, seems inherited. 

Saving to ODS started being NOK in 7.2, bibisect Linux:
commit 49988506cadf6bda01b000ff2255636d069cd67a
Date:   Wed May 26 21:41:09 2021 +0200
    source 759103fd65f82fc131679eba0de05f2ddc7294c8
    previous b5af95a4d5c59094aa9fbdf35e49962f605f8dee
author	Attila Szűcs <szucs.attila3@nisz.hu>	2021-05-25 
committer	László Németh <nemeth@numbertext.org>	2021-05-26
tdf#126541 XLSX import: fix View grid lines

So far I add Attila for check for ODT and possibly XLSX. Please check and comment.
Comment 1 Attila Szűcs 2021-07-06 17:43:54 UTC
Timur: Thx for the catch.
Looks like the main problem come from Bug 136148.
The problem seems to be that at this console converting mode not all data is loaded/created.
ScViewDataTable stores the visibility of its sheet (bShowGrid) that is exported / imported... but in this mode it is not exist..

Before the fix of Bug 126541, the mentioned test case worked only by coincidence.
The test would fail if the document would have 2 sheet with different grid line visibility.

there is 2 kind of grid visibility setting in LO:
1: you can set grid visibility separatelly for every sheet.
   View -> view Grid Lines
   MS excel have these settings as well.
   so if you have 10 sheet in the document, then you will have 10 bShowGrid value

2: you can set grid visibility for calc (or for the document)
   Tools -> Options -> LibreOfficeDev Calc -> View -> Grid Lines
   here you can set a global: Show / Hide / Show on colored cells
   MS excel does NOT have such setting!
   so it can't be exported to xls/xlsx...
   It is rather confusing .. it seems like non-document-related global setting... but still it is exported/imported from ods files also.. 

Before the fix of Bug 126541, at xlsx import time, every sheet grid visibility was loaded well, but then the current sheet visibility was written to the global visibility as well... im not sure about the export yet.. but probably it is written back too.

I tied to find an other place where this bShowGrid/sheet is stored.. but i didnt find yet... maybe this is the only place it is stored... so will try to make a copy of it at a place that exist even at console mode.
Comment 2 Commit Notification 2021-07-21 09:36:23 UTC
Attila Szűcs committed a patch related to this issue.
It has been pushed to "master":

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

tdf#142854 XLSX import: fix grid visibility in headless mode

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 3 Commit Notification 2021-07-21 21:52:15 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/c3dd27d24dec0c581ed731acf8ff3504a4068b03

tdf#142854 XLSX import: fix grid visibility in headless mode

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 4 Attila Szűcs 2021-07-27 10:58:00 UTC
i choosed only to avoid the regression, by reverting the fix of Bug 126541 when we are at headless mode, and keep that fix when we are not in headless mode.

there is a bit contradiction about headless mode, view settings, and sheet based grid visibility
as far as i know, headless mode means not to save view settings, and sheet based grid visibility is stored/saved as a view setting, but still we want to save it at headless mode...

So it is a design question what to do:
-should we move the sheet based grid visibility out from view setting, so it can be saved in headless mode.
-should we stop saving grid visibility at headless mode
-or leave this mixed hacky save mode witch will cause a bug at headless mode.. that change grid visibility if the document have more sheet with different grid visibility setting.
Comment 5 NISZ LibreOffice Team 2021-08-09 09:50:30 UTC
Verified in:
Version: 7.3.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: d1f1f546b212ecd651146addeb328806bb270d5f
CPU threads: 4; OS: Windows 10.0 Build 17134; UI render: Skia/Raster; VCL: win
Locale: hu-HU (hu_HU); UI: hu-HU
Calc: threaded
Comment 6 Timur 2021-08-09 09:53:51 UTC
Although this bug is Fixed, it still needs UXeval for comment 4.
Comment 7 Heiko Tietze 2021-08-10 09:29:19 UTC
(In reply to Attila Szűcs from comment #4)
> So it is a design question what to do:
> -should we move the sheet based grid visibility out from view setting, so it
> can be saved in headless mode.
> -should we stop saving grid visibility at headless mode
> -or leave this mixed hacky save mode witch will cause a bug at headless
> mode.. that change grid visibility if the document have more sheet with
> different grid visibility setting.

Wouldn't expect any setting made in the UI being effective when converting from one format to another in headless mode. If the grid is hidden in the source it should also be in the target. Is there any catch?