Bug 146737 - EDIT FIELDS: Cannot change format of inserted "user field" to any other format
Summary: EDIT FIELDS: Cannot change format of inserted "user field" to any other format
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Fields Fields-Variable
  Show dependency treegraph
 
Reported: 2022-01-13 13:11 UTC by sdc.blanco
Modified: 2023-05-24 14:30 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description sdc.blanco 2022-01-13 13:11:49 UTC
1. Insert - Fields - More Fields (Ctrl+F2)
2. Select User Field with "Standard" format, and insert variable.
3. Edit inserted variable (e.g., right-click, Edit Fields)
4. Change format to Text (e.g., select Additional Formats, then "text" in Category, Ok, Ok).
5. Edit Field again (to check that change was made)

Expected result: Format of field remains as "text" 
Actual result:  Format remains "standard"

Version: 7.4.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: bb29b12a9e367d181a5d9d962d466df41e093e0c
CPU threads: 8; OS: Windows 10.0 Build 19043; UI render: Skia/Raster; VCL: win
Locale: da-DK (da_DK); UI: en-US
Calc: CL
Comment 1 Dieter 2022-01-28 07:39:50 UTC
I confirm it with

Version: 7.4.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: e27a41a362bf25e12487b36f625985b35fb891e3
CPU threads: 4; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: en-GB
Calc: CL
Comment 2 Eike Rathke 2023-04-02 15:54:47 UTC
This is not restricted to the change from General to Text. Changing the format of an inserted user field is not possible at all.
Only when inserting a field (again) a new format may be assigned.
Comment 3 sdc.blanco 2023-04-03 01:28:56 UTC Comment hidden (no-value)
Comment 4 sdc.blanco 2023-04-04 22:55:30 UTC Comment hidden (no-value)
Comment 5 sdc.blanco 2023-04-04 23:00:47 UTC
(In reply to Eike Rathke from comment #2)
> Changing the format of an inserted user field is not possible at all.
Does that mean NAB? Or maybe a need for better documentation (e.g., in [1]) to note this impossibility? Or...`?

[1] https://help.libreoffice.org/7.6/en-US/text/swriter/01/04090300.html?&DbPAR=WRITER
Comment 6 Eike Rathke 2023-04-05 08:21:07 UTC
I don't know, I'm not an expert in that area and don't even know how it's _supposed_ to work or why the current implementation was chosen. I'm just fixing some most obvious bugs there and came across this and commented/documented what I found.
Comment 7 sdc.blanco 2023-04-05 08:42:31 UTC
(In reply to Eike Rathke from comment #6)
> I don't know, I'm not an expert in that area and don't even know how it's
> _supposed_ to work or why the current implementation was chosen. 
Thanks for clarification Eike!   
@Mike -- can you rescue us from our ignorance here?
Comment 8 sdc.blanco 2023-04-05 12:12:40 UTC
A simple way to change format of variable. Discovered while testing effect of locale and UI on format labels for bug 154613.  

1. Insert variable and value with Format "General".
2. Insert variable and value with same name as first but with Format "Text".
    (Use "Edit Field" to confirm formats)
3. Save document and reload, then edit fields to see formats.

Actual:  first inserted variable format is now "Text"
Expected: first inserted variable format does not change.

(similarly, if a variable with Text format is inserted, followed by a variable with General format, then save and reload results in the first text variable being changed to "General" (though it uses the language of the locale when showing the format label).

(same effect with "user field")
Comment 9 sdc.blanco 2023-04-05 12:21:39 UTC
comment 8 tested with:
Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 1e9f4de320f67d1218c710bcee1969a2324c6888
CPU threads: 8; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win
Locale: da-DK (da_DK); UI:  en-US
Calc: CL threaded