summaryrefslogtreecommitdiff
path: root/basic
diff options
context:
space:
mode:
authorAndreas Bregas <ab@openoffice.org>2010-07-06 15:59:41 +0200
committerAndreas Bregas <ab@openoffice.org>2010-07-06 15:59:41 +0200
commitdba973219b95c52db4fd632ab642628d36084bdd (patch)
treef7337479f9ff5de3f27bbe08038e5424f07ff0bb /basic
parentbb09a0aa845e46c538bd62d0c7d95a57e4d1a7d9 (diff)
mib17: #162898# Special handling for ByVal followed by StrPtr
Diffstat (limited to 'basic')
-rw-r--r--basic/source/comp/exprtree.cxx7
1 files changed, 6 insertions, 1 deletions
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();