Bug 141050 - CCur does not accept negative strings
Summary: CCur does not accept negative strings
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version:
(earliest affected)
4.1 all versions
Hardware: All All
: medium normal
Assignee: Arpit Bandejiya
URL:
Whiteboard: target:7.2.0 target:7.1.3
Keywords: difficultyBeginner, easyHack, skillCpp
Depends on:
Blocks:
 
Reported: 2021-03-15 16:56 UTC by Andreas Heinisch
Modified: 2021-03-22 15:20 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 Andreas Heinisch 2021-03-15 16:56:52 UTC
Description:
Consider the following code snippet from https://ask.libreoffice.org/en/question/298480/can-function-ccurs-accept-negative-string-like-100/:

Sub Main

dim c as currency
c = CCur("100")
Print c ' result: 100
c = CCur("-100") ' result: Inadmissible value or data type. Data type mismatch.

End Sub

Steps to Reproduce:
Tools->Macros->Organize Macros->Basic
Copy the snippet and hit run.

Actual Results:
Inadmissible value or data type. Data type mismatch.

Expected Results:
The value of c should be -100.


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 7.2.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: 347878c717f317e6eb608ca242739fc9e6cc6d78
CPU threads: 6; OS: Windows 10.0 Build 19042; UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: en-US
Calc: CL
Comment 2 Arpit Bandejiya 2021-03-19 07:36:49 UTC
Hi! I'm new to this community and would like to work on this issue. thanks!
Comment 3 Buovjaga 2021-03-19 07:55:30 UTC
Sure, dig right in.
Comment 4 Arpit Bandejiya 2021-03-19 10:47:26 UTC
(In reply to Buovjaga from comment #3)
> Sure, dig right in.

Hi! I have created a commit for it please take a look. Do let me know if there is any other things I have to do in order to get it reviewed thanks!
Comment 5 Buovjaga 2021-03-19 10:56:47 UTC
(In reply to Arpit Bandejiya from comment #4)
> Hi! I have created a commit for it please take a look. Do let me know if
> there is any other things I have to do in order to get it reviewed thanks!

For reference: https://gerrit.libreoffice.org/c/core/+/112734

Now you can send a license statement: https://wiki.documentfoundation.org/Development/GetInvolved#License_statement
Comment 6 Arpit Bandejiya 2021-03-19 11:22:13 UTC
I have send the license mail. I have applied for the dev google group but it has not been accepted till now. please let me know how much time it takes generally.
Thanks!
Comment 7 Buovjaga 2021-03-19 11:57:31 UTC
(In reply to Arpit Bandejiya from comment #6)
> I have send the license mail. I have applied for the dev google group but it
> has not been accepted till now. please let me know how much time it takes
> generally.
> Thanks!

There is no dev Google group. Your email arrived at the dev mailing list
Comment 8 Commit Notification 2021-03-20 10:58:17 UTC
arpit1912 committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/54b3ada2e5ef9dcbc452509a7bbe39f0920572e2

tdf#141050 Accept CCur with negative strings

It will be available in 7.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 9 Buovjaga 2021-03-20 12:54:30 UTC
Arpit: congrats on your first merged patch! You can set the status to resolved fixed. You might be interested in this related, more demanding task: bug 128122
Comment 10 Commit Notification 2021-03-22 15:16:04 UTC
arpit1912 committed a patch related to this issue.
It has been pushed to "libreoffice-7-1":

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

tdf#141050 Accept CCur with negative strings

It will be available in 7.1.3.

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 11 Xisco Faulí 2021-03-22 15:20:08 UTC
Reproduced back to

Version 4.1.0.0.alpha0+ (Build ID: efca6f15609322f62a35619619a6d5fe5c9bd5a)