From dba973219b95c52db4fd632ab642628d36084bdd Mon Sep 17 00:00:00 2001 From: Andreas Bregas Date: Tue, 6 Jul 2010 15:59:41 +0200 Subject: [PATCH 1/3] mib17: #162898# Special handling for ByVal followed by StrPtr --- basic/source/comp/exprtree.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/basic/source/comp/exprtree.cxx b/basic/source/comp/exprtree.cxx index 0cf0d9870378..9b6f419e15ce 100644 --- a/basic/source/comp/exprtree.cxx +++ b/basic/source/comp/exprtree.cxx @@ -971,11 +971,16 @@ SbiParameters::SbiParameters( SbiParser* p, BOOL bStandaloneExpression, BOOL bPa else { bool bByVal = false; + bool bByValBlockLValueError = false; if( eTok == BYVAL ) { bByVal = true; pParser->Next(); eTok = pParser->Peek(); + + // Special handling for VBA function "StrPtr" that's accepted as lvalue + if( eTok == SYMBOL && pParser->GetSym().EqualsIgnoreCaseAscii( "StrPtr" ) ) + bByValBlockLValueError = true; } if( bAssumeExprLParenMode ) @@ -1011,7 +1016,7 @@ SbiParameters::SbiParameters( SbiParser* p, BOOL bStandaloneExpression, BOOL bPa if( bByVal ) { - if( !pExpr->IsLvalue() ) + if( !pExpr->IsLvalue() && !bByValBlockLValueError ) pParser->Error( SbERR_LVALUE_EXPECTED ); else pExpr->SetByVal(); From b8d18edc25262dcd77c160d2910ac77e2d683a18 Mon Sep 17 00:00:00 2001 From: Mikhail Voytenko Date: Wed, 7 Jul 2010 09:32:11 +0200 Subject: [PATCH 2/3] mib17: #162901# fix Remove --- vbahelper/source/msforms/vbacontrols.cxx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/vbahelper/source/msforms/vbacontrols.cxx b/vbahelper/source/msforms/vbacontrols.cxx index 1284b36be463..b7fad7d9372d 100644 --- a/vbahelper/source/msforms/vbacontrols.cxx +++ b/vbahelper/source/msforms/vbacontrols.cxx @@ -349,13 +349,16 @@ void SAL_CALL ScVbaControls::Remove( const uno::Any& StringKeyOrIndex ) } catch( uno::RuntimeException& ) { - throw; + // the exceptions are not rethrown, impossibility to find or remove the control is currently not reported + // since in most cases it means just that the controls is already not there, the VBA seems to do it in the same way + + // throw; } catch( uno::Exception& e ) { - throw lang::WrappedTargetException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Can not create AXControl!" ) ), - uno::Reference< uno::XInterface >(), - uno::makeAny( e ) ); + // throw lang::WrappedTargetException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Can not create AXControl!" ) ), + // uno::Reference< uno::XInterface >(), + // uno::makeAny( e ) ); } } From cbd90787ccc28ff36fb439ae3e012d28688b2ecd Mon Sep 17 00:00:00 2001 From: Andreas Bregas Date: Wed, 7 Jul 2010 14:58:53 +0200 Subject: [PATCH 3/3] mib17: #162916# No error if byval in calls isn't followed by lvalue --- basic/source/classes/disas.cxx | 2 ++ basic/source/comp/exprtree.cxx | 14 ++------------ basic/source/comp/sbcomp.cxx | 2 +- 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/basic/source/classes/disas.cxx b/basic/source/classes/disas.cxx index 7317005d74fe..87b4cad4e94b 100644 --- a/basic/source/classes/disas.cxx +++ b/basic/source/classes/disas.cxx @@ -153,6 +153,7 @@ static const char* pOp3[] = { "DCREATE_REDIMP", // Change dimensions of a user defined Object-Array (+StringId+StringId) "FIND_CM", // Search inside a class module (CM) to enable global search in time "PUBLIC_P", // Module global Variable (persisted between calls)(+StringID+Typ) + "FIND_STATIC", // local static var lookup (+StringID+Typ) }; static const char** pOps[3] = { pOp1, pOp2, pOp3 }; @@ -220,6 +221,7 @@ static const Func pOperand3[] = { &SbiDisas::Str2Op, // Redimensionate User defined Object-Array (+StringId+StringId) &SbiDisas::VarOp, // FIND_CM &SbiDisas::VarDefOp, // PUBLIC_P + &SbiDisas::VarOp, // FIND_STATIC }; // TODO: Why as method? Isn't a simple define sufficient? diff --git a/basic/source/comp/exprtree.cxx b/basic/source/comp/exprtree.cxx index 9b6f419e15ce..42969b98d0d8 100644 --- a/basic/source/comp/exprtree.cxx +++ b/basic/source/comp/exprtree.cxx @@ -971,16 +971,11 @@ SbiParameters::SbiParameters( SbiParser* p, BOOL bStandaloneExpression, BOOL bPa else { bool bByVal = false; - bool bByValBlockLValueError = false; if( eTok == BYVAL ) { bByVal = true; pParser->Next(); eTok = pParser->Peek(); - - // Special handling for VBA function "StrPtr" that's accepted as lvalue - if( eTok == SYMBOL && pParser->GetSym().EqualsIgnoreCaseAscii( "StrPtr" ) ) - bByValBlockLValueError = true; } if( bAssumeExprLParenMode ) @@ -1014,13 +1009,8 @@ SbiParameters::SbiParameters( SbiParser* p, BOOL bStandaloneExpression, BOOL bPa else pExpr = new SbiExpression( pParser ); - if( bByVal ) - { - if( !pExpr->IsLvalue() && !bByValBlockLValueError ) - pParser->Error( SbERR_LVALUE_EXPECTED ); - else - pExpr->SetByVal(); - } + if( bByVal && pExpr->IsLvalue() ) + pExpr->SetByVal(); //pExpr = bConst ? new SbiConstExpression( pParser ) // : new SbiExpression( pParser ); diff --git a/basic/source/comp/sbcomp.cxx b/basic/source/comp/sbcomp.cxx index 50dc6f847076..faabba046c99 100644 --- a/basic/source/comp/sbcomp.cxx +++ b/basic/source/comp/sbcomp.cxx @@ -67,7 +67,7 @@ void dbg_SaveDisassembly( SbModule* pModule ) ( OUString::createFromAscii( "com.sun.star.ucb.SimpleFileAccess" ) ), UNO_QUERY ); if( xSFI.is() ) { - String aFile( RTL_CONSTASCII_USTRINGPARAM("file:///d:/BasicAsm_") ); + String aFile( RTL_CONSTASCII_USTRINGPARAM("file:///d:/zBasic.Asm/Asm_") ); StarBASIC* pBasic = (StarBASIC*)pModule->GetParent(); if( pBasic ) {