Bug 145000 - UI: Writer fails to load locale distance unit and always shows shadow distance in inches
Summary: UI: Writer fails to load locale distance unit and always shows shadow distanc...
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.2.1.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Area-Fill-Tab Shapes
  Show dependency treegraph
 
Reported: 2021-10-08 14:56 UTC by phv
Modified: 2022-07-15 11:09 UTC (History)
1 user (show)

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


Attachments
Screenshots of the shadow distance mismatch (89.67 KB, image/png)
2021-10-08 14:56 UTC, phv
Details

Note You need to log in before you can comment on or make changes to this bug.
Description phv 2021-10-08 14:56:39 UTC
Created attachment 175597 [details]
Screenshots of the shadow distance mismatch

My LibreOffice options are as follow:
- User interface: English
- Locale setting: French
- Default Language for documents: English
- Measurement unit: Centimeter

When creating a shape in a new Writer document (LibreOffice has to be closed first), the shadow distance always appears in inches instead of centimeters. If I change the position or size from the Position and Size window, the locale unit is called and the shadow distance change to centimeter; But it stays in inch if I move or resize the shape manually.

When I save and reload the same document, the shadow distance is back to inch unit.

Steps to Reproduce:
1. Set a locale setting with metric unit.
2. Close LibreOffice.
3. Create or load Writer document with a shape. Don't move the shape yet.
4. Open the Area window and enable the shadow.

Actual Result: Shadow distance is using inch length unit instead of the locale length unit.
Expected Result: Shadow distance should use the locale length unit by default.

Additional Information: When loading, the shadow distances are converted back to inch, so the initial values are lost.
Comment 1 phv 2021-10-08 16:13:16 UTC
This bug is more complex than I thought.

It only happens when Writer is loading a document after a fresh LibreOffice start: Writer systematically resets the shadow distance in inch unit, even if it's not the locale length unit or after the user has modified and saved the measurement in centimeter.

I added steps to reproduce:
1. Set a locale setting with metric unit.
2. Close LibreOffice.
3. Create Writer document and insert a shape.
4. Open the Area window and enable the shadow: its distance is in centimeter.
5. Save.
6. Close LibreOffice (important!)
7. Load the previous document.

Actual Result: Shadow distance is now using inch length unit instead of the locale length unit.
Expected Result: Shadow distance should use the locale length unit by default.

What I have tested so far after having saved a shape with a shadow distance in centimer:
- Closing Writer and loading the document: still in centimeter.
- Closing LibreOffice and loading the document: now in inch.
- Inserting a new shape in a new Writer document after closing Writer or LibreOffice: in centimeter.

To resume, Writer fails to load the locale shadow distance unit at startup but the setting is called when a shape is created or modified from a window (but not manually for whatever reason). Also to be noted, neither Draw or Impress are affected by this bug.
Comment 2 Dieter 2021-10-26 11:40:40 UTC
I confirm it with

Version: 7.2.2.2 (x64) / LibreOffice Community
Build ID: 02b2acce88a210515b4a5bb2e46cbfb63fe97d56
CPU threads: 4; OS: Windows 10.0 Build 19043; UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: en-GB
Calc: CL
Comment 3 phv 2021-12-23 18:21:49 UTC
I add the report for bug #81661 in See Also because the cause and consequence are the same in both cases:
- Writer fails to load the locale distance unit at startup and the unit is systematically in inch.
- Locale distance unit is not updated in centimeter (or other) if you move or modify the shape, the image or the group manually.
- Locale distance unit is updated in centimeter (or other) if you open the Position and Size window.
- The bug only affects Writer.

I have modified the title of the report accordingly.
Also the bug is still present in LibreOfficeDev 7.4.0.0.
Comment 4 phv 2022-07-15 11:09:52 UTC
I can't reproduce this bug anymore, so the issue must have been fixed by some recent commit.