ooo-build r15292 - in trunk: . patches/vba



Author: noelpwer
Date: Thu Feb  5 18:15:10 2009
New Revision: 15292
URL: http://svn.gnome.org/viewvc/ooo-build?rev=15292&view=rev

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

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



Modified:
   trunk/ChangeLog
   trunk/patches/vba/vba-excel-iserror-fix.diff

Modified: trunk/patches/vba/vba-excel-iserror-fix.diff
==============================================================================
--- trunk/patches/vba/vba-excel-iserror-fix.diff	(original)
+++ trunk/patches/vba/vba-excel-iserror-fix.diff	Thu Feb  5 18:15:10 2009
@@ -15,3 +15,154 @@
  	{
  		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/ooo/vba/excel/XRange.idl oovbaapi/ooo/vba/excel/XRange.idl
+index d84dcae..8062497 100644
+--- oovbaapi/ooo/vba/excel/XRange.idl
++++ oovbaapi/ooo/vba/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 __ooo_vba_XCollection_idl__
+ #include <ooo/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 ::ooo::vba::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< ov::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< ov::excel::XRange >& ChangingCell ) throw (css::uno::RuntimeException);
+ 	virtual css::uno::Reference< ov::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]