Issue 111097

Summary: [CWS:npower13_objectmodules] Incorrect date returned for DateSerial(0,1,1)
Product: General Reporter: joerg.skottke
Component: codeAssignee: ab
Status: CLOSED FIXED QA Contact: issues@framework <issues>
Severity: Trivial    
Priority: P3 CC: issues, noel.power
Version: DEV300m75Keywords: regression
Target Milestone: OOo 3.3   
Hardware: All   
OS: All   
Issue Type: PATCH Latest Confirmation in: ---
Developer Difficulty: ---
Attachments:
Description Flags
patch
none
patch file none

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