Issue 111097 - [CWS:npower13_objectmodules] Incorrect date returned for DateSerial(0,1,1)
Summary: [CWS:npower13_objectmodules] Incorrect date returned for DateSerial(0,1,1)
Status: CLOSED FIXED
Alias: None
Product: General
Classification: Code
Component: code (show other issues)
Version: DEV300m75
Hardware: All All
: P3 Trivial (vote)
Target Milestone: OOo 3.3
Assignee: ab
QA Contact: issues@framework
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2010-04-23 08:17 UTC by joerg.skottke
Modified: 2017-05-20 10:23 UTC (History)
2 users (show)

See Also:
Issue Type: PATCH
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
patch (2.11 KB, patch)
2010-04-23 18:15 UTC, noel.power
no flags Details | Diff
patch file (2.12 KB, patch)
2010-04-26 10:49 UTC, noel.power
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description joerg.skottke 2010-04-23 08:17:12 UTC
Autotest: framework/optional/f_basic_issues.bas

# ---------------------------------------------------------------------------- #

[i97038]
' Date should contain the year 1900 and the value should be 2

Sub Main
    Dim v
    v = DateSerial(0,1,1)
    Msgbox ("Date :  " & v)
    MsgBox ("Value : " & CDbl(v))
End Sub

# ---------------------------------------------------------------------------- #
Comment 1 joerg.skottke 2010-04-23 08:18:26 UTC
Set kwd regression, OS = all.
Comment 2 ab 2010-04-23 12:15:52 UTC
Problem is not the behavior itself, but the changed vba status handling.
Obviously "option vbasupport 1" had been executed in another context
before the test script has been started. The issue here is that once vba
support is enabled it never will be disabled when starting a new script
unlike "option vbasupport 0" is used explicitely.

STARTED, CC npower
Comment 3 noel.power 2010-04-23 18:15:00 UTC
the problem is basically that the parser now take the modules vba mode, the
option vbasupport thingy can change the module's mode, however if you don't
specify the option vbasupport thingy then the previous mode remains in place.
solution is to use the document's library container vba mode as the default ( if
you make any changes to the source ) In otherwords if you don't specify 'Option
VBASupport 0|1' the default mode will be VBA ( in a imported document ) and
Non-VBA in an odf document. In either case the default can be overridden by use
of Option VBSupport

Andreas, have a look at the patch, try it out, if your happy I'll commit it
Comment 4 noel.power 2010-04-23 18:15:39 UTC
Created attachment 69079 [details]
patch
Comment 5 noel.power 2010-04-26 10:49:11 UTC
Created attachment 69107 [details]
patch file
Comment 6 noel.power 2010-04-26 10:51:30 UTC
slight change to the path,

-+						aTok.SetCompatible( true );
++						aTok.SetCompatible( aTok.GetDbl()== 1 );

the previous version was setting the compatibly mode to true ( even for Option
VBASupport 0 )

I really hate this stupid mode with ( a number ) and yes I know I have no-one to
blame but myself
Comment 7 noel.power 2010-04-26 13:09:33 UTC
fixed
Comment 8 daniel.rentz 2010-04-27 15:56:50 UTC
title corrected
Comment 9 joerg.skottke 2010-05-12 06:50:21 UTC
Verified by autotest