summaryrefslogtreecommitdiff
path: root/patches/vba/vba-null-not-treatment.diff
diff options
context:
space:
mode:
Diffstat (limited to 'patches/vba/vba-null-not-treatment.diff')
-rw-r--r--patches/vba/vba-null-not-treatment.diff87
1 files changed, 0 insertions, 87 deletions
diff --git a/patches/vba/vba-null-not-treatment.diff b/patches/vba/vba-null-not-treatment.diff
deleted file mode 100644
index bd8c11adf..000000000
--- a/patches/vba/vba-null-not-treatment.diff
+++ /dev/null
@@ -1,87 +0,0 @@
-diff --git basic/source/runtime/step0.cxx basic/source/runtime/step0.cxx
-index 0666725..a2df718 100644
---- basic/source/runtime/step0.cxx
-+++ basic/source/runtime/step0.cxx
-@@ -118,8 +118,21 @@ void SbiRuntime::StepCompare( SbxOperato
- #ifndef WIN
- static SbxVariable* pTRUE = NULL;
- static SbxVariable* pFALSE = NULL;
--
-- if( p2->Compare( eOp, *p1 ) )
-+ static SbxVariable* pNULL = NULL;
-+ // why do this on non-windows ?
-+ // why do this at all ?
-+ // I dumbly follow the pattern :-/
-+ if ( bVBAEnabled && ( p1->IsNull() || p2->IsNull() ) )
-+ {
-+ if( !pNULL )
-+ {
-+ pNULL = new SbxVariable;
-+ pNULL->PutNull();
-+ pNULL->AddRef();
-+ }
-+ PushVar( pNULL );
-+ }
-+ else if( p2->Compare( eOp, *p1 ) )
- {
- if( !pTRUE )
- {
-@@ -140,9 +153,14 @@ void SbiRuntime::StepCompare( SbxOperato
- PushVar( pFALSE );
- }
- #else
-- BOOL bRes = p2->Compare( eOp, *p1 );
- SbxVariable* pRes = new SbxVariable;
-- pRes->PutBool( bRes );
-+ if ( bVBAEnabled && ( p1->IsNull() || p2->IsNull() ) )
-+ pRes->PutNull();
-+ else
-+ {
-+ BOOL bRes = p2->Compare( eOp, *p1 );
-+ pRes->PutBool( bRes );
-+ }
- PushVar( pRes );
- #endif
- }
-diff --git basic/source/runtime/step1.cxx basic/source/runtime/step1.cxx
-index 8a4adfa..57d7f02 100644
---- basic/source/runtime/step1.cxx
-+++ basic/source/runtime/step1.cxx
-@@ -192,7 +192,9 @@ void SbiRuntime::StepJUMPT( UINT32 nOp1 )
- void SbiRuntime::StepJUMPF( UINT32 nOp1 )
- {
- SbxVariableRef p = PopVar();
-- if( !p->GetBool() )
-+ // In a test e.g. If Null then
-+ // will evaluate Null will act as if False
-+ if( ( bVBAEnabled && p->IsNull() ) || !p->GetBool() )
- StepJUMP( nOp1 );
- }
-
-diff --git basic/source/sbx/sbxvalue.cxx basic/source/sbx/sbxvalue.cxx
-index 37e9523..5447439 100644
---- basic/source/sbx/sbxvalue.cxx
-+++ basic/source/sbx/sbxvalue.cxx
-@@ -1195,6 +1195,8 @@ BOOL SbxValue::Compute( SbxOperator eOp,
- aL.eType = aR.eType = GetType();
- // else if( GetType() == SbxDouble || GetType() == SbxSingle )
- // aL.eType = aR.eType = SbxLONG64;
-+ else if ( bVBAInterop && eOpType == SbxBOOL )
-+ aL.eType = aR.eType = SbxBOOL;
- else
- aL.eType = aR.eType = SbxLONG;
- }
-@@ -1281,7 +1283,12 @@ BOOL SbxValue::Compute( SbxOperator eOp,
- break;
- case SbxNOT:
- if( aL.eType != SbxLONG && aL.eType != SbxULONG )
-- aL.nLong64 = ~aL.nLong64;
-+ {
-+ if ( aL.eType != SbxBOOL )
-+ aL.nLong64 = ~aL.nLong64;
-+ else
-+ aL.nLong = ~aL.nLong;
-+ }
- else
- aL.nLong = ~aL.nLong;
- break;