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
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
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.
(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]) Also, from experimenting, it seems possible to insert variables with the same variable name, but different formats, which results in (what seems like) problematic (interactive) behavior between the formats. Case 1 (user field) 1. Insert user field with "Standard" format, and a text string value. Actual: 0 is shown. 2. Insert another user field, with same variable name, "Text" format, and a text string value. Actual: The text value is also shown in the first user field as well. (i.e., the "Standard" format is, in effect, overridden). Case 2 (variable) 1. Use "set variable" to insert a field with "Standard" format, and a text string value. Actual: Nothing is shown. 2. Insert another variable field, with same variable name as the first, but "Text" format, and a text string value. Actual: The text value that was entered for the first variable is now shown, even though the format is "Standard". In short, these two cases show how the same variable name with different formats result in "standard" format being able to show text. [1] https://help.libreoffice.org/7.6/en-US/text/swriter/01/04090300.html?&DbPAR=WRITER
(In reply to sdc.blanco from comment #3) > Also, from experimenting, it seems possible... filed as bug 154611
(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
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.
(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?
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 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