ooo-build r15348 - in branches/ooo-build-3-0-1: . patches/dev300 patches/vba



Author: noelpwer
Date: Tue Feb 17 10:57:11 2009
New Revision: 15348
URL: http://svn.gnome.org/viewvc/ooo-build?rev=15348&view=rev

Log:
2009-02-05  Noel Power  <noel power novell com>

        * patches/dev300/vba-excel-iserror-fix.diff,  fix for n#469762



Added:
   branches/ooo-build-3-0-1/patches/vba/vba-excel-iserror-fix.diff
Modified:
   branches/ooo-build-3-0-1/ChangeLog
   branches/ooo-build-3-0-1/patches/dev300/apply

Modified: branches/ooo-build-3-0-1/patches/dev300/apply
==============================================================================
--- branches/ooo-build-3-0-1/patches/dev300/apply	(original)
+++ branches/ooo-build-3-0-1/patches/dev300/apply	Tue Feb 17 10:57:11 2009
@@ -1713,6 +1713,7 @@
 
 vba-xl-import-crash.diff, n#458985
 vba-interior-object-fix.diff, n#459479, Fong
+vba-excel-iserror-fix.diff, n#469762
 [ VBAUntested ]
 SectionOwner => noelpwer
 vba-basic-null.diff i#85349, jjiao

Added: branches/ooo-build-3-0-1/patches/vba/vba-excel-iserror-fix.diff
==============================================================================
--- (empty file)
+++ branches/ooo-build-3-0-1/patches/vba/vba-excel-iserror-fix.diff	Tue Feb 17 10:57:11 2009
@@ -0,0 +1,168 @@
+--- sc/source/ui/vba/vbawsfunction.cxx	2009-02-02 15:33:32.000000000 +0000
++++ sc/source/ui/vba/vbawsfunction.cxx.patched	2009-02-02 16:18:58.000000000 +0000
+@@ -88,12 +88,13 @@ ScVbaWSFunction::invoke(const rtl::OUStr
+ 			count, rtl::OUStringToOString( comphelper::anyToString( aParamTemp[count] ), RTL_TEXTENCODING_UTF8 ).getStr()  );
+ 	
+ 	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 );
+ 	OSL_TRACE("Function name is: ", rtl::OUStringToOString( FunctionName, RTL_TEXTENCODING_UTF8 ).getStr()  );
+ 	OpCode eOp = ScCompiler::GetEnglishOpCode( aUpper.ToUpperAscii() );
+-	if( eOp == ocMatch )
++	if( eOp == ocMatch || eOp == ocIsError )
+ 	{
+ 		double fVal = 0.0;
+ 		if( aRet >>= fVal )
+diff --git basic/source/runtime/methods.cxx basic/source/runtime/methods.cxx
+index 8a9d408..0a7a30e 100644
+--- basic/source/runtime/methods.cxx
++++ basic/source/runtime/methods.cxx
+@@ -78,6 +78,7 @@
+ #include <com/sun/star/io/XOutputStream.hpp>
+ #include <com/sun/star/io/XStream.hpp>
+ #include <com/sun/star/io/XSeekable.hpp>
++#include <com/sun/star/script/XErrorQuery.hpp>
+ 
+ using namespace comphelper;
+ using namespace osl;
+@@ -85,6 +86,7 @@ using namespace com::sun::star::uno;
+ using namespace com::sun::star::lang;
+ using namespace com::sun::star::ucb;
+ using namespace com::sun::star::io;
++using namespace com::sun::star::script;
+ 
+ #endif /* _USE_UNO */
+ 
+@@ -2426,7 +2428,22 @@ RTLFUNC(IsError)
+ 	if ( rPar.Count() < 2 )
+ 		StarBASIC::Error( SbERR_BAD_ARGUMENT );
+ 	else
+-		rPar.Get( 0 )->PutBool( rPar.Get(1)->IsErr() );
++	{
++		SbxVariable* pVar =rPar.Get( 1 );
++		SbUnoObject* pObj = PTR_CAST(SbUnoObject,pVar );
++                if ( !pObj )
++                { 
++                    if ( SbxBase* pBaseObj = pVar->GetObject() )
++                        pObj = PTR_CAST(SbUnoObject, pBaseObj );
++                }
++		Reference< XErrorQuery > xError;
++		if ( pObj )
++			xError.set( pObj->getUnoAny(), UNO_QUERY );
++		if ( xError.is() )
++			rPar.Get( 0 )->PutBool( xError->hasError() );
++		else
++			rPar.Get( 0 )->PutBool( rPar.Get(1)->IsErr() );
++	}
+ }
+ 
+ RTLFUNC(IsNull)
+diff --git oovbaapi/org/openoffice/excel/XRange.idl oovbaapi/ooo/vba/excel/XRange.idl
+index d84dcae..8062497 100644
+--- oovbaapi/org/openoffice/excel/XRange.idl
++++ oovbaapi/org/openoffice/excel/XRange.idl
+@@ -45,6 +45,9 @@
+ #ifndef __com_sun_star_script_XDefaultMethod_idl__
+ #include <com/sun/star/script/XDefaultMethod.idl>
+ #endif
++#ifndef __com_sun_star_script_XErrorQuery_idl__
++#include <com/sun/star/script/XErrorQuery.idl>
++#endif
+ #ifndef __org_openoffice_vba_XCollection_idl__
+ #include <org/openoffice/vba/XCollection.idl>
+ #endif
+@@ -77,6 +80,7 @@ interface XRange
+  	interface com::sun::star::container::XEnumerationAccess;
+ 	interface com::sun::star::script::XDefaultMethod;
+ 	interface com::sun::star::script::XDefaultProperty;
++	interface com::sun::star::script::XErrorQuery;
+ 	interface ::org::openoffice::excel::XFormat;
+ 	//interface ::ooo::vba::XHelperInterface;
+ 
+diff --git sc/source/ui/vba/vbarange.cxx sc/source/ui/vba/vbarange.cxx
+index d7e20e5..a052262 100644
+--- sc/source/ui/vba/vbarange.cxx
++++ sc/source/ui/vba/vbarange.cxx
+@@ -5358,6 +5358,24 @@ ScVbaRange::getServiceNames()
+ 	return aServiceNames;
+ }
+ 
++sal_Bool SAL_CALL
++ScVbaRange::hasError() throw (uno::RuntimeException)
++{
++    double dResult = sal_False;
++    uno::Reference< script::XInvocation > xInvoc( ScVbaGlobals::getGlobalsImpl( mxContext )->getApplication()->WorksheetFunction(), uno::UNO_QUERY_THROW );
++
++    static rtl::OUString FunctionName( RTL_CONSTASCII_USTRINGPARAM("IsError" ) );
++    uno::Sequence< uno::Any > Params(1);
++    uno::Reference< excel::XRange > aRange( this );
++    Params[0] = uno::makeAny( aRange );
++    uno::Sequence< sal_Int16 > OutParamIndex;
++    uno::Sequence< uno::Any > OutParam;
++    xInvoc->invoke( FunctionName, Params, OutParamIndex, OutParam ) >>= dResult;
++    if ( dResult > 0.0 )
++         return sal_True;
++    return sal_False;
++}
++
+ namespace range
+ {
+ namespace sdecl = comphelper::service_decl;
+diff --git sc/source/ui/vba/vbarange.hxx sc/source/ui/vba/vbarange.hxx
+index ce902f1..0df668c 100644
+--- sc/source/ui/vba/vbarange.hxx
++++ sc/source/ui/vba/vbarange.hxx
+@@ -274,6 +274,8 @@ public:
+ 	static css::uno::Reference< oo::excel::XRange > ApplicationRange( const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Any &Cell1, const css::uno::Any &Cell2 ) throw (css::uno::RuntimeException);
+ 	virtual sal_Bool SAL_CALL GoalSeek( const css::uno::Any& Goal, const css::uno::Reference< oo::excel::XRange >& ChangingCell ) throw (css::uno::RuntimeException);
+ 	virtual css::uno::Reference< oo::excel::XRange > SAL_CALL SpecialCells( const css::uno::Any& _oType, const css::uno::Any& _oValue) throw ( css::script::BasicErrorException );  
++	// XErrorQuery
++	virtual ::sal_Bool SAL_CALL hasError(  ) throw (css::uno::RuntimeException);
+ 	// XHelperInterface
+ 	virtual rtl::OUString& getServiceImplName();
+ 	virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+diff --git udkapi/com/sun/star/script/XErrorQuery.idl udkapi/com/sun/star/script/XErrorQuery.idl
+new file mode 100644
+index 0000000..9a1860e
+--- /dev/null
++++ udkapi/com/sun/star/script/XErrorQuery.idl
+@@ -0,0 +1,25 @@
++#ifndef __com_sun_star_script_XErrorQuery_idl__
++#define __com_sun_star_script_XErrorQuery_idl__
++
++#ifndef __com_sun_star_uno_XInterface_idl__
++#include <com/sun/star/uno/XInterface.idl>
++#endif
++
++module com { module sun { module star { module script {
++//==============================================================================
++
++interface XErrorQuery : ::com::sun::star::uno::XInterface
++{
++  //-----------------------------------------------------------------------
++  /**
++    Returns whether this object has an error
++
++    @return
++    <atom>boolean</atom> indicating an error or not
++  */
++  boolean hasError();
++
++};
++
++};  };  };  };
++#endif
+diff --git udkapi/com/sun/star/script/makefile.mk udkapi/com/sun/star/script/makefile.mk
+index 69e06dd..250b5cc 100644
+--- udkapi/com/sun/star/script/makefile.mk
++++ udkapi/com/sun/star/script/makefile.mk
+@@ -87,6 +87,7 @@ IDLFILES=\
+ 	XDefaultProperty.idl\
+     ModuleInfo.idl\
+     ModuleType.idl\
++    XErrorQuery.idl\
+ 
+ # ------------------------------------------------------------------
+ 



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