Bug 59820 - FILEOPEN: default csv column width is wrong with multiline cells
Summary: FILEOPEN: default csv column width is wrong with multiline cells
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
4.0.0.0.beta1
Hardware: All Linux (All)
: medium normal
Assignee: Andreas Heinisch
URL:
Whiteboard: target:7.3.0
Keywords:
: 127027 (view as bug list)
Depends on:
Blocks: CSV-Import
  Show dependency treegraph
 
Reported: 2013-01-24 19:59 UTC by rwman
Modified: 2021-08-27 10:02 UTC (History)
13 users (show)

See Also:
Crash report or crash signature:


Attachments
test file with multiline cells to show default column-width bug (5.48 KB, text/csv)
2013-01-24 19:59 UTC, rwman
Details

Note You need to log in before you can comment on or make changes to this bug.
Description rwman 2013-01-24 19:59:20 UTC
Created attachment 73611 [details]
test file with multiline cells to show default column-width bug

When opening csv-file libreoffice-calc tries to set an optimal default width for columns. But it fails if some cells has multiline content. Column width for a column, that contains multiline cells defaults to very large (i think it just counts max number of characters in every cell and ignores the fact that there are line breaks).
* see attached example file

If after opening the file i r-click on the column header and select "optimal column width" - column shrinks properly to fit the cells.

This bug is more hurting because resizing very wide columns is now broken ( see bug https://bugs.freedesktop.org/show_bug.cgi?id=57361 )
Comment 1 rwman 2013-01-24 20:03:39 UTC
Comment on attachment 73611 [details]
test file with multiline cells to show default column-width bug

* the attached csv-file is tab-separated and utf8-encoded
Comment 2 Jorendc 2013-01-26 19:05:46 UTC
I can reproduce this behavior using LO 4.0.0.1 and latest master LO Version 4.1.0.0.alpha0+ (Build ID: f1bca26afcc7593d0124c216c0400a9e2e47fc1).

* I don't change anything on priority of this bug medium normal following https://wiki.documentfoundation.org/images/0/06/Prioritizing_Bugs_Flowchart.jpg
Comment 3 ign_christian 2013-05-10 02:22:10 UTC
reproducible with LO 4.0.3.3 (Win 7 Home Premium 32bit)

column A too wide
Comment 4 QA Administrators 2015-04-01 14:42:49 UTC Comment hidden (obsolete)
Comment 5 Tristan Miller 2015-04-01 15:26:21 UTC
I can reproduce this with LibreOffice 4.4.1.2 on openSUSE 13.2 (64-bit).
Comment 6 tommy27 2016-04-16 07:28:59 UTC Comment hidden (obsolete)
Comment 7 Tristan Miller 2016-04-22 10:45:36 UTC
Confirming bug still exists as originally described in LibreOffice 5.1.2.2.0+ (on openSUSE 13.2).
Comment 8 QA Administrators 2017-05-22 13:27:25 UTC Comment hidden (obsolete)
Comment 9 Tristan Miller 2017-05-28 20:18:14 UTC
Confirming bug still exists as originally described in LibreOffice 5.3.2.2 (on openSUSE Tumbleweed).
Comment 10 QA Administrators 2018-07-21 02:39:12 UTC Comment hidden (obsolete)
Comment 11 Tristan Miller 2018-07-21 07:26:40 UTC
Confirming bug still exists as originally described in LibreOffice 6.1.0.1 (on openSUSE Tumbleweed).
Comment 12 QA Administrators 2019-07-22 02:44:30 UTC Comment hidden (obsolete)
Comment 13 Tristan Miller 2019-07-30 12:40:31 UTC
Confirming bug still exists as originally described in LibreOffice 6.2.5.2 (on openSUSE Tumbleweed).
Comment 14 Buovjaga 2020-04-19 14:45:28 UTC
*** Bug 127027 has been marked as a duplicate of this bug. ***
Comment 15 Andreas Heinisch 2021-08-15 18:54:38 UTC
Proposed patch: https://gerrit.libreoffice.org/c/core/+/120514
Comment 16 Commit Notification 2021-08-18 08:06:53 UTC
Andreas Heinisch committed a patch related to this issue.
It has been pushed to "master":

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

tdf#59820 - Adjust column width of imported ASCII files

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 17 Commit Notification 2021-08-19 18:41:18 UTC
Andreas Heinisch committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/45620dc9bb3e6561fdd64e2c7d192ccae136b224

Revert "tdf#59820 - Adjust column width of imported ASCII files"

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 18 Commit Notification 2021-08-27 09:30:00 UTC
Andreas Heinisch committed a patch related to this issue.
It has been pushed to "master":

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

tdf#59820 - Search for the longest substring in a multiline string

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.