diff options
Diffstat (limited to 'basic/source/sbx/sbxvalue.cxx')
-rw-r--r-- | basic/source/sbx/sbxvalue.cxx | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/basic/source/sbx/sbxvalue.cxx b/basic/source/sbx/sbxvalue.cxx index b0fa4ea1822f..ca21908ece78 100644 --- a/basic/source/sbx/sbxvalue.cxx +++ b/basic/source/sbx/sbxvalue.cxx @@ -1470,7 +1470,7 @@ BOOL SbxValue::Compare( SbxOperator eOp, const SbxValue& rOp ) const bRes = TRUE; } else if( GetType() == SbxEMPTY && rOp.GetType() == SbxEMPTY ) - bRes = TRUE; + bRes = !bVBAInterop ? TRUE : ( eOp == SbxEQ ? TRUE : FALSE ); // Sonderregel 1: Ist ein Operand Null, ist das Ergebnis FALSE else if( GetType() == SbxNULL || rOp.GetType() == SbxNULL ) bRes = FALSE; @@ -1572,7 +1572,10 @@ BOOL SbxValue::Compare( SbxOperator eOp, const SbxValue& rOp ) const else { aL.eType = aR.eType = SbxDOUBLE; - if( Get( aL ) && rOp.Get( aR ) ) + //if( Get( aL ) && rOp.Get( aR ) ) + bool bGetL = Get( aL );
+ bool bGetR = rOp.Get( aR );
+ if( bGetL && bGetR )
switch( eOp ) { case SbxEQ: @@ -1590,6 +1593,17 @@ BOOL SbxValue::Compare( SbxOperator eOp, const SbxValue& rOp ) const default: SetError( SbxERR_NOTIMP ); } + // at least one value was got
+ // if this is VBA then a conversion error for one
+ // side will yield a false result of an equality test
+ else if ( bGetR || bGetL )
+ {
+ if ( bVBAInterop && eOp == SbxEQ && GetError() == SbxERR_CONVERSION )
+ {
+ ResetError();
+ bRes = FALSE;
+ }
+ }
} } if( eOld != SbxERR_OK ) |