https://bugs.freedesktop.org/show_bug.cgi?id=44385
Bug #: 44385
Summary: BASIC: Incorrect type returned for date math
Classification: Unclassified
Product: LibreOffice
Version: LibO 3.4.4 release
Platform: Other
OS/Version: All
Status: UNCONFIRMED
Status Whiteboard: BSA
Severity: normal
Priority: medium
Component: BASIC
AssignedTo: [email protected]
ReportedBy: [email protected]
Problem description:
DateValue(Now + 2) fails in a macro because "Now + 2" returns as a double
rather than as a date. The same is true for "Now - 2".
This bug was introduced by Noel Power 06-Dec-2010 with commit
1421b098ae19a10acb4836fa3752188cf7c52eb2 (thank you Regina for looking that up
for me, I do not know how to check that)
The problem is found in file:
core/basic/source/sbx/sbxvalue.cxx
There is a switch statement around line 1312. Following the switch statement,
there used to be the following code:
// #45465 Date braucht bei + eine Spezial-Behandlung
if( eOp == SbxPLUS && (GetType() == SbxDATE || rOp.GetType() == SbxDATE ) )
aL.eType = SbxDATE;
I am not an expert on these things, but, it looks like the checks to see if
either operand is a date, and, if so, sets the type to be date. This was done
after PLUS, EXP, MUL, DIV, MINUS, and NEG.
That line was removed and added after PLUS as a comment, so, I assume that NOEL
was unsure why it was required. Still waiting on input from NOEL.
I speculate that this was done as part of clean-up because this check was
performed every time. Off hand, I can not think of why you might do this for
anything other than PLUS or MINUS, but, this breaks existing macros. so I would
call this a regression bug.
I reproduced this on a Fedora Linux system (64-bit), but, I expect this to
affect all platforms.
--
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs