ooo-build r14220 - in trunk: . patches/dev300 patches/vba



Author: noelpwer
Date: Mon Oct  6 16:30:58 2008
New Revision: 14220
URL: http://svn.gnome.org/viewvc/ooo-build?rev=14220&view=rev

Log:
2008-10-06  Noel Power   <noel power novell com>

        * patches/dev300/apply: add new patch
        * patches/vba/vba-null-not-treatment.diff: new patch to correct
        treatment of Null wrt various operators, specifically NOT & 
        comparison operators ">,>=,<,<=,=,<>"



Added:
   trunk/patches/vba/vba-null-not-treatment.diff
Modified:
   trunk/ChangeLog
   trunk/patches/dev300/apply

Modified: trunk/patches/dev300/apply
==============================================================================
--- trunk/patches/dev300/apply	(original)
+++ trunk/patches/dev300/apply	Mon Oct  6 16:30:58 2008
@@ -1690,7 +1690,9 @@
 vba-noregrex-for-match.diff
 # fix queryInterface problem
 vba-fix-n431657.diff, n#431657
-
+# fix treatment of NULL with
+# a) NOT operator b) comparison operators
+vba-null-not-treatment.diff
 [ VBAUntested ]
 SectionOwner => noelpwer
 vba-basic-null.diff i#85349, jjiao

Added: trunk/patches/vba/vba-null-not-treatment.diff
==============================================================================
--- (empty file)
+++ trunk/patches/vba/vba-null-not-treatment.diff	Mon Oct  6 16:30:58 2008
@@ -0,0 +1,72 @@
+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/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;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]