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
commitf29b8403d34fa0487a7ef8a132d12ca5a5e0225a (patch)
treef5f08e61459efa3afa5119cb12a03a3203437b1c /basic
parent91d3f3dd69d3fc0a8f91d303e05c3040858a05d7 (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 604ac61745..ff5e9ce721 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();