Bug 120319 - FILEOPEN XLSX Consecutive spaces in cells with Wrap text affect horizontal text alignment
Summary: FILEOPEN XLSX Consecutive spaces in cells with Wrap text affect horizontal te...
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
6.1.0.3 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Calc-Cells
  Show dependency treegraph
 
Reported: 2018-10-04 16:04 UTC by Gabor Kelemen (allotropia)
Modified: 2018-10-11 08:35 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:
Regression By:


Attachments
Example file with cell content aligned with consecutive spaces and wrap text (16.77 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2018-10-04 16:04 UTC, Gabor Kelemen (allotropia)
Details
Screenshot of the document in Excel 2010 and Calc 6.1 (217.01 KB, image/png)
2018-10-04 16:05 UTC, Gabor Kelemen (allotropia)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gabor Kelemen (allotropia) 2018-10-04 16:04:18 UTC
Created attachment 145387 [details]
Example file with cell content aligned with consecutive spaces and wrap text

Attached XLSX was created with Excel. 
The text in cell A1 has Wrap text set and some consecutive spaces after the first word, as an attempt at manually determining the place of the line breaking.

In Excel this pushes the next word to a new line, but the overall horizontal alignment of visible text in that line is not affected: we can add more spaces to the end, and nothing happens.
In Calc all spaces are considered as part of the text to be horizontally aligned.

We see a lot of such documents in the wild, so maybe a similar "let's figure out what they actually wanted" behavior would be desirable.
Comment 1 Gabor Kelemen (allotropia) 2018-10-04 16:05:06 UTC
Created attachment 145388 [details]
Screenshot of the document in Excel 2010 and Calc 6.1

Verzió: 6.1.0.3
Build az.: efb621ed25068d70781dc026f7e9c5187a4decd1
CPU szálak: 4; OS: Windows 6.3; Felületmegjelenítés: alapértelmezett; 
Területi beállítások: hu-HU (hu_HU); Calc: group threaded
Comment 2 m.a.riosv 2018-10-04 21:26:39 UTC
Seems another case to implement in LibreOffice a not right way to work on excel.

What happen with LibreOffice people, that maybe use of the LibreOffice behavior.
Comment 3 Heiko Tietze 2018-10-05 12:41:01 UTC
Pro Excel: the text looks more sleek
Pro LibO: the user can modify the text position with spaces like second line right-aligned
Pro LibO: the content is more clear (select the white spaces in the function bar) and easier to edit (you can also select it on the cell)

I tend to WFM, other opinions?
Comment 4 Cor Nouws 2018-10-09 14:53:09 UTC
poeh... nasty question.

@gabor: what happens in Excel if one increases row height? Will it split text over more lines, or ??
I'm trying to understand why we see 4 lines in Excel and 3 in Calc...
Comment 5 Regina Henschel 2018-10-09 16:44:59 UTC
Forcing line break by spaces is bad practice and not needed at all. Excel has a proper line break, use Alt+Enter. That is correctly rendered in LibreOffice.

The desired appearance is broken in Excel, if you alter the width of the cell.

I would do nothing about the spaces.

But I agree with Cor, that there is a problem with the cell height. Not only the total height is larger in LibreOffice than in Excel, but LibreOffice has a smaller line spacing than Excel.
Comment 6 Gabor Kelemen (allotropia) 2018-10-09 17:10:49 UTC
(In reply to Cor Nouws from comment #4)
> poeh... nasty question.
> 
> @gabor: what happens in Excel if one increases row height? Will it split
> text over more lines, or ??
> I'm trying to understand why we see 4 lines in Excel and 3 in Calc...

That's bug #112561 - Excel uses a 1.12 line spacing for multiline text
Comment 7 Thomas Lendo 2018-10-10 12:35:55 UTC
For me the dealing with consecutive spaces is correct in LibreOffice and false in MSO Excel. The Excel-behavior misleads to wrong formatting as we can see in the attached example spreadsheet. This is a WFM.

But beside the space handling, the visual appearance of this example cell text is indisputably negative in LibreOffice.

The cell/row height is defined by Excel/xlsx and doesn't depend on the multi-line text height of LibreOffice. For me, this is OK because otherwise all spreadsheets would look entirely different in both programs.

Gabor mentioned bug 112561 which would solve the multi-line text spacing issue that also leads to the wrong-looking row height in the example file.
Comment 8 Heiko Tietze 2018-10-11 08:35:03 UTC
We discussed the topic in the design meeting and agreed on resolving as WFM.