ooo-build r14889 - trunk/patches/vba
- From: noelpwer svn gnome org
- To: svn-commits-list gnome org
- Subject: ooo-build r14889 - trunk/patches/vba
- Date: Wed, 17 Dec 2008 18:30:50 +0000 (UTC)
Author: noelpwer
Date: Wed Dec 17 18:30:49 2008
New Revision: 14889
URL: http://svn.gnome.org/viewvc/ooo-build?rev=14889&view=rev
Log:
lastest change including temporary work around for Application object
access issue
Modified:
trunk/patches/vba/vba-word-support.diff
Modified: trunk/patches/vba/vba-word-support.diff
==============================================================================
--- trunk/patches/vba/vba-word-support.diff (original)
+++ trunk/patches/vba/vba-word-support.diff Wed Dec 17 18:30:49 2008
@@ -595,7 +595,7 @@
-ovba oovbaapi\util nmake - all ovba_util ovba_vba ovba_excel ovba_msforms ovba_constants ovba_genconstidl NULL
+ovba oovbaapi\util nmake - all ovba_util ovba_vba ovba_excel ovba_word ovba_msforms ovba_constants ovba_genconstidl NULL
diff --git oovbaapi/util/makefile.mk oovbaapi/util/makefile.mk
-index bb6c97f..741f474 100644
+index 4b98130..a0f4982 100644
--- oovbaapi/util/makefile.mk
+++ oovbaapi/util/makefile.mk
@@ -44,6 +44,7 @@ TARGET=oovbaapi_db
@@ -825,10 +825,10 @@
// For Vba Event
sal_Bool SAL_CALL
diff --git sc/source/ui/unoobj/servuno.cxx sc/source/ui/unoobj/servuno.cxx
-index 83db312..05ec9d2 100644
+index 83db312..398e00a 100644
--- sc/source/ui/unoobj/servuno.cxx
+++ sc/source/ui/unoobj/servuno.cxx
-@@ -63,6 +63,11 @@
+@@ -63,6 +63,12 @@
#include <svx/xmlgrhlp.hxx>
#include <comphelper/processfactory.hxx>
@@ -836,11 +836,76 @@
+#include <com/sun/star/drawing/XDrawPagesSupplier.hpp>
+#include <com/sun/star/form/XFormsSupplier.hpp>
+#include <com/sun/star/script/ScriptEventDescriptor.hpp>
-+
++#include <comphelper/componentcontext.hxx>
++#include <cppuhelper/component_context.hxx>
using namespace ::com::sun::star;
-@@ -160,6 +165,56 @@ public:
+@@ -70,24 +76,40 @@ class ScVbaObjectForCodeNameProvider : public ::cppu::WeakImplHelper1< container
+ {
+ uno::Any maWorkbook;
+ uno::Any maCachedObject;
+- uno::Reference<lang::XMultiServiceFactory> mxSF;
++ uno::Reference< uno::XComponentContext > mxContext;
+ ScDocShell* mpDocShell;
+ public:
+ ScVbaObjectForCodeNameProvider( ScDocShell* pDocShell ) : mpDocShell( pDocShell )
+ {
+- mxSF.set(comphelper::getProcessServiceFactory());
+- uno::Reference<beans::XPropertySet> xProps(mxSF, uno::UNO_QUERY);
+- if( xProps.is() )
++ // #FIXME
++ // This is copy and paste from excimp8.cxx where we set up a custom
++ // context. We can't do this ( especially if we want to share a single
++ // Application object ) we need another way to ensure the vba objects
++ // are created with the appropriate context.
++ // idea: add a GetGlobalUnoConstant to basmgr.hxx
++ // make XGlobals also support a multiservicefactory, this will
++ // provide a single point of contact for creating objects
++ // with the *correct* context
++ ::comphelper::ComponentContext aContext( ::comphelper::getProcessServiceFactory() );
++ // Create context with 'excel' initially (null) application
++ ::cppu::ContextEntry_Init aHandlerContextInfo[] =
+ {
+- ScDocument* pDoc = mpDocShell->GetDocument();
+- if ( !pDoc )
+- throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("")), uno::Reference< uno::XInterface >() );
+-
+- uno::Sequence< uno::Any > aArgs(2);
+- aArgs[0] = uno::Any( uno::Reference< uno::XInterface >() );
+- aArgs[1] = uno::Any( mpDocShell->GetModel() );
+- maWorkbook <<= mxSF->createInstanceWithArguments( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.excel.Workbook") ), aArgs );
+- }
++ ::cppu::ContextEntry_Init( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Application" ) ), uno::Any() )
++ };
++ mxContext = ::cppu::createComponentContext( aHandlerContextInfo, sizeof( aHandlerContextInfo ) / sizeof( aHandlerContextInfo[0] ), aContext.getUNOContext() );
++
++ uno::Any aApplication( aContext.getUNOContext()->getServiceManager()->createInstanceWithContext( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ooo.vba.excel.Application" ) ), mxContext ) );
++ uno::Reference< container::XNameContainer > xNameContainer( mxContext, uno::UNO_QUERY_THROW );
++ xNameContainer->replaceByName( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Application") ), aApplication );
++
++ ScDocument* pDoc = mpDocShell->GetDocument();
++ if ( !pDoc )
++ throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("")), uno::Reference< uno::XInterface >() );
++
++ uno::Sequence< uno::Any > aArgs(2);
++ aArgs[0] = uno::Any( uno::Reference< uno::XInterface >() );
++ aArgs[1] = uno::Any( mpDocShell->GetModel() );
++ maWorkbook <<= aContext.getUNOContext()->getServiceManager()->createInstanceWithArgumentsAndContext( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.excel.Workbook") ), aArgs, mxContext );
+ }
+
+ virtual ::sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName ) throw (::com::sun::star::uno::RuntimeException )
+@@ -120,7 +142,8 @@ public:
+ aArgs[0] = maWorkbook;
+ aArgs[1] = uno::Any( xModel );
+ aArgs[2] = uno::Any( rtl::OUString( sSheetName ) );
+- maCachedObject <<= mxSF->createInstanceWithArguments( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.excel.Worksheet") ), aArgs );
++ ::comphelper::ComponentContext aContext( ::comphelper::getProcessServiceFactory() );
++ maCachedObject <<= aContext.getUNOContext()->getServiceManager()->createInstanceWithArgumentsAndContext( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.excel.Worksheet") ), aArgs, mxContext );
+ break;
+ }
+ }
+@@ -160,6 +183,56 @@ public:
};
@@ -897,7 +962,7 @@
//------------------------------------------------------------------------
static const sal_Char* __FAR_DATA aProvNames[SC_SERVICE_COUNT] =
-@@ -210,6 +265,7 @@ static const sal_Char* __FAR_DATA aProvNames[SC_SERVICE_COUNT] =
+@@ -210,6 +283,7 @@ static const sal_Char* __FAR_DATA aProvNames[SC_SERVICE_COUNT] =
SC_SERVICENAME_FORMULAPARS, // SC_SERVICE_FORMULAPARS
SC_SERVICENAME_OPCODEMAPPER, // SC_SERVICE_OPCODEMAPPER
"ooo.vba.VBAObjectModuleObjectProvider",// SC_SERVICE_VBAOBJECTPROVIDER
@@ -905,7 +970,7 @@
};
//
-@@ -263,6 +319,7 @@ static const sal_Char* __FAR_DATA aOldNames[SC_SERVICE_COUNT] =
+@@ -263,6 +337,7 @@ static const sal_Char* __FAR_DATA aOldNames[SC_SERVICE_COUNT] =
"", // SC_SERVICE_FORMULAPARS
"", // SC_SERVICE_OPCODEMAPPER
"", // SC_SERVICE_VBAOBJECTPROVIDER
@@ -913,7 +978,7 @@
};
-@@ -458,6 +515,9 @@ uno::Reference<uno::XInterface> ScServiceProvider::MakeInstance(
+@@ -458,6 +533,9 @@ uno::Reference<uno::XInterface> ScServiceProvider::MakeInstance(
case SC_SERVICE_VBAOBJECTPROVIDER:
xRet.set(static_cast<container::XNameAccess*>(new ScVbaObjectForCodeNameProvider( pDocShell )));
break;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]