update ooo310-m15
[ooovba.git] / applied_patches / 0386-stringnumbercompare.diff
blob5b05478183647501492500cf6d147ff0178997d9
1 diff --git basic/source/sbx/sbxvalue.cxx basic/source/sbx/sbxvalue.cxx
2 index fb57038..dd5f9c1 100644
3 --- basic/source/sbx/sbxvalue.cxx
4 +++ basic/source/sbx/sbxvalue.cxx
5 @@ -1572,7 +1572,9 @@ BOOL SbxValue::Compare( SbxOperator eOp,
6 else
8 aL.eType = aR.eType = SbxDOUBLE;
9 - if( Get( aL ) && rOp.Get( aR ) )
10 + bool bGetL = Get( aL );
11 + bool bGetR = rOp.Get( aR );
12 + if( bGetL && bGetR )
13 switch( eOp )
15 case SbxEQ:
16 @@ -1590,6 +1592,18 @@ BOOL SbxValue::Compare( SbxOperator eOp,
17 default:
18 SetError( SbxERR_NOTIMP );
20 + // at least one value was got
21 + // if this is VBA then a conversion error for one
22 + // side will yield a false result of an equality test
23 + else if ( bGetR || bGetL )
24 + {
25 + if ( bVBAInterop && eOp == SbxEQ && GetError() == SbxERR_CONVERSION )
26 + {
27 + ResetError();
28 + bRes = FALSE;
29 + }
30 + }
34 if( eOld != SbxERR_OK )