Bug 160002 - Indentation issue in currency formatted (with left-aligned currency symbol) cells in Calc
Summary: Indentation issue in currency formatted (with left-aligned currency symbol) c...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
24.2.0.3 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL: https://ask.libreoffice.org/t/messed-...
Whiteboard:
Keywords: bibisectRequest, regression
: 160091 (view as bug list)
Depends on:
Blocks: Calc-Cells
  Show dependency treegraph
 
Reported: 2024-03-02 19:57 UTC by Daniel Fenech
Modified: 2024-03-08 06:59 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Left image is indentation post update, right is post cell re-formatting. Previously, the currency sign is at the far left of the cell, unlike the new formatting. (17.62 KB, image/jpeg)
2024-03-02 20:02 UTC, Daniel Fenech
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Fenech 2024-03-02 19:57:16 UTC
Description:
In a sheet in which cells are mainly set as currency, the currency symbol (which was previously fully indented to the far left of the cell) was now indented so much that it moves to the adjacent cell.

The only way to fix this is to re-format each cell (as currency still). This moved the currency symbol together with the value (aka no indentation and no spacing).

The format code of the cell pre re-formatting is:
_-[$€-2] * #,##0.00_-;-[$€-2] * #,##0.00_-;_-[$€-2] * -??_-;_-@_-

The format code of the cell post re-formatting is:
[$€-43A]#,##0.00;[RED]-[$€-43A]#,##0.00

I also tried to change the format code to the below, but this still pushed the currency symbol way offset onto the adjacent cell:
[$€-43A]* #,##0.00;[RED]-[$€-43A]* #,##0.00

Steps to Reproduce:
1. Simply open a spreadsheet that was created in a previous version, which has currency formatted cells, in the new release.

Actual Results:
The currency symbol is indented way off to the left, resulting in it overlapping into the adjacent cell (and if any data in that cell, it overlaps that data). Resizing the column won't have any affect.

Expected Results:
The currency should be perfectly indented to the left of the cell, while the value should be indented to the right, with perfect spacing in between for consistency.


Reproducible: Always


User Profile Reset: No

Additional Info:
No other information available.
Comment 1 Daniel Fenech 2024-03-02 20:02:23 UTC
Created attachment 192916 [details]
Left image is indentation post update, right is post cell re-formatting. Previously, the currency sign is at the far left of the cell, unlike the new formatting.
Comment 2 ady 2024-03-02 21:45:51 UTC
Please provide a minimal sample ods file, preferably saved with an older version (that you know used to show the expected indentation and alignment), so other could attempt to reproduce what you see in your system.

Please be aware that such sample ods file will be publicly available.

<https://wiki.documentfoundation.org/QA/Bugzilla/Sanitizing_Files_Before_Submission>
Comment 3 Eike Rathke 2024-03-07 21:02:11 UTC
In B1 enter a number and format with a currency format that left-aligns the currency symbol, like the mentioned

[$€-43A]* #,##0.00;[RED]-[$€-43A]* #,##0.00

and then widen the column and see the symbol being shifted out to the left.

See also https://ask.libreoffice.org/t/messed-up-currency-indentation-in-calc-after-update/102868
Comment 4 Eike Rathke 2024-03-07 21:03:37 UTC
*** Bug 160091 has been marked as a duplicate of this bug. ***
Comment 5 ady 2024-03-08 06:59:15 UTC
(In reply to Eike Rathke from comment #3)

> [$€-43A]* #,##0.00;[RED]-[$€-43A]* #,##0.00
> 
> and then widen the column and see the symbol being shifted out to the left.

For those trying to replicate this:

* Set an entire column with a custom format as Eike suggested or similar; for instance:

[$€-409]* #,##0.00;[RED]-[$€-409]* #,##0.00


* This is easier to see/replicate when using different numeric values. Set one cell with 1.88, another with 12345.67, and another with 1 million.

* This is easier to see when using the default cell alignment.

* This is easier to see when using a proportional font (in contrast to using a fixed-width mono-spaced font). In fact, using a mono-spaced font you might not see the displacement at all.

* This is easier to see when the apparent space between the currency symbol and the number is intentionally much wider than needed. > Set the width of the column intentionally _much_ _wider_ than the minimum needed.

* This is easier to see when varying the zoom slider in Calc. While modifying the zoom factor, in some cases (i.e. zoom values) you might not see the problem, whereas with some other zoom factors – just move the zoom slider – the problem will be more evident.


While the problem can be seen in LO 24.2.0.3 already, I am not completely sure that the behavior in a recent alpha is _exactly_ the same; the problem is still there, but maybe there is something else too.

Since there seems to be some misalignment in LO 7.6, this might be some implementation error while trying to solve such a problem. But since I am not sure, and the behavior is not seen in LO 7.6, I am setting this as a regression for now.