Issue 97673

Summary: Embedded newlines in .csv files give wrong column width
Product: Calc Reporter: jimavera <james_avera>
Component: open-importAssignee: AOO issues mailing list <issues>
Status: CONFIRMED --- QA Contact:
Severity: Trivial    
Priority: P3 CC: elish, issues
Version: OOo 3.0   
Target Milestone: ---   
Hardware: All   
OS: Linux, all   
Issue Type: DEFECT Latest Confirmation in: 4.0.0
Developer Difficulty: ---
Attachments:
Description Flags
Demo CSV file with embedded newlines in a "text field"
none
Demo CSV file with embedded newlines in a "text field"
none
Screen-shot showing incorrect column width none

Description jimavera 2008-12-30 21:38:22 UTC
Comma-separated-value (csv) files may contain "quoted fields
with embedded newlines".  When importing into scalc, the width of
the spreadsheet column is set incorrectly to the width of the widest datum
as if the newlines were ordinary characters.

This results in spreadsheet columns which are extremely wide (often much wider
than can be displayed), even though the longest text line is much shorter.

Expected results: The spreadsheet column width should be set according to the
longest line in any cell in the column, taking into account embedded newlines.

I will attach a small .csv file.  To see the problem, open it from scalc.

(Note: Applying 'Optimal Column Width' to the column removes the excess space)
Comment 1 jimavera 2008-12-30 21:39:29 UTC
Created attachment 59086 [details]
Demo CSV file with embedded newlines in a "text field"
Comment 2 jimavera 2008-12-30 21:40:10 UTC
Created attachment 59087 [details]
Demo CSV file with embedded newlines in a "text field"
Comment 3 jimavera 2008-12-30 21:43:03 UTC
Created attachment 59088 [details]
Screen-shot showing incorrect column width
Comment 4 Edwin Sharp 2013-04-26 12:11:52 UTC
Unreasonable width when importing attachment in Rev. 1467605