summaryrefslogtreecommitdiff
path: root/basic/source/comp/parser.cxx
diff options
context:
space:
mode:
authornpower Developer <npower@openoffice.org>2010-03-02 12:39:31 +0000
committernpower Developer <npower@openoffice.org>2010-03-02 12:39:31 +0000
commitda0a3a0e7f71bc56a6e4e49b4d0645de6903739c (patch)
treeb5758d632f0ffc509548dfd3afe9aaad1716deb1 /basic/source/comp/parser.cxx
parent4d8175599b8d193aba6eef89ef905c830b87d7e7 (diff)
npower13_objectmodule: #i109734# object module stuff
Diffstat (limited to 'basic/source/comp/parser.cxx')
-rw-r--r--basic/source/comp/parser.cxx12
1 files changed, 11 insertions, 1 deletions
diff --git a/basic/source/comp/parser.cxx b/basic/source/comp/parser.cxx
index 400e77a94b16..9fbd1035fa5f 100644
--- a/basic/source/comp/parser.cxx
+++ b/basic/source/comp/parser.cxx
@@ -140,7 +140,8 @@ SbiParser::SbiParser( StarBASIC* pb, SbModule* pm )
bNewGblDefs =
bSingleLineIf =
bExplicit = FALSE;
- bClassModule = FALSE;
+ bClassModule = ( pm->GetModuleType() == com::sun::star::script::ModuleType::Class );
+ OSL_TRACE("Parser - %s, bClassModule %d", rtl::OUStringToOString( pm->GetName(), RTL_TEXTENCODING_UTF8 ).getStr(), bClassModule );
pPool = &aPublics;
for( short i = 0; i < 26; i++ )
eDefTypes[ i ] = SbxVARIANT; // Kein expliziter Defaulttyp
@@ -153,6 +154,10 @@ SbiParser::SbiParser( StarBASIC* pb, SbModule* pm )
rTypeArray = new SbxArray; // Array fuer Benutzerdefinierte Typen
rEnumArray = new SbxArray; // Array for Enum types
+ bVBASupportOn = pm->IsVBACompat();
+ if ( bVBASupportOn )
+ EnableCompatibility();
+
}
@@ -751,6 +756,7 @@ void SbiParser::Option()
case CLASSMODULE:
bClassModule = TRUE;
+ aGen.GetModule().SetModuleType( com::sun::star::script::ModuleType::Class );
break;
case VBASUPPORT:
if( Next() == NUMBER )
@@ -760,6 +766,10 @@ void SbiParser::Option()
bVBASupportOn = ( nVal == 1 );
if ( bVBASupportOn )
EnableCompatibility();
+ // if the module setting is different
+ // reset it to what the Option tells us
+ if ( bVBASupportOn != aGen.GetModule().IsVBACompat() )
+ aGen.GetModule().SetVBACompat( bVBASupportOn );
break;
}
}