Bug 34717 - FILEOPEN: automatic row height is too small in generated .xls (not if resaved in MSO)
Summary: FILEOPEN: automatic row height is too small in generated .xls (not if resaved...
Status: RESOLVED NOTOURBUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: low minor
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
: 63074 (view as bug list)
Depends on:
Blocks: Calc-Cells MSO-External-Producers
  Show dependency treegraph
 
Reported: 2011-02-25 06:12 UTC by Aurimas Fišeras
Modified: 2022-09-15 08:25 UTC (History)
14 users (show)

See Also:
Crash report or crash signature:


Attachments
Sample document (5.00 KB, application/vnd.ms-excel)
2011-02-25 06:12 UTC, Aurimas Fišeras
Details
Comparison between OO and LibO (14.70 KB, image/png)
2011-02-25 06:13 UTC, Aurimas Fišeras
Details
video of the bug (3.84 MB, video/mp4)
2020-05-16 06:27 UTC, BogdanB
Details
Different views of the solutions (19.39 KB, image/png)
2022-06-28 08:02 UTC, Andreas Heinisch
Details
Comparison between MSO and LO for original and MSO resaved XLS and XLSX (26.76 KB, image/webp)
2022-09-15 08:25 UTC, Timur
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Aurimas Fišeras 2011-02-25 06:12:55 UTC
Created attachment 43799 [details]
Sample document

Excel 97 files generated by "1C:Enterprise 8.1 platform" are opened with incorrect row height in LibO 3.3.1 (and Go-oo) on Linux, Windows. OO 3.2.1/3.3, Excel 2007 opens them correctly.
Comment 1 Aurimas Fišeras 2011-02-25 06:13:50 UTC
Created attachment 43800 [details]
Comparison between OO and LibO
Comment 2 Don't use this account, use tml@iki.fi 2011-03-08 01:53:07 UTC Comment hidden (obsolete)
Comment 3 Don't use this account, use tml@iki.fi 2011-03-08 01:53:58 UTC Comment hidden (obsolete)
Comment 4 Aurimas Fišeras 2011-03-08 02:02:16 UTC
(In reply to comment #2)
> Just out of interest, what is 1C:Enterprise ?

http://www.1centerprise.com/

(In reply to comment #3)
> I don't think this is a regression if OOo 3.2.1 behaved the same?

It is a regression. All OOo versions behave correctly as stated in the original bug description.
Comment 5 Don't use this account, use tml@iki.fi 2011-03-08 02:17:01 UTC
OK, I misread the initial comment, I mized up a period and comma...
Comment 6 Aurimas Fišeras 2011-03-08 02:31:54 UTC
One more thing: incorrect row height is set only for rows with automatic row height.
If I set fixed row heights for some rows in "1C:Enterprise 8.1", then these rows are opened correctly, and all rows with automatic height not.
Comment 7 Michael Kazarian 2011-03-29 22:38:25 UTC
(In reply to comment #2)
> Just out of interest, what is 1C:Enterprise ?

1C is "de facto" (like Windows) standart in economic software in former USSR with rapacious pricing and with bad (and high cost) architecture solutions.
Comment 8 Björn Michaelsen 2011-12-23 11:43:48 UTC Comment hidden (obsolete)
Comment 9 Aurimas Fišeras 2011-12-24 01:18:04 UTC Comment hidden (obsolete)
Comment 10 Aurimas Fišeras 2012-08-14 07:59:37 UTC
Still a problem in LibO 3.6.0

Same document works fine in AOO 3.4.0
Comment 11 Rainer Bielefeld Retired 2012-08-28 04:31:48 UTC
[Reproducible] with "LibreOffice 3.6.1.2  German UI/Locale [Build-ID:  e29a214] on German WIN7 Home Premium (64bit), already visible with 3.3.0., ok with AOOo 3.4

As in Bug 50044, every formatting in any cell of the row heals the problem for that row.

Might be related to:
"Bug 34552 - EDITING: Calc loses row height value when modifying a cell", the action what there destroys row hight here heals a problem"
"Bug 39486 - FILEOPEN; Incorrect row height when opening some .xls files." 
and others
"Bug 50044 - FILEOPEN partiular .xls shows too small row height"
Comment 12 Rainer Bielefeld Retired 2012-08-28 04:40:23 UTC
*** Bug 34552 has been marked as a duplicate of this bug. ***
Comment 13 Rainer Bielefeld Retired 2012-08-28 04:41:37 UTC
*** Bug 50044 has been marked as a duplicate of this bug. ***
Comment 14 Rainer Bielefeld Retired 2012-08-28 04:45:39 UTC
*** Bug 39486 has been marked as a duplicate of this bug. ***
Comment 15 Rainer Bielefeld Retired 2012-08-28 04:47:21 UTC
@Spreadsheet Team:
Please set Status to ASSIGNED and add yourself to "Assigned To" if you accept this Bug or forward the Bug if it's not your turf (and remove others in team from CC).
Comment 16 ign_christian 2013-07-11 06:16:30 UTC
*** Bug 63074 has been marked as a duplicate of this bug. ***
Comment 17 Nicola Ruggero 2013-07-11 06:23:15 UTC Comment hidden (noise)
Comment 18 Vladimir 2013-12-17 12:06:07 UTC Comment hidden (obsolete)
Comment 19 Vladimir 2014-02-12 08:29:58 UTC
4.2.0.4 - w/o changes
Comment 20 Joel Madero 2015-05-02 15:41:37 UTC Comment hidden (obsolete)
Comment 21 Aurimas Fišeras 2015-05-02 16:17:23 UTC Comment hidden (obsolete)
Comment 22 Nicola Ruggero 2016-02-27 08:15:48 UTC
Same issue also in LO: 5.0.5.2-2.fc23
Comment 23 QA Administrators 2017-03-06 15:10:58 UTC Comment hidden (obsolete)
Comment 24 Aurimas Fišeras 2017-03-06 16:44:03 UTC Comment hidden (obsolete)
Comment 25 Apache POI Dev 2017-07-20 15:54:25 UTC
Im a Java developer and working with Apache POI to generate xls and xlsx documents. When the row height is set to -1, you get exactly the undefined/default row height behaviour.
https://poi.apache.org/apidocs/org/apache/poi/ss/usermodel/Row.html#setHeight(short)

In every MS Office Version, you have the behaviour wenn row height is set to -1 to autosize the row height.

The bug is currently stil in the latest libreoffice version I am running.

Version: 5.3.4.2
Build-ID: f82d347ccc0be322489bf7da61d7e4ad13fe2ff3
CPU-Threads: 4; BS-Version: Windows 6.2; UI-Render: Standard; Layout-Engine: neu; 
Gebietsschema: de-DE (de_DE); Calc: group
Comment 26 QA Administrators 2018-07-21 02:40:13 UTC Comment hidden (obsolete)
Comment 27 Aurimas Fišeras 2018-07-21 04:19:33 UTC
The bug is present in:
Versija: 6.2.0.0.alpha0+
Darinio identifikatorius: 6af1637d0cf85566ca8482cc284669c4968ae977
Procesoriaus gijos: 4; OS:Linux 4.17; Sąsajos pateikimas: numatytasis; VCL: gtk3; 
Lokalė: lt-LT (lt_LT.UTF-8); Calc: group threaded

And in:
Versija: 6.0.5.2 (x64)
Darinio identifikatorius: 54c8cbb85f300ac59db32fe8a675ff7683cd5a16
Procesoriaus gijos: 8; OS:Windows 10.0; Sąsajos pateikimas: numatytasis; 
Lokalė: lt-LT (lt_LT); Calc:
Comment 28 Bartosz 2019-07-03 22:43:20 UTC
To workaround it you need to enable "Optimal Height" on rows with Wrapping enabled.
Comment 29 BogdanB 2020-05-16 06:27:10 UTC
Created attachment 160885 [details]
video of the bug

It's annoying when you need to open a file every day.
The single solution is to set a default line high size.

See the video

Version: 7.0.0.0.alpha1+
Build ID: b1e396d86655a0131498a4691dd8069ea76c3477
CPU threads: 4; OS: Linux 5.4; 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: 2020-05-15_04:58:38
Calc: threaded
Comment 30 Andreas Heinisch 2022-06-28 08:02:38 UTC
Created attachment 180989 [details]
Different views of the solutions

I investigated the issue, and I have no clear idea how to solve this problem:

The row height will be read in ImportExcel::Defrowheight345() which reads a default row height of 160. This value will be set in XclImpColRowSettings::SetDefHeight, and used for the height of the different rows, as seen in the first image.

If the current nStdRowHeight of a row is 256 applied, the result is as seen in the second column.

At the end of the import in ErrCode ImportExcel8::Read(), even a code was removed in order to avoid the automatic adaptation of the row height:

#if 0
        // Excel documents look much better without this call; better in the
        // sense that the row heights are identical to the original heights in
        // Excel.
        if ( !rD.IsAdjustHeightLocked())
            AdjustRowHeight();
#endif

https://github.com/LibreOffice/core/commit/1363fe2fa6849aa1ac678ea444c58a82d417eb47

If we reactivate the last call, it could lead to long loading times of big documents.
Comment 32 Andreas Heinisch 2022-06-28 08:38:05 UTC
We could check if the content is to small for that cell and at least adjust the height of the row, but still I am not convinced about such a solution.

Opinions?
Comment 33 Justin L 2022-09-14 17:52:16 UTC
This document only sets default height (160) when the normal height (for 10pt font) is 255. So that explains the small row height.

None of the rows are flagged as having content. They are all NOT ExcColRowFlags::Used, and therefore the row just gets mnDefHeight.
Comment 34 Timur 2022-09-15 08:25:00 UTC
Created attachment 182462 [details]
Comparison between MSO and LO for original and MSO resaved XLS and XLSX

If original XLS is resaved in MSO as XLS and XLSX, they open fine in LO. 
So this is under Low category of bugs where file is not proper but it opens OK in MSO and in this case OO. 
In adddition, LO opens original XLS with Liberation 10 instead of Arial 8. 
Marked as NotOutBug, although it could have been left in this category of invalid files, like some other bugs.