Bug 168788 - Forms: Numeric control shows last current value if control is set empty by GUI
Summary: Forms: Numeric control shows last current value if control is set empty by GUI
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.5.4.2 release
Hardware: x86-64 (AMD64) All
: medium normal
Assignee: Caolán McNamara
URL:
Whiteboard: target:26.2.0 target:25.8.4
Keywords: bibisected, bisected, regression
Depends on:
Blocks:
 
Reported: 2025-10-10 07:08 UTC by Robert Großkopf
Modified: 2025-11-10 10:23 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Form with numeric control, formatted control and curreny control for testing CurrentValue (17.01 KB, application/vnd.oasis.opendocument.text)
2025-10-10 07:08 UTC, Robert Großkopf
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Großkopf 2025-10-10 07:08:48 UTC
Created attachment 203235 [details]
Form with numeric control, formatted control and curreny control for testing CurrentValue

Enable macro executing. 
Open the attached Document. 
Set cursor in "Numeric control".
Write a number and click outside control.
Current value of the control will be shown in text control (last control of the page).
Remove the number. Field seems to contain no value - nothing.
Click outside but: Last value would be shown as current value in text control.

Do the same with formatted control, which is formatted for numbers.
If number in formatted control has been set to an empty number you will see nothing in the text control. Current value is empty.

Same buggy behavior with "Currency control".

If you close the form and reopen it: Set cursor in "Numeric control" and click outside: Last current value will be shown. Same for "Currency control".

This bug appears in 
Version: 24.8.7.2 (X86_64) / LibreOffice Community
Build ID: e07d0a63a46349d29051da79b1fde8160bab2a89
CPU threads: 6; OS: Linux 6.4; UI render: default; VCL: kf5 (cairo+xcb)
Locale: de-DE (de_DE.UTF-8); UI: de-DE
Calc: threaded

and also the current version LO 25.8.2.2.

It will appear different in LO 7.4.7.2. There will be shown '0' for an empty numeric control or an empty currency control. Better than the current behavior, but not good.
Comment 1 Saburo 2025-10-13 10:24:07 UTC
reproduce
Version: 25.8.2.2 (X86_64)
Build ID: d401f2107ccab8f924a8e2df40f573aab7605b6f
CPU threads: 12; OS: Windows 11 X86_64 (build 26100); UI render: Skia/Vulkan; VCL: win
Locale: ja-JP (ja_JP); UI: ja-JP
Calc: CL threaded

and in
Version: 7.5.9.2 (X86_64) / LibreOffice Community
Build ID: cdeefe45c17511d326101eed8008ac4092f278a9
CPU threads: 12; OS: Windows 10.0 Build 26100; UI render: Skia/Raster; VCL: win
Locale: ja-JP (ja_JP); UI: ja-JP
Calc: CL threaded

not reproduce
Version: 7.4.7.2 (x64) / LibreOffice Community
Build ID: 723314e595e8007d3cf785c16538505a1c878ca5
CPU threads: 12; OS: Windows 10.0 Build 26100; UI render: Skia/Raster; VCL: win
Locale: ja-JP (ja_JP); UI: ja-JP
Calc: CL


bibisected with win64-7.5
Open the attached file, delete the 4 from the 'Numeric control', and check whether 0 or 4 is displayed in the text control when you click outside the control.

adding CC: Caolán McNamara

commit 0d0841dc8faccc7d7d3d8d463916dd73a7c061a1
author	Caolán McNamara <caolanm@redhat.com>	Thu May 11 16:03:57 2023 +0100

tdf#155241 keep current MetricSpinButton value if unparseable junk input

Change-Id: I0f13c9ae25c1788924fd81ed77307e96400f6220
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151617
Comment 2 Caolán McNamara 2025-11-08 21:11:11 UTC
We could try making Numeric/Currency Controls consistent with Formatted Controls on how they report empty strings as an empty Any.

https://gerrit.libreoffice.org/c/core/+/193635 does that, and would solve this at the risk of being a change.
Comment 3 Commit Notification 2025-11-09 10:29:54 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/e1f30355de2251bf6ac2e069b1fd231bf9fd84aa

tdf#168788 return empty any for empty string for Numeric/Currency Controls

It will be available in 26.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 4 Commit Notification 2025-11-10 10:23:12 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-25-8":

https://git.libreoffice.org/core/commit/75853a9a9e560a4a4a29e568d8240f6888d8a519

tdf#168788 return empty any for empty string for Numeric/Currency Controls

It will be available in 25.8.4.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.