Bug 164446 - With locales using decimal comma, it's impossible to edit doubles in Basic IDE's Watch window
Summary: With locales using decimal comma, it's impossible to edit doubles in Basic ID...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Mike Kaganski
URL:
Whiteboard: target:25.8.0
Keywords:
Depends on:
Blocks: BASIC-IDE
  Show dependency treegraph
 
Reported: 2024-12-24 07:09 UTC by Mike Kaganski
Modified: 2024-12-24 12:43 UTC (History)
2 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 Mike Kaganski 2024-12-24 07:09:44 UTC
Using a locale that uses a decimal separator other than decimal dot (e.g., comma):

1. Create this Basic macro:

sub foo
  dim x as double
end sub

2. In Basic IDE, put a breakpoint to the "end sub" line.
3. Run the macro.
4. When the execution is paused on the breakpoint, make sure that the Watched Expressions are shown (check menu View), and put "c" into the "Watch" box, then press Enter to add the "x" variable to the Watched list.
5. See that the Value is shown to be 0.
6. Double-click the value (the double-click must be over the value text) to edit it.
7. Type a floating-point value. Try both using a standard Basic decimal dot, and the locale-specific decimal separator. E.g., try to input "1.2" or "1,2".

=> it's impossible to make the value of the variable equal to the entered floating-point value. It may become 1, or 12, but it will not accept the decimal separator properly.

I suspect that it broke after the change in bug 97983. The code in SbxValue::PutStringExt, and in ImpConvStringExt called from there, is intended to handle internationalized input, making it standardized to decimal dot, but with the change when the standard conversion uses only internationalized strings, it unconditionally changes the decimal separator to the dot not accepted in the conversion.
Comment 1 Mike Kaganski 2024-12-24 07:41:02 UTC
https://gerrit.libreoffice.org/c/core/+/179302
Comment 2 Commit Notification 2024-12-24 11:03:18 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

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

tdf#164446: fix internationalized FP input in Basic IDE Watch

It will be available in 25.8.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.