[ooo-build-commit] .: patches/dev300 patches/vba

Noel Power noelp at kemper.freedesktop.org
Mon Apr 26 02:25:59 PDT 2010


 patches/dev300/apply                                 |    4 
 patches/dev300/control-visibility-in-designmode.diff |   30 -
 patches/dev300/cws-pflin10.diff                      |  455 -------------------
 patches/vba/n353260-datevalue.diff                   |  170 -------
 patches/vba/userform-filter-dialog-vba.diff          |  164 ------
 patches/vba/vba-combobox-data-rowsource-fix.diff     |   13 
 patches/vba/vba-window-api-fix.diff                  |   19 
 patches/vba/vba-worksheetfunctions-fix.diff          |  122 -----
 8 files changed, 4 insertions(+), 973 deletions(-)

New commits:
commit bacd6f7226a17f56edf12e0ec78df5c356791159
Author: Noel Power <noel.power at novell.com>
Date:   Mon Apr 26 10:25:41 2010 +0100

    remove some orphaned patches ( keep other by  moving them to VBAUnused )
    
    * patches/dev300/apply:
    * patches/dev300/control-visibility-in-designmode.diff:
    * patches/dev300/cws-pflin10.diff:
    * patches/vba/n353260-datevalue.diff:
    * patches/vba/userform-filter-dialog-vba.diff:
    * patches/vba/vba-combobox-data-rowsource-fix.diff:
    * patches/vba/vba-window-api-fix.diff:
    * patches/vba/vba-worksheetfunctions-fix.diff:

diff --git a/patches/dev300/apply b/patches/dev300/apply
index fbee6d5..2afec52 100644
--- a/patches/dev300/apply
+++ b/patches/dev300/apply
@@ -1766,6 +1766,10 @@ vba-fixerror-nonvba.diff, n#597884
 vba-tweak-errorobj.diff
 [ VBAUntested ]
 SectionOwner => noelpwer
+# KEEP - unfinished autotext stuff 
+vba-transient-imported-autotext.diff  
+# not sure if this is useful, keep for reference
+save-doc-withembedded-doc-with-vba-crash.diff 
 # doesn't work
 vba-basic-null.diff i#85349, jjiao
 vba-support-stoc-typeprovider-xexactname.diff, #no-upstream
diff --git a/patches/dev300/control-visibility-in-designmode.diff b/patches/dev300/control-visibility-in-designmode.diff
deleted file mode 100644
index 851a36e..0000000
--- a/patches/dev300/control-visibility-in-designmode.diff
+++ /dev/null
@@ -1,30 +0,0 @@
-diff --git toolkit/source/awt/vclxwindow.cxx toolkit/source/awt/vclxwindow.cxx
-index b37ed90..d888bd1 100644
---- toolkit/source/awt/vclxwindow.cxx
-+++ toolkit/source/awt/vclxwindow.cxx
-@@ -2448,7 +2448,7 @@ void VCLXWindow::draw( sal_Int32 nX, sal_Int32 nY ) throw(::com::sun::star::uno:
-     if ( !pWindow )
-         return;
-     
--	if ( mpImpl->isEnableVisible() )
-+	if ( isDesignMode() || mpImpl->isEnableVisible() )
- 	{
- 		TabPage* pTabPage = dynamic_cast< TabPage* >( pWindow );
-         if ( pTabPage )
-diff --git toolkit/source/controls/unocontrol.cxx toolkit/source/controls/unocontrol.cxx
-index 480cb85..0bb5fba 100644
---- toolkit/source/controls/unocontrol.cxx
-+++ toolkit/source/controls/unocontrol.cxx
-@@ -1054,7 +1054,12 @@ void UnoControl::draw( sal_Int32 x, sal_Int32 y ) throw(RuntimeException)
-     }
- 
-     if ( xDrawPeerView.is() )
-+    {
-+	Reference< XVclWindowPeer > xWindowPeer;
-+	xWindowPeer.set( xDrawPeer, UNO_QUERY ); 
-+	xWindowPeer->setDesignMode( mbDesignMode );
-         xDrawPeerView->draw( x, y );
-+    }
- 
-     if ( bDisposeDrawPeer )
-         xDrawPeer->dispose();
diff --git a/patches/dev300/cws-pflin10.diff b/patches/dev300/cws-pflin10.diff
deleted file mode 100644
index 5ab507d..0000000
--- a/patches/dev300/cws-pflin10.diff
+++ /dev/null
@@ -1,455 +0,0 @@
-Index: basic/inc/basic/sberrors.hxx
-===================================================================
-RCS file: /cvs/script/basic/inc/basic/sberrors.hxx,v
-retrieving revision 1.3
-retrieving revision 1.2.100.2
-diff -u -p -b -w -B -r1.3 -r1.2.100.2
---- basic/inc/basic/sberrors.hxx	11 Apr 2008 11:21:47 -0000	1.3
-+++ basic/inc/basic/sberrors.hxx	19 May 2008 04:10:40 -0000	1.2.100.2
-@@ -277,6 +277,19 @@ typedef ULONG SbError;
- #define	ERRCODE_BASMGR_REMOVELIB			(LAST_SBX_ERROR_ID+101UL) | ERRCODE_AREA_SBX
- #define	ERRCODE_BASMGR_UNLOADLIB			(LAST_SBX_ERROR_ID+102UL) | ERRCODE_AREA_SBX
- 
-+#define	ERRCODE_BASIC_ARRAY_FIX				((LAST_SBX_ERROR_ID+104UL) | ERRCODE_AREA_SBX | \
-+											ERRCODE_CLASS_COMPILER)				// This array is fixed
-+#define	ERRCODE_BASIC_STRING_OVERFLOW		((LAST_SBX_ERROR_ID+105UL) | ERRCODE_AREA_SBX | \
-+											ERRCODE_CLASS_COMPILER)				// Out of string space
-+#define	ERRCODE_BASIC_EXPR_TOO_COMPLEX		((LAST_SBX_ERROR_ID+106UL) | ERRCODE_AREA_SBX | \
-+											ERRCODE_CLASS_COMPILER)				// Expression too complex
-+#define	ERRCODE_BASIC_OPER_NOT_PERFORM		((LAST_SBX_ERROR_ID+107UL) | ERRCODE_AREA_SBX | \
-+											ERRCODE_CLASS_COMPILER)				// Can't perform requested operation
-+#define	ERRCODE_BASIC_TOO_MANY_DLL			((LAST_SBX_ERROR_ID+108UL) | ERRCODE_AREA_SBX | \
-+											ERRCODE_CLASS_COMPILER)				// Too many dll application clients
-+#define	ERRCODE_BASIC_LOOP_NOT_INIT			((LAST_SBX_ERROR_ID+109UL) | ERRCODE_AREA_SBX | \
-+											ERRCODE_CLASS_COMPILER)				// For loop not initialized
-+
- // Alte Codes auf neue mappen
- #define	SbERR_SYNTAX						ERRCODE_BASIC_SYNTAX
- #define	SbERR_NO_GOSUB						ERRCODE_BASIC_NO_GOSUB
-@@ -400,6 +413,12 @@ typedef ULONG SbError;
- #define	SbERR_PROG_TOO_LARGE                ERRCODE_BASIC_PROG_TOO_LARGE
- #define	SbERR_NO_STRINGS_ARRAYS             ERRCODE_BASIC_NO_STRINGS_ARRAYS
- #define	SbERR_BASIC_EXCEPTION               ERRCODE_BASIC_EXCEPTION
-+#define	SbERR_BASIC_ARRAY_FIX				ERRCODE_BASIC_ARRAY_FIX
-+#define	SbERR_BASIC_STRING_OVERFLOW			ERRCODE_BASIC_STRING_OVERFLOW
-+#define	SbERR_BASIC_EXPR_TOO_COMPLEX		ERRCODE_BASIC_EXPR_TOO_COMPLEX
-+#define	SbERR_BASIC_OPER_NOT_PERFORM		ERRCODE_BASIC_OPER_NOT_PERFORM
-+#define	SbERR_BASIC_TOO_MANY_DLL			ERRCODE_BASIC_TOO_MANY_DLL
-+#define	SbERR_BASIC_LOOP_NOT_INIT			ERRCODE_BASIC_LOOP_NOT_INIT
- // #define	SbERR_COMPILER_END					ERRCODE_BASIC_COMPILER_END
- 
- /* ALT
-Index: basic/source/classes/sb.cxx
-===================================================================
-RCS file: /cvs/script/basic/source/classes/sb.cxx,v
-retrieving revision 1.34
-retrieving revision 1.33.62.2
-diff -u -p -b -w -B -r1.34 -r1.33.62.2
---- basic/source/classes/sb.cxx	11 Apr 2008 11:46:56 -0000	1.34
-+++ basic/source/classes/sb.cxx	19 May 2008 04:11:07 -0000	1.33.62.2
-@@ -1120,6 +1120,27 @@ USHORT StarBASIC::GetVBErrorCode( SbErro
- {
- 	USHORT nRet = 0;
- 
-+	if( SbiRuntime::isVBAEnabled() )
-+	{
-+		switch( nError )
-+		{
-+			case SbERR_BASIC_ARRAY_FIX:
-+				return 10;
-+			case SbERR_BASIC_STRING_OVERFLOW:
-+				return 14;
-+			case SbERR_BASIC_EXPR_TOO_COMPLEX:
-+				return 16;
-+			case SbERR_BASIC_OPER_NOT_PERFORM:
-+				return 17;
-+			case SbERR_BASIC_TOO_MANY_DLL:
-+				return 47;
-+			case SbERR_BASIC_LOOP_NOT_INIT:
-+				return 92;
-+			default:
-+				nRet = 0;
-+		}
-+	}
-+	
- 	// Suchschleife
- 	const SFX_VB_ErrorItem* pErrItem;
- 	USHORT nIndex = 0;
-@@ -1141,7 +1162,33 @@ SbError	StarBASIC::GetSfxFromVBError( US
- {
- 	SbError nRet = 0L;
- 
--	// Suchschleife
-+	if( SbiRuntime::isVBAEnabled() )
-+	{
-+		switch( nError )
-+		{
-+			case 1:
-+			case 2:
-+			case 4:
-+			case 8:
-+			case 12:
-+			case 73:
-+				return 0L;
-+			case 10:
-+				return SbERR_BASIC_ARRAY_FIX;
-+			case 14:
-+				return SbERR_BASIC_STRING_OVERFLOW;
-+			case 16:
-+				return SbERR_BASIC_EXPR_TOO_COMPLEX;
-+			case 17:
-+				return SbERR_BASIC_OPER_NOT_PERFORM;
-+			case 47:
-+				return SbERR_BASIC_TOO_MANY_DLL;
-+			case 92:
-+				return SbERR_BASIC_LOOP_NOT_INIT;
-+			default:
-+				nRet = 0L;
-+		}
-+	}
- 	const SFX_VB_ErrorItem* pErrItem;
- 	USHORT nIndex = 0;
- 	do
-Index: basic/source/classes/sb.src
-===================================================================
-RCS file: /cvs/script/basic/source/classes/sb.src,v
-retrieving revision 1.48
-retrieving revision 1.47.86.2
-diff -u -p -b -w -B -r1.48 -r1.47.86.2
---- basic/source/classes/sb.src	11 Apr 2008 11:47:22 -0000	1.48
-+++ basic/source/classes/sb.src	19 May 2008 04:11:02 -0000	1.47.86.2
-@@ -567,6 +567,30 @@ Resource RID_BASIC_START
- 	{
- 		Text [ en-US ] = "An exception occurred $(ARG1)." ;
- 	};
-+	String ERRCODE_BASIC_ARRAY_FIX & ERRCODE_RES_MASK
-+	{
-+		Text [ en-US ] = "This array is fixed or temporarily locked." ;
-+	};
-+	String ERRCODE_BASIC_STRING_OVERFLOW & ERRCODE_RES_MASK
-+	{
-+		Text [ en-US ] = "Out of string space." ;
-+	};
-+	String ERRCODE_BASIC_EXPR_TOO_COMPLEX & ERRCODE_RES_MASK
-+	{
-+		Text [ en-US ] = "Expression Too Complex." ;
-+	};
-+	String ERRCODE_BASIC_OPER_NOT_PERFORM & ERRCODE_RES_MASK
-+	{
-+		Text [ en-US ] = "Can't perform requested operation." ;
-+	};
-+	String ERRCODE_BASIC_TOO_MANY_DLL & ERRCODE_RES_MASK
-+	{
-+		Text [ en-US ] = "Too many DLL application clients." ;
-+	};
-+	String ERRCODE_BASIC_LOOP_NOT_INIT & ERRCODE_RES_MASK
-+	{
-+		Text [ en-US ] = "For loop not initialized." ;
-+	};
- };
-  // Hinweis: IDS_SBERR_TERMINATED = IDS_SBERR_START+2000.
- String IDS_SBERR_TERMINATED
-cvs diff: Diffing basic/source/comp
-Index: basic/source/comp/exprtree.cxx
-===================================================================
-RCS file: /cvs/script/basic/source/comp/exprtree.cxx,v
-retrieving revision 1.24
-retrieving revision 1.24.36.1
-diff -u -p -b -w -B -r1.24 -r1.24.36.1
---- basic/source/comp/exprtree.cxx	2 Jul 2008 09:58:29 -0000	1.24
-+++ basic/source/comp/exprtree.cxx	1 Sep 2008 09:35:37 -0000	1.24.36.1
-@@ -117,7 +117,7 @@ static BOOL DoParametersFollow( SbiParse
- 	if( !p->WhiteSpace() || eCurExpr != SbSYMBOL )
- 		return FALSE;
- 	if (   eTok == NUMBER || eTok == MINUS || eTok == FIXSTRING
--		|| eTok == SYMBOL || eTok == COMMA  || eTok == DOT )
-+		|| eTok == SYMBOL || eTok == COMMA  || eTok == DOT || eTok == NOT )
- 	{
- 		return TRUE;
- 	}
-@@ -495,6 +495,14 @@ SbiExprNode* SbiExpression::Operand()
- 	switch( eTok = pParser->Peek() )
- 	{
- 		case SYMBOL:
-+			pRes = Term();
-+			// process something like "IF Not r Is Nothing Then .."
-+			if( pParser->IsVBASupportOn() && pParser->Peek() == IS )
-+			{
-+				eTok = pParser->Next();
-+				pRes = new SbiExprNode( pParser, pRes, eTok, Like() );
-+			}
-+			break;
- 		case DOT:	// .with
- 			pRes = Term(); break;
- 		case NUMBER:
-Index: basic/source/runtime/methods.cxx
-===================================================================
-RCS file: /cvs/script/basic/source/runtime/methods.cxx,v
-retrieving revision 1.82
-retrieving revision 1.78.20.6
-diff -u -p -b -w -B -r1.82 -r1.78.20.6
---- basic/source/runtime/methods.cxx	3 Jul 2008 10:04:35 -0000	1.82
-+++ basic/source/runtime/methods.cxx	11 Sep 2008 07:26:03 -0000	1.78.20.6
-@@ -1378,9 +1378,15 @@ RTLFUNC(Replace)
- 		if ( nArgCount == 6 )
- 			bTextMode = rPar.Get(6)->GetInteger();
- 
--		USHORT nStrLen = aExpStr.Len();
-+		USHORT nExpStrLen = aExpStr.Len();
-+		USHORT nFindStrLen = aFindStr.Len();
-+		USHORT nReplaceStrLen = aReplaceStr.Len();
- 
--		if( lStartPos <= nStrLen )
-+		if( lStartPos <= nExpStrLen )
-+		{
-+			USHORT nPos = static_cast<USHORT>( lStartPos - 1 );
-+			USHORT nCounts = 0;
-+			while( lCount == -1 || lCount > nCounts )
- 		{
- 			String aSrcStr( aExpStr );
- 			if( bTextMode )
-@@ -1388,17 +1394,18 @@ RTLFUNC(Replace)
- 					aSrcStr.ToUpperAscii();
- 					aFindStr.ToUpperAscii();
- 			}
--			
--			USHORT nPos = aSrcStr.Search( aFindStr, static_cast<USHORT>( lStartPos - 1 ) );
--			USHORT nCounts = 0;
--			USHORT nReplaceLength = aReplaceStr.Len() ? aReplaceStr.Len():1;
--			while( nPos != STRING_NOTFOUND && (lCount == -1 || lCount > nCounts) )
--			{
--				aExpStr.Replace( nPos, aFindStr.Len(), aReplaceStr );
--				nPos = nPos + nReplaceLength;
- 				nPos = aSrcStr.Search( aFindStr, nPos );
-+				if( nPos != STRING_NOTFOUND )
-+				{
-+					aExpStr.Replace( nPos, nFindStrLen, aReplaceStr );
-+					nPos = nPos - nFindStrLen + nReplaceStrLen + 1;
- 				nCounts++;
- 			}
-+				else
-+				{
-+					break;
-+				}
-+			}
- 		}
- 		rPar.Get(0)->PutString( aExpStr.Copy( static_cast<USHORT>(lStartPos - 1) )  );
- 	}
-@@ -1779,17 +1786,52 @@ INT16 implGetDateYear( double aDate )
- 
- BOOL implDateSerial( INT16 nYear, INT16 nMonth, INT16 nDay, double& rdRet )
- {
-+	if ( nYear < 30 )
-+		nYear += 2000;
- 	if ( nYear < 100 )
- 		nYear += 1900;
--	if ((nYear < 100 || nYear > 9999)   ||
--		(nMonth < 1 || nMonth > 12 )	||
-+	Date aCurDate( nDay, nMonth, nYear );
-+	if ((nYear < 100 || nYear > 9999) )  
-+	{
-+		StarBASIC::Error( SbERR_BAD_ARGUMENT );
-+		return FALSE;
-+	}
-+	if ( !SbiRuntime::isVBAEnabled() )
-+	{
-+		if ( (nMonth < 1 || nMonth > 12 )||
- 		(nDay < 1 || nDay > 31 ))
- 	{
- 		StarBASIC::Error( SbERR_BAD_ARGUMENT );
- 		return FALSE;
- 	}
-+	}
-+	else
-+	{
-+		// grab the year & month
-+		aCurDate = Date( 1, (( nMonth % 12 ) > 0 ) ? ( nMonth % 12 ) : 12 + ( nMonth % 12 ), nYear );
-+	
-+		// adjust year based on month value
-+		// e.g. 2000, 0, xx = 1999, 12, xx ( or December of the previous year )
-+		//		2000, 13, xx = 2001, 1, xx ( or January of the following year )
-+		if( ( nMonth < 1 ) || ( nMonth > 12 ) )
-+		{
-+			// inacurrate around leap year, don't use days to calculate,
-+			// just modify the months directory
-+			INT16 nYearAdj = ( nMonth /12 ); // default to positive months inputed
-+			if ( nMonth <=0 )
-+				nYearAdj = ( ( nMonth -12 ) / 12 );
-+			aCurDate.SetYear( aCurDate.GetYear() + nYearAdj );
-+		}
-+
-+		// adjust day value,
-+		// e.g. 2000, 2, 0 = 2000, 1, 31 or the last day of the previous month
-+		//		2000, 1, 32 = 2000, 2, 1 or the first day of the following month
-+		if( ( nDay < 1 ) || ( nDay > aCurDate.GetDaysInMonth() ) )
-+			aCurDate += nDay - 1;
-+		else
-+			aCurDate.SetDay( nDay );
-+	}	
- 
--	Date aCurDate( nDay, nMonth, nYear );
- 	long nDiffDays = GetDayDiff( aCurDate );
-     rdRet = (double)nDiffDays;
-     return TRUE;
-@@ -1916,6 +1958,22 @@ RTLFUNC(DateValue)
- 		String aStr( rPar.Get(1)->GetString() );
- 		BOOL bSuccess = pFormatter->IsNumberFormat( aStr, nIndex, fResult );
- 		short nType = pFormatter->GetType( nIndex );
-+		
-+		// DateValue("February 12, 1969") raises error if the system locale is not en_US
-+		// by using SbiInstance::GetNumberFormatter.
-+		// It seems that both locale number formatter and English number formatter 
-+		// are supported in Visual Basic.
-+		LanguageType eLangType = GetpApp()->GetSettings().GetLanguage();
-+        if( !bSuccess && ( eLangType != LANGUAGE_ENGLISH_US ) )
-+		{
-+			// Create a new SvNumberFormatter by using LANGUAGE_ENGLISH to get the date value;
-+			com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > 
-+				xFactory = comphelper::getProcessServiceFactory();
-+			SvNumberFormatter aFormatter( xFactory, LANGUAGE_ENGLISH_US );
-+			bSuccess = aFormatter.IsNumberFormat( aStr, nIndex, fResult );
-+			nType = aFormatter.GetType( nIndex );
-+		}
-+
- 		if(bSuccess && (nType==NUMBERFORMAT_DATE || nType==NUMBERFORMAT_DATETIME))
- 		{
- 			if ( nType == NUMBERFORMAT_DATETIME )
-Index: basic/source/sbx/sbxdbl.cxx
-===================================================================
-RCS file: /cvs/script/basic/source/sbx/sbxdbl.cxx,v
-retrieving revision 1.8
-retrieving revision 1.7.46.2
-diff -u -p -b -w -B -r1.8 -r1.7.46.2
---- basic/source/sbx/sbxdbl.cxx	11 Apr 2008 12:12:50 -0000	1.8
-+++ basic/source/sbx/sbxdbl.cxx	19 May 2008 04:10:51 -0000	1.7.46.2
-@@ -33,6 +33,7 @@
- #include <tools/errcode.hxx>
- #include <basic/sbx.hxx>
- #include "sbxconv.hxx"
-+#include "runtime.hxx"
- 
- double ImpGetDouble( const SbxValues* p )
- {
-@@ -79,13 +80,21 @@ double ImpGetDouble( const SbxValues* p 
- 		case SbxSTRING:
- 		case SbxLPSTR:
- 			if( !p->pString )
-+			{	
- 				nRes = 0;
-+				if ( SbiRuntime::isVBAEnabled() )// VBA only behaviour
-+					SbxBase::SetError( SbxERR_CONVERSION );
-+			}		
- 			else
- 			{
- 				double d;
- 				SbxDataType t;
- 				if( ImpScan( *p->pString, d, t, NULL ) != SbxERR_OK )
-+				{
- 					nRes = 0;
-+					if ( SbiRuntime::isVBAEnabled() )// VBA only behaviour
-+						SbxBase::SetError( SbxERR_CONVERSION );
-+				}
- 				else
- 					nRes = d;
- 			}
-Index: basic/source/sbx/sbxscan.cxx
-===================================================================
-RCS file: /cvs/script/basic/source/sbx/sbxscan.cxx,v
-retrieving revision 1.14
-retrieving revision 1.12.22.3
-diff -u -p -b -w -B -r1.14 -r1.12.22.3
---- basic/source/sbx/sbxscan.cxx	2 Jul 2008 10:04:30 -0000	1.14
-+++ basic/source/sbx/sbxscan.cxx	28 Aug 2008 06:20:42 -0000	1.12.22.3
-@@ -53,6 +53,7 @@
- #include <svtools/svtools.hrc>
- 
- #include "basrid.hxx"
-+#include "runtime.hxx"
- 
- #include <svtools/zforlist.hxx>
- #include <comphelper/processfactory.hxx>
-@@ -231,6 +232,11 @@ SbxError ImpScan( const XubString& rWSrc
- 		if( l >= SbxMININT && l <= SbxMAXINT )
- 			eScanType = SbxINTEGER;
- 	}
-+	else if ( SbiRuntime::isVBAEnabled() )
-+	{
-+		OSL_TRACE("Reporting error converting");
-+		return SbxERR_CONVERSION;
-+	}
- 	if( pLen )
- 		*pLen = (USHORT) ( p - pStart );
- 	if( !bRes )
-Index: basic/source/sbx/sbxvalue.cxx
-===================================================================
-RCS file: /cvs/script/basic/source/sbx/sbxvalue.cxx,v
-retrieving revision 1.14
-retrieving revision 1.11.24.3
-diff -u -p -b -w -B -r1.14 -r1.11.24.3
---- basic/source/sbx/sbxvalue.cxx	15 Aug 2008 14:16:13 -0000	1.14
-+++ basic/source/sbx/sbxvalue.cxx	28 Aug 2008 06:20:38 -0000	1.11.24.3
-@@ -1147,7 +1147,13 @@ BOOL SbxValue::Compute( SbxOperator eOp,
- 	{
- 		SbxValues aL, aR;
- 		bool bDecimal = false;
--		if( eThisType == SbxSTRING || eOp == SbxCAT || ( bVBAInterop && ( eOpType == SbxSTRING ) && (  eOp == SbxPLUS ) ) )
-+		if( bVBAInterop && ( ( eThisType == SbxSTRING && eOpType != SbxSTRING ) || 
-+			 ( eThisType != SbxSTRING && eOpType == SbxSTRING ) ) &&
-+			 ( eOp == SbxMUL || eOp == SbxDIV || eOp == SbxPLUS || eOp == SbxMINUS ) )
-+		{
-+			goto Lbl_OpIsDouble;
-+		}
-+		else if( eThisType == SbxSTRING || eOp == SbxCAT || ( bVBAInterop && ( eOpType == SbxSTRING ) && (  eOp == SbxPLUS ) ) )
- 		{
- 			if( eOp == SbxCAT || eOp == SbxPLUS )
- 			{
-@@ -1392,6 +1398,7 @@ BOOL SbxValue::Compute( SbxOperator eOp,
- 			}
- 		}
- 		else
-+Lbl_OpIsDouble:			
- 		{	// Andere Operatoren
- 			aL.eType = aR.eType = SbxDOUBLE;
- 			if( rOp.Get( aR ) )
-Index: sc/source/ui/vba/vbarange.cxx
-===================================================================
-RCS file: /cvs/sc/sc/source/ui/vba/vbarange.cxx,v
-retrieving revision 1.9
-retrieving revision 1.7.18.3
-diff -u -p -b -w -B -r1.9 -r1.7.18.3
---- sc/source/ui/vba/vbarange.cxx	14 May 2008 10:03:31 -0000	1.9
-+++ sc/source/ui/vba/vbarange.cxx	28 Aug 2008 06:21:15 -0000	1.7.18.3
-@@ -163,6 +163,7 @@
- // end test includes
- 
- #include <org/openoffice/excel/Range.hpp>
-+#include <com/sun/star/bridge/oleautomation/Date.hpp>
- 
- using namespace ::org::openoffice;
- using namespace ::com::sun::star;
-@@ -443,6 +444,16 @@ public:
- 		return false;
- 	}
- 
-+	bool isDateType()
-+	{
-+		sal_Int16 nType = getNumberFormat();
-+		if(( nType & util::NumberFormat::DATETIME ))
-+		{
-+			return true;
-+		}
-+		return false;
-+	}
-+	
- 	rtl::OUString getNumberFormatString()
- 	{
- 		uno::Reference< uno::XInterface > xIf( mxRangeProps, uno::UNO_QUERY_THROW );
-@@ -716,6 +727,8 @@ void CellValueGetter::visitNode( sal_Int
- 			NumFormatHelper cellFormat( xRange );
- 			if ( cellFormat.isBooleanType() )
- 				aValue = uno::makeAny( ( xCell->getValue() != 0.0 ) );
-+			else if ( cellFormat.isDateType() )
-+				aValue = uno::makeAny( bridge::oleautomation::Date( xCell->getValue() ) );
- 			else
- 				aValue <<= xCell->getValue();
- 		}
diff --git a/patches/vba/n353260-datevalue.diff b/patches/vba/n353260-datevalue.diff
deleted file mode 100644
index 1d6924f..0000000
--- a/patches/vba/n353260-datevalue.diff
+++ /dev/null
@@ -1,170 +0,0 @@
---- /dev/null	2007-05-04 18:54:36.000000000 +0800
-+++ udkapi/com/sun/star/script/DateType.idl	2008-01-24 22:05:46.000000000 +0800
-@@ -0,0 +1,63 @@
-+/*************************************************************************
-+ *
-+ *  OpenOffice.org - a multi-platform office productivity suite
-+ *
-+ *  $RCSfile: DateType.idl,v $
-+ *
-+ *  $Revision: 1.0 $
-+ *
-+ *  last change: $Author: rt $ $Date: 2006/05/05 10:14:46 $
-+ *
-+ *  The Contents of this file are made available subject to
-+ *  the terms of GNU Lesser General Public License Version 2.1.
-+ *
-+ *
-+ *    GNU Lesser General Public License Version 2.1
-+ *    =============================================
-+ *    Copyright 2005 by Sun Microsystems, Inc.
-+ *    901 San Antonio Road, Palo Alto, CA 94303, USA
-+ *
-+ *    This library is free software; you can redistribute it and/or
-+ *    modify it under the terms of the GNU Lesser General Public
-+ *    License version 2.1, as published by the Free Software Foundation.
-+ *
-+ *    This library is distributed in the hope that it will be useful,
-+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+ *    Lesser General Public License for more details.
-+ *
-+ *    You should have received a copy of the GNU Lesser General Public
-+ *    License along with this library; if not, write to the Free Software
-+ *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
-+ *    MA  02111-1307  USA
-+ *
-+ ************************************************************************/
-+
-+#ifndef __com_sun_star_script_XDateType_idl__
-+#define __com_sun_star_script_XDateType_idl__
-+
-+#ifndef __com_sun_star_uno_XInterface_idl__
-+#include <com/sun/star/uno/XInterface.idl>
-+#endif
-+
-+//=============================================================================
-+module com {  module sun {  module star { module script {
-+
-+//=============================================================================
-+/** A date type for script 
-+*/
-+
-+struct DateType
-+{
-+    /** the value of date. 
-+    */
-+	double Value; 
-+};
-+
-+//=============================================================================
-+
-+}; }; }; };
-+
-+#endif
-+
-+
---- udkapi/com/sun/star/script/makefile.mk.orig	2008-01-25 11:35:24.000000000 +0800
-+++ udkapi/com/sun/star/script/makefile.mk	2008-01-24 21:38:10.000000000 +0800
-@@ -89,6 +89,7 @@ IDLFILES=\
- 	XScriptEventsAttacher.idl\
- 	XDefaultMethod.idl\
- 	XDefaultProperty.idl\
-+	DateType.idl\
- 
- # ------------------------------------------------------------------
- 
---- sc/source/ui/vba/vbarange.cxx.orig	2008-01-24 21:40:42.000000000 +0800
-+++ sc/source/ui/vba/vbarange.cxx	2008-01-24 21:52:45.000000000 +0800
-@@ -167,6 +167,7 @@
- // end test includes
- 
- #include <org/openoffice/excel/Range.hpp>
-+#include <com/sun/star/script/DateType.hpp>
- 
- using namespace ::org::openoffice;
- using namespace ::com::sun::star;
-@@ -447,6 +448,18 @@ public:
- 		return false;
- 	}
- 
-+	bool isDateType()
-+	{
-+		sal_Int16 nType = getNumberFormat();
-+		if(( nType & util::NumberFormat::DATE )
-+			|| ( nType & util::NumberFormat::TIME )
-+			|| ( nType & util::NumberFormat::DATETIME ))
-+		{
-+			return true;
-+		}
-+		return false;
-+	}
-+	
- 	rtl::OUString getNumberFormatString()
- 	{
- 		uno::Reference< uno::XInterface > xIf( mxRangeProps, uno::UNO_QUERY_THROW );
-@@ -720,6 +733,8 @@ void CellValueGetter::visitNode( sal_Int
- 			NumFormatHelper cellFormat( xRange );
- 			if ( cellFormat.isBooleanType() )
- 				aValue = uno::makeAny( ( xCell->getValue() != 0.0 ) );
-+			else if ( cellFormat.isDateType() )
-+				aValue = uno::makeAny( script::DateType( xCell->getValue() ) );
- 			else
- 				aValue <<= xCell->getValue();
- 		}
---- basic/source/classes/sbunoobj.cxx.orig	2008-01-24 21:40:12.000000000 +0800
-+++ basic/source/classes/sbunoobj.cxx	2008-01-24 22:19:29.000000000 +0800
-@@ -114,6 +114,7 @@ using namespace rtl;
- #include <hash_map>
- #include <com/sun/star/reflection/XTypeDescriptionEnumerationAccess.hpp>
- #include <com/sun/star/reflection/XConstantsTypeDescription.hpp>
-+#include <com/sun/star/script/DateType.hpp>
- 
- TYPEINIT1(SbUnoMethod,SbxMethod)
- TYPEINIT1(SbUnoProperty,SbxProperty)
-@@ -647,6 +648,7 @@ void unoToSbxValue( SbxVariable* pVar, c
- 			if( eTypeClass == TypeClass_STRUCT )
- 			{
- 				ArrayWrapper aWrap;
-+				DateType aUnoDate;
- 				if ( (aValue >>= aWrap) )
- 				{
- 					SbxDimArray* pArray = NULL;
-@@ -666,6 +668,11 @@ void unoToSbxValue( SbxVariable* pVar, c
- 						pVar->PutEmpty();
- 					break;
- 				}
-+				else if( (aValue >>= aUnoDate) )
-+				{
-+					pVar->PutDate( aUnoDate.Value );
-+					break;
-+				}
- 				else
- 				{
- 					SbiInstance* pInst = pINST;
---- basic/source/runtime/methods.cxx.orig	2008-01-23 22:38:41.000000000 +0800
-+++ basic/source/runtime/methods.cxx	2008-01-25 11:16:46.000000000 +0800
-@@ -2040,6 +2040,23 @@ RTLFUNC(DateValue)
- 		String aStr( rPar.Get(1)->GetString() );
- 		BOOL bSuccess = pFormatter->IsNumberFormat( aStr, nIndex, fResult );
- 		short nType = pFormatter->GetType( nIndex );
-+		
-+		// DateValue("February 12, 1969") raises error if the system locale is not en_US
-+		// by using SbiInstance::GetNumberFormatter.
-+		// It seems that both locale number formatter and English number formatter 
-+		// are supported in Visual Basic.
-+		LanguageType eLangType = GetpApp()->GetSettings().GetLanguage();
-+		if( !bSuccess && !(eLangType & LANGUAGE_ENGLISH))
-+		{
-+			// Create a new SvNumberFormatter by using LANGUAGE_ENGLISH to get the date value;
-+			com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > 
-+				xFactory = comphelper::getProcessServiceFactory();
-+			SvNumberFormatter* pFormatterEn = new SvNumberFormatter( xFactory, LANGUAGE_ENGLISH );
-+			bSuccess = pFormatterEn->IsNumberFormat( aStr, nIndex, fResult );
-+			nType = pFormatterEn->GetType( nIndex );
-+			delete pFormatterEn;
-+		}
-+
- 		if(bSuccess && (nType==NUMBERFORMAT_DATE || nType==NUMBERFORMAT_DATETIME))
- 		{
- 			if ( nType == NUMBERFORMAT_DATETIME )
diff --git a/patches/vba/userform-filter-dialog-vba.diff b/patches/vba/userform-filter-dialog-vba.diff
deleted file mode 100644
index 325aa23..0000000
--- a/patches/vba/userform-filter-dialog-vba.diff
+++ /dev/null
@@ -1,164 +0,0 @@
-diff --git svx/inc/svx/msocximex.hxx svx/inc/svx/msocximex.hxx
-index 733304d..8735679 100644
---- svx/inc/svx/msocximex.hxx
-+++ svx/inc/svx/msocximex.hxx
-@@ -231,7 +231,7 @@ class SVX_DLLPUBLIC OCX_Control
- {
- public:
- 	OCX_Control(UniString sN, OCX_Control* parent = NULL ) : nWidth( 0 ), nHeight( 0 ), mnLeft(0), mnTop(0),
--		mnStep(0), mnBackColor(0x8000000FL), mnForeColor(0), mnTabPos(0), sName(sN), pDocSh(0),
-+		mnStep(0), mnBackColor(0x8000000FL), mnForeColor(0), mnTabPos(0), mbVisible(true), sName(sN), pDocSh(0),
- 		bSetInDialog(FALSE), mpParent( parent ) {}
- 	sal_Bool FullRead(SotStorageStream *pS)
- 	{
-@@ -288,6 +288,7 @@ public:
- 	sal_Int32 mnBackColor;
- 	sal_Int32 mnForeColor;
-         sal_uInt16 mnTabPos;
-+	bool mbVisible;
- 	UniString sName;
- 	UniString msToolTip;
- 	UniString msParentName;
-@@ -488,7 +489,7 @@ public:
- };
- struct ContainerRecord
- {
--    ContainerRecord():nTop(0), nLeft(0), nSubStorageId(0), nSubStreamLen(0), nTabPos(0), nTypeIdent(0) {}
-+    ContainerRecord():nTop(0), nLeft(0), nSubStorageId(0), nSubStreamLen(0), nTabPos(0), nTypeIdent(0), bVisible( true ) {}
- 
-     ::rtl::OUString cName;
-     ::rtl::OUString controlTip;
-@@ -501,6 +502,7 @@ struct ContainerRecord
-     sal_uInt32 nSubStreamLen;
-     sal_uInt16  nTabPos;
-     sal_uInt16 nTypeIdent;
-+    bool bVisible;
- };
- 
- typedef std::vector<OCX_Control*>::iterator CtrlIterator;
-diff --git svx/source/msfilter/msocximex.cxx svx/source/msfilter/msocximex.cxx
-index c554c11..013f87d 100644
---- svx/source/msfilter/msocximex.cxx
-+++ svx/source/msfilter/msocximex.cxx
-@@ -662,7 +662,11 @@ class ContainerRecReader
-                 pS->SeekRel( 4 );
-             // option flags
-             if( nContentFlags & 0x00000010 )
--                pS->SeekRel( 4 );
-+            {
-+                sal_uInt32 nBitFlags = 0;
-+                *pS >> nBitFlags;
-+                rec.bVisible = ( ( nBitFlags & 0x02 ) == 0x02 );
-+            }
-             // substream size
-             if( nContentFlags & 0x00000020 )
-                 *pS >> rec.nSubStreamLen;
-@@ -1122,6 +1126,13 @@ sal_Bool OCX_Control::Import(uno::Reference<container::XNameContainer> &rDialog
- 	uno::Any aTmp(&msToolTip,getCppuType((OUString *)0));
-         xPropSet->setPropertyValue(WW8_ASCII2STR("HelpText"), aTmp);
-     }
-+    try
-+    {
-+        xPropSet->setPropertyValue(WW8_ASCII2STR("EnableVisible"), uno::makeAny( mbVisible ) );
-+    }
-+    catch( uno::Exception& )
-+    {
-+    }
- 
-     if ( mnStep )
-     {
-@@ -3702,6 +3713,7 @@ void OCX_ContainerControl::ProcessControl(OCX_Control* pControl,SvStorageStream*
-                 {
-                     pControl->msCtrlSource = rec.sCtrlSource;
-                     pControl->msRowSource = rec.sRowSource;
-+                    break;
-                 }
-         }
-         pControl->sName = rec.cName;
-@@ -3716,6 +3728,7 @@ void OCX_ContainerControl::ProcessControl(OCX_Control* pControl,SvStorageStream*
-         // reflect the ms tabbing from orig MS UserForm, see below
-         pControl->mnTabPos = rec.nTabPos;
-         pControl->SetInDialog(true);
-+        pControl->mbVisible = rec.bVisible;
-         if ( mnStep )
-         {
-             // If the container has a step then it should be
-diff --git xmlscript/source/xmldlg_imexp/xmldlg_export.cxx xmlscript/source/xmldlg_imexp/xmldlg_export.cxx
-index 9915578..d9dac12 100644
---- xmlscript/source/xmldlg_imexp/xmldlg_export.cxx
-+++ xmlscript/source/xmldlg_imexp/xmldlg_export.cxx
-@@ -996,6 +996,21 @@ void ElementDescriptor::readDefaults( bool supportPrintable )
-         OSL_ENSURE( 0, "unexpected property type for \"Enabled\": not bool!" );
-     }
-     
-+    sal_Bool bVisible = sal_True;
-+    try
-+    {
-+        if (_xProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM("EnableVisible") ) ) >>= bVisible)
-+        {
-+   
-+            // only write out the non default case
-+            if (! bVisible)
-+            {
-+                addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":enablevisible") ),
-+                              OUString( RTL_CONSTASCII_USTRINGPARAM("false") ) );
-+            }
-+        }
-+    }
-+    catch( Exception& ){}
-     // force writing of pos/size
-     a = _xProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM("PositionX") ) );
-     if (a.getValueTypeClass() == TypeClass_LONG)
-diff --git xmlscript/source/xmldlg_imexp/xmldlg_import.cxx xmlscript/source/xmldlg_imexp/xmldlg_import.cxx
-index 816731a..602d46c 100644
---- xmlscript/source/xmldlg_imexp/xmldlg_import.cxx
-+++ xmlscript/source/xmldlg_imexp/xmldlg_import.cxx
-@@ -1616,6 +1616,20 @@ void ImportContext::importDefaults(
-             OUString( RTL_CONSTASCII_USTRINGPARAM("Enabled") ), makeAny( sal_False ) );
-     }
- 
-+    sal_Bool bVisible = sal_True;
-+    if (getBoolAttr(
-+            &bVisible, OUString( RTL_CONSTASCII_USTRINGPARAM("enablevisible") ),
-+            xAttributes, _pImport->XMLNS_DIALOGS_UID ) && !bVisible)
-+    {
-+	try
-+	{
-+		
-+        	_xControlModel->setPropertyValue(
-+            		OUString( RTL_CONSTASCII_USTRINGPARAM("EnableVisible") ), makeAny( sal_False ) );
-+	}
-+	catch( Exception& ){}
-+    }
-+
-     if (!importLongProperty( nBaseX,
-                              OUString( RTL_CONSTASCII_USTRINGPARAM("PositionX") ),
-                              OUString( RTL_CONSTASCII_USTRINGPARAM("left") ),
-diff --git vbahelper/source/msforms/vbacontrol.cxx vbahelper/source/msforms/vbacontrol.cxx
-index 793a199..3503631 100644
---- vbahelper/source/msforms/vbacontrol.cxx
-+++ vbahelper/source/msforms/vbacontrol.cxx
-@@ -189,14 +189,23 @@ void SAL_CALL ScVbaControl::setEnabled( sal_Bool bVisible ) throw (uno::RuntimeE
- 
- sal_Bool SAL_CALL ScVbaControl::getVisible() throw (uno::RuntimeException)
- {
-+/*
-     uno::Reference< awt::XWindow2 > xWindow2( getWindowPeer(), uno::UNO_QUERY_THROW );
-     return xWindow2->isVisible();
-+*/
-+    sal_Bool bVisible = sal_False;
-+    m_xProps->getPropertyValue(rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "EnableVisible" ) ) ) >>= bVisible;
-+    return bVisible;
- }
- 
- void SAL_CALL ScVbaControl::setVisible( sal_Bool bVisible ) throw (uno::RuntimeException)
- {
-+/*
-     uno::Reference< awt::XWindow2 > xWindow2( getWindowPeer(), uno::UNO_QUERY_THROW );
-     xWindow2->setVisible( bVisible );
-+*/
-+    m_xProps->setPropertyValue
-+            (rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "EnableVisible" ) ), uno::makeAny( bVisible ) );
- }
- double SAL_CALL ScVbaControl::getHeight() throw (uno::RuntimeException)
- {
diff --git a/patches/vba/vba-combobox-data-rowsource-fix.diff b/patches/vba/vba-combobox-data-rowsource-fix.diff
deleted file mode 100644
index 7851e40..0000000
--- a/patches/vba/vba-combobox-data-rowsource-fix.diff
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git svx/source/msfilter/msocximex.cxx svx/source/msfilter/msocximex.cxx
-index f1e9ff3..c7b1082 100644
---- svx/source/msfilter/msocximex.cxx
-+++ svx/source/msfilter/msocximex.cxx
-@@ -2677,6 +2677,8 @@ sal_Bool OCX_ComboBox::Import(com::sun::star::uno::Reference<
- 	rPropSet->setPropertyValue( WW8_ASCII2STR("MaxTextLen"), aTmp);
- 
- 	aFontData.Import(rPropSet);
-+	uno::Reference< frame::XModel > xModel ( pDocSh ? pDocSh->GetModel() : NULL );
-+	lcl_ApplyListSourceAndBindableStuff( xModel, rPropSet, msCtrlSource, msRowSource );
- 	return sal_True;
- }
- 
diff --git a/patches/vba/vba-window-api-fix.diff b/patches/vba/vba-window-api-fix.diff
deleted file mode 100644
index 9c01b9e..0000000
--- a/patches/vba/vba-window-api-fix.diff
+++ /dev/null
@@ -1,19 +0,0 @@
---- sc/source/ui/vba/vbawindow.cxx.orig	2008-09-05 11:47:14.000000000 +0800
-+++ sc/source/ui/vba/vbawindow.cxx	2008-09-05 14:48:40.000000000 +0800
-@@ -664,13 +664,14 @@ void SAL_CALL
- ScVbaWindow::setSplitHorizontal( double _splithorizontal ) throw (uno::RuntimeException)
- {
- 	double fHoriPixels = PointsToPixels( m_xDevice, _splithorizontal, sal_True );
--   m_xViewSplitable->splitAtPosition( (int) fHoriPixels, 0 );	
-+   m_xViewSplitable->splitAtPosition( static_cast<sal_Int32>( fHoriPixels ), 0 );	
- }
- 
- sal_Int32 SAL_CALL 
- ScVbaWindow::getSplitRow() throw (uno::RuntimeException)
- {
--	return m_xViewSplitable->getSplitRow();	
-+	sal_Int32 nValue = m_xViewSplitable->getSplitRow();
-+	return nValue ? nValue - 1 : nValue;	
- }
- 
- void SAL_CALL 
diff --git a/patches/vba/vba-worksheetfunctions-fix.diff b/patches/vba/vba-worksheetfunctions-fix.diff
deleted file mode 100644
index 5d52b41..0000000
--- a/patches/vba/vba-worksheetfunctions-fix.diff
+++ /dev/null
@@ -1,122 +0,0 @@
---- sc/inc/compiler.hxx.orig	2008-09-09 10:14:46.000000000 +0800
-+++ sc/inc/compiler.hxx	2008-09-09 10:18:16.000000000 +0800
-@@ -546,6 +546,9 @@ public:
-      */
-     static OpCodeMapPtr GetOpCodeMap( const sal_Int32 nLanguage );
- 
-+    // Check if it is a valid english function name
-+    static bool IsEnglishSymbol( const String& rName ); 
-+
-     //! _either_ CompileForFAP _or_ AutoCorrection, _not_ both
-     void            SetCompileForFAP( BOOL bVal )
-                         { bCompileForFAP = bVal; bIgnoreErrors = bVal; }
---- sc/source/core/tool/compiler.cxx.orig	2008-09-09 10:14:46.000000000 +0800
-+++ sc/source/core/tool/compiler.cxx	2008-09-09 10:21:51.000000000 +0800
-@@ -598,6 +598,33 @@ OpCode ScCompiler::GetEnglishOpCode( con
-     return bFound ? (*iLook).second : OpCode(ocNone);
- }
- 
-+// static
-+bool ScCompiler::IsEnglishSymbol( const String& rName )
-+{
-+    // function names are always case-insensitive
-+    String aUpper( ScGlobal::pCharClass->upper( rName ) );
-+
-+    // 1. built-in function name
-+    OpCode eOp = ScCompiler::GetEnglishOpCode( aUpper );
-+    if ( eOp != ocNone )
-+    {
-+        return true;
-+    }
-+    // 2. old add in functions
-+    USHORT nIndex;
-+    if ( ScGlobal::GetFuncCollection()->SearchFunc( aUpper, nIndex ) )
-+    {
-+        return true;
-+    }
-+
-+    // 3. new (uno) add in functions
-+    String aIntName(ScGlobal::GetAddInCollection()->FindFunction( aUpper, FALSE ));
-+    if (aIntName.Len())
-+    {
-+        return true;
-+    }
-+    return false;		// no valid function name
-+}
- 
- // static
- ScCompiler::OpCodeMapPtr ScCompiler::CreateOpCodeMap(
-@@ -693,7 +720,6 @@ void ScCompiler::SetGrammar( const ScGra
-         SetGrammarAndRefConvention( eMyGrammar, eOldGrammar);
- }
- 
--
- void ScCompiler::SetFormulaLanguage( const ScCompiler::OpCodeMapPtr & xMap )
- {
-     if (xMap.get())
---- sc/source/ui/vba/vbawsfunction.hxx.orig	2008-09-09 10:14:46.000000000 +0800
-+++ sc/source/ui/vba/vbawsfunction.hxx	2008-09-09 10:14:53.000000000 +0800
-@@ -41,7 +41,6 @@ typedef InheritedHelperInterfaceImpl1< o
- 
- class ScVbaWSFunction :  public ScVbaWSFunction_BASE
- {
--	css::uno::Reference< css::container::XNameAccess > m_xNameAccess;
- public:
- 	ScVbaWSFunction( const css::uno::Reference< oo::vba::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext);
- 	virtual ~ScVbaWSFunction(){}
---- sc/source/ui/vba/vbawsfunction.cxx.orig	2008-09-09 10:14:46.000000000 +0800
-+++ sc/source/ui/vba/vbawsfunction.cxx	2008-09-09 14:16:02.000000000 +0800
-@@ -42,13 +42,14 @@
- #include <comphelper/anytostring.hxx>
- 
- #include "vbawsfunction.hxx"
-+#include "opcode.hxx"
-+#include "compiler.hxx"
- 
- using namespace com::sun::star;
- using namespace org::openoffice;
- 
- ScVbaWSFunction::ScVbaWSFunction( const uno::Reference< vba::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext): ScVbaWSFunction_BASE( xParent, xContext )
- {
--	m_xNameAccess.set(  mxContext->getServiceManager()->createInstanceWithContext( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sheet.FunctionDescriptions") ), mxContext ), uno::UNO_QUERY_THROW );
- }
- 
- 
-@@ -86,7 +87,24 @@ ScVbaWSFunction::invoke(const rtl::OUStr
- 	for ( int count=0; count < aParamTemp.getLength(); ++count )
- 		OSL_TRACE("Param[%d] is %s",
- 			count, rtl::OUStringToOString( comphelper::anyToString( aParamTemp[count] ), RTL_TEXTENCODING_UTF8 ).getStr()  );
--	return xFunctionAccess->callFunction(FunctionName,aParamTemp);
-+	
-+	uno::Any aRet = xFunctionAccess->callFunction(FunctionName,aParamTemp);
-+	// MATCH function should alwayse return a double value, but currently if the first argument is XCellRange, MATCH function returns an array instead of a double value. Don't know why?
-+	// To fix this issue in safe, current solution is to convert this array to a double value just for MATCH function.
-+	String aUpper( FunctionName );
-+	OpCode eOp = ScCompiler::GetEnglishOpCode( aUpper.ToUpperAscii() );
-+	if( eOp == ocMatch )
-+	{
-+		double fVal = 0.0;
-+		if( aRet >>= fVal )
-+			return aRet;
-+		uno::Sequence< uno::Sequence< uno::Any > > aSequence;
-+		if( !( ( aRet >>= aSequence ) && ( aSequence.getLength() > 0 ) &&
-+			( aSequence[0].getLength() > 0 ) && ( aSequence[0][0] >>= fVal ) ) )
-+				throw uno::RuntimeException();
-+		aRet <<= fVal;
-+	}
-+	return aRet;
- }
- 
- void SAL_CALL
-@@ -107,7 +125,10 @@ ScVbaWSFunction::hasMethod(const rtl::OU
- 	sal_Bool bIsFound = sal_False;
- 	try 
- 	{
--		if ( m_xNameAccess->hasByName( Name ) )
-+		// the function name contained in the com.sun.star.sheet.FunctionDescription service is alwayse localized.
-+		// but the function name used in WorksheetFunction is a programmatic name (seems English).
-+		// So m_xNameAccess->hasByName( Name ) may fail to find name when a function name has a localized name.
-+		if( ScCompiler::IsEnglishSymbol( Name ) )
- 			bIsFound = sal_True;
- 	}
- 	catch( uno::Exception& /*e*/ )


More information about the ooo-build-commit mailing list