Bug 151196 - FORMATTING "MM/DD/YYYY HH:MM" won't wrap (wrapping uses pre-formatted data?)
Summary: FORMATTING "MM/DD/YYYY HH:MM" won't wrap (wrapping uses pre-formatted data?)
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
6.4 all versions
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Calc-Cells
  Show dependency treegraph
 
Reported: 2022-09-27 01:05 UTC by Jim Avera
Modified: 2024-01-07 20:11 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Small demo spreadsheet (8.32 KB, application/vnd.oasis.opendocument.spreadsheet)
2022-09-27 01:08 UTC, Jim Avera
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jim Avera 2022-09-27 01:05:10 UTC
Description:
If a Calc cell has Alignment set to "wrap", a formatted date with time which contains a space should wrap at the space.  But it does not wrap.

Instead "###" appears.

It is as if the text-wrapping machine works on the cell value before applying formatting, which in this case introduces a space where wrapping can occur.  If that is true, then I think wrapping should use the post-formatted value.

Steps to Reproduce:
(Demo spreadsheet will be attached to this bug)

1.  Format a cell with with the Number Format set to a Date form which introduces a space, for example format code MM/DD/YY HH:MM AM/PM (note space between date and time).

2. Set the "Alignment" format to "Wrap"
3. Increase the height of the cell to allow several lines to be visible.
4. Store a value in the cell, for example 9/10/11 12:13:14
4. Adjust the column width to be slightly too narrow for the entire date & time

Actual Results:
"###" appears in the cell

Expected Results:
Value should be wrapped, e.g.

09/10/11
12:13:14


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 6.4.8.0.0+
Build ID: 71a3f015f2ac45ad4a2625a3b6398f5d75feed40
CPU threads: 12; OS: Linux 5.15; UI render: default; VCL: gtk3; 
TinderBox: Linux-rpm_deb-x86_64@86-TDF, Branch:libreoffice-6-4, Time: 2020-10-01_08:33:37
Locale: en-US (en_US.UTF-8); UI-Language: en-US
Calc: threaded
Comment 1 Jim Avera 2022-09-27 01:08:52 UTC
Created attachment 182692 [details]
Small demo spreadsheet
Comment 2 Eike Rathke 2022-09-27 10:20:38 UTC
Formatted numeric values are not wrapped. Dates are numeric values.
Also note that if dates would be wrapped, wrapping would not only occur on spaces, but also at / and punctuation or even any other character if the cell is too narrow to wrap at spaces, which likely would not be wanted.
Comment 3 Rafael Lima 2022-09-27 14:22:54 UTC
(In reply to Eike Rathke from comment #2)
> Formatted numeric values are not wrapped. Dates are numeric values.
> Also note that if dates would be wrapped, wrapping would not only occur on
> spaces, but also at / and punctuation or even any other character if the
> cell is too narrow to wrap at spaces, which likely would not be wanted.

This is weird though. For instance, when you format the date to be fully written with text as in "Wednesday, May 25, 2022", this text should be able to wrap, but it isn't.
Comment 4 Jim Avera 2022-09-27 20:37:47 UTC
@Eike I see your point. On the other hand "###" is much less helpful to a human reader than wrapping at unexpected places while still showing the data.

Perhaps formatted numbers can be wrapped if and only if an "overflow" would otherwise occur (i.e. when no useful information would be displayed)
Comment 5 Mudge 2023-07-13 18:17:25 UTC
Thank you for reporting the bug. I can confirm that the bug is present in 7.5.4.2