summaryrefslogtreecommitdiff
path: root/scripting/source
diff options
context:
space:
mode:
Diffstat (limited to 'scripting/source')
-rwxr-xr-x[-rw-r--r--]scripting/source/basprov/baslibnode.cxx0
-rwxr-xr-x[-rw-r--r--]scripting/source/basprov/baslibnode.hxx0
-rwxr-xr-x[-rw-r--r--]scripting/source/basprov/basmethnode.cxx2
-rwxr-xr-x[-rw-r--r--]scripting/source/basprov/basmethnode.hxx0
-rwxr-xr-x[-rw-r--r--]scripting/source/basprov/basmodnode.cxx4
-rwxr-xr-x[-rw-r--r--]scripting/source/basprov/basmodnode.hxx0
-rwxr-xr-xscripting/source/basprov/basprov.component37
-rwxr-xr-x[-rw-r--r--]scripting/source/basprov/basprov.cxx9
-rwxr-xr-x[-rw-r--r--]scripting/source/basprov/basprov.hxx0
-rwxr-xr-x[-rw-r--r--]scripting/source/basprov/basprov.xml0
-rwxr-xr-x[-rw-r--r--]scripting/source/basprov/basscript.cxx29
-rwxr-xr-x[-rw-r--r--]scripting/source/basprov/basscript.hxx6
-rwxr-xr-x[-rw-r--r--]scripting/source/basprov/makefile.mk9
-rwxr-xr-xscripting/source/dlgprov/DialogModelProvider.cxx196
-rwxr-xr-xscripting/source/dlgprov/DialogModelProvider.hxx92
-rwxr-xr-x[-rw-r--r--]scripting/source/dlgprov/dlgevtatt.cxx0
-rwxr-xr-x[-rw-r--r--]scripting/source/dlgprov/dlgevtatt.hxx0
-rwxr-xr-xscripting/source/dlgprov/dlgprov.component36
-rwxr-xr-x[-rw-r--r--]scripting/source/dlgprov/dlgprov.cxx165
-rwxr-xr-x[-rw-r--r--]scripting/source/dlgprov/dlgprov.hxx7
-rwxr-xr-x[-rw-r--r--]scripting/source/dlgprov/dlgprov.xml0
-rwxr-xr-x[-rw-r--r--]scripting/source/dlgprov/makefile.mk10
-rwxr-xr-x[-rw-r--r--]scripting/source/inc/bcholder.hxx0
-rwxr-xr-x[-rw-r--r--]scripting/source/inc/util/MiscUtils.hxx0
-rwxr-xr-x[-rw-r--r--]scripting/source/inc/util/scriptingconstants.hxx0
-rwxr-xr-x[-rw-r--r--]scripting/source/inc/util/util.hxx15
-rwxr-xr-x[-rw-r--r--]scripting/source/protocolhandler/exports.dxp1
-rwxr-xr-x[-rw-r--r--]scripting/source/protocolhandler/makefile.mk9
-rwxr-xr-xscripting/source/protocolhandler/protocolhandler.component34
-rwxr-xr-x[-rw-r--r--]scripting/source/protocolhandler/scripthandler.cxx66
-rwxr-xr-x[-rw-r--r--]scripting/source/protocolhandler/scripthandler.hxx0
-rwxr-xr-x[-rw-r--r--]scripting/source/provider/ActiveMSPList.cxx1
-rwxr-xr-x[-rw-r--r--]scripting/source/provider/ActiveMSPList.hxx0
-rwxr-xr-x[-rw-r--r--]scripting/source/provider/BrowseNodeFactoryImpl.cxx0
-rwxr-xr-x[-rw-r--r--]scripting/source/provider/BrowseNodeFactoryImpl.hxx0
-rwxr-xr-x[-rw-r--r--]scripting/source/provider/MasterScriptProvider.cxx44
-rwxr-xr-x[-rw-r--r--]scripting/source/provider/MasterScriptProvider.hxx0
-rwxr-xr-x[-rw-r--r--]scripting/source/provider/MasterScriptProviderFactory.cxx0
-rwxr-xr-x[-rw-r--r--]scripting/source/provider/MasterScriptProviderFactory.hxx0
-rwxr-xr-x[-rw-r--r--]scripting/source/provider/ProviderCache.cxx17
-rwxr-xr-x[-rw-r--r--]scripting/source/provider/ProviderCache.hxx0
-rwxr-xr-x[-rw-r--r--]scripting/source/provider/ScriptImpl.cxx8
-rwxr-xr-x[-rw-r--r--]scripting/source/provider/ScriptImpl.hxx0
-rwxr-xr-x[-rw-r--r--]scripting/source/provider/ScriptingContext.cxx5
-rwxr-xr-x[-rw-r--r--]scripting/source/provider/ScriptingContext.hxx0
-rwxr-xr-x[-rw-r--r--]scripting/source/provider/URIHelper.cxx0
-rwxr-xr-x[-rw-r--r--]scripting/source/provider/URIHelper.hxx0
-rwxr-xr-x[-rw-r--r--]scripting/source/provider/exports.dxp1
-rwxr-xr-x[-rw-r--r--]scripting/source/provider/makefile.mk0
-rwxr-xr-x[-rw-r--r--]scripting/source/pyprov/delzip0
-rwxr-xr-x[-rw-r--r--]scripting/source/pyprov/description.xml0
-rwxr-xr-xscripting/source/pyprov/mailmerge.component37
-rwxr-xr-x[-rw-r--r--]scripting/source/pyprov/mailmerge.py0
-rwxr-xr-x[-rw-r--r--]scripting/source/pyprov/makefile.mk14
-rwxr-xr-x[-rw-r--r--]scripting/source/pyprov/manifest.xml0
-rwxr-xr-x[-rw-r--r--]scripting/source/pyprov/officehelper.py0
-rwxr-xr-xscripting/source/pyprov/pythonscript.component35
-rwxr-xr-x[-rw-r--r--]scripting/source/pyprov/pythonscript.py0
-rwxr-xr-x[-rw-r--r--]scripting/source/runtimemgr/ScriptExecDialog.hrc0
-rwxr-xr-x[-rw-r--r--]scripting/source/runtimemgr/ScriptExecDialog.src0
-rwxr-xr-x[-rw-r--r--]scripting/source/runtimemgr/ScriptNameResolverImpl.cxx72
-rwxr-xr-x[-rw-r--r--]scripting/source/runtimemgr/ScriptNameResolverImpl.hxx0
-rwxr-xr-x[-rw-r--r--]scripting/source/runtimemgr/ScriptRuntimeManager.cxx124
-rwxr-xr-x[-rw-r--r--]scripting/source/runtimemgr/ScriptRuntimeManager.hxx0
-rwxr-xr-x[-rw-r--r--]scripting/source/runtimemgr/StorageBridge.cxx32
-rwxr-xr-x[-rw-r--r--]scripting/source/runtimemgr/StorageBridge.hxx0
-rwxr-xr-x[-rw-r--r--]scripting/source/runtimemgr/StorageBridgeFactory.cxx0
-rwxr-xr-x[-rw-r--r--]scripting/source/runtimemgr/StorageBridgeFactory.hxx0
-rwxr-xr-x[-rw-r--r--]scripting/source/runtimemgr/exports.dxp1
-rwxr-xr-x[-rw-r--r--]scripting/source/runtimemgr/makefile.mk0
-rwxr-xr-x[-rw-r--r--]scripting/source/storage/ScriptData.hxx0
-rwxr-xr-x[-rw-r--r--]scripting/source/storage/ScriptElement.cxx0
-rwxr-xr-x[-rw-r--r--]scripting/source/storage/ScriptElement.hxx0
-rwxr-xr-x[-rw-r--r--]scripting/source/storage/ScriptInfo.cxx0
-rwxr-xr-x[-rw-r--r--]scripting/source/storage/ScriptInfo.hxx0
-rwxr-xr-x[-rw-r--r--]scripting/source/storage/ScriptInfoImpl.hxx0
-rwxr-xr-x[-rw-r--r--]scripting/source/storage/ScriptMetadataImporter.cxx29
-rwxr-xr-x[-rw-r--r--]scripting/source/storage/ScriptMetadataImporter.hxx0
-rwxr-xr-x[-rw-r--r--]scripting/source/storage/ScriptSecurityManager.cxx133
-rwxr-xr-x[-rw-r--r--]scripting/source/storage/ScriptSecurityManager.hxx0
-rwxr-xr-x[-rw-r--r--]scripting/source/storage/ScriptStorage.cxx64
-rwxr-xr-x[-rw-r--r--]scripting/source/storage/ScriptStorage.hxx0
-rwxr-xr-x[-rw-r--r--]scripting/source/storage/ScriptStorageManager.cxx50
-rwxr-xr-x[-rw-r--r--]scripting/source/storage/ScriptStorageManager.hxx0
-rwxr-xr-x[-rw-r--r--]scripting/source/storage/ScriptURI.cxx0
-rwxr-xr-x[-rw-r--r--]scripting/source/storage/ScriptURI.hxx0
-rwxr-xr-x[-rw-r--r--]scripting/source/storage/XMLElement.cxx0
-rwxr-xr-x[-rw-r--r--]scripting/source/storage/XMLElement.hxx0
-rwxr-xr-x[-rw-r--r--]scripting/source/storage/exports.dxp1
-rwxr-xr-x[-rw-r--r--]scripting/source/storage/makefile.mk0
-rwxr-xr-x[-rw-r--r--]scripting/source/storage/storage.xml0
-rwxr-xr-x[-rw-r--r--]scripting/source/stringresource/makefile.mk8
-rwxr-xr-xscripting/source/stringresource/stringresource.component40
-rwxr-xr-x[-rw-r--r--]scripting/source/stringresource/stringresource.cxx7
-rwxr-xr-x[-rw-r--r--]scripting/source/stringresource/stringresource.hxx0
-rwxr-xr-x[-rw-r--r--]scripting/source/stringresource/stringresource.xml0
-rwxr-xr-x[-rw-r--r--]scripting/source/vbaevents/eventhelper.cxx0
-rwxr-xr-x[-rw-r--r--]scripting/source/vbaevents/makefile.mk13
-rwxr-xr-x[-rw-r--r--]scripting/source/vbaevents/service.cxx10
-rwxr-xr-xscripting/source/vbaevents/vbaevents.component37
-rwxr-xr-x[-rw-r--r--]scripting/source/vbaevents/vbamsformreturntypes.hxx0
101 files changed, 902 insertions, 608 deletions
diff --git a/scripting/source/basprov/baslibnode.cxx b/scripting/source/basprov/baslibnode.cxx
index acec5ae07bef..acec5ae07bef 100644..100755
--- a/scripting/source/basprov/baslibnode.cxx
+++ b/scripting/source/basprov/baslibnode.cxx
diff --git a/scripting/source/basprov/baslibnode.hxx b/scripting/source/basprov/baslibnode.hxx
index ec28431105b3..ec28431105b3 100644..100755
--- a/scripting/source/basprov/baslibnode.hxx
+++ b/scripting/source/basprov/baslibnode.hxx
diff --git a/scripting/source/basprov/basmethnode.cxx b/scripting/source/basprov/basmethnode.cxx
index b41f5c2988ce..6e22357d071c 100644..100755
--- a/scripting/source/basprov/basmethnode.cxx
+++ b/scripting/source/basprov/basmethnode.cxx
@@ -219,7 +219,7 @@ namespace basprov
if ( aFunctionName == BASPROV_PROPERTY_EDITABLE )
{
::rtl::OUString sDocURL, sLibName, sModName;
- USHORT nLine1 = 0, nLine2;
+ sal_uInt16 nLine1 = 0, nLine2;
if ( !m_bIsAppScript )
{
diff --git a/scripting/source/basprov/basmethnode.hxx b/scripting/source/basprov/basmethnode.hxx
index 0a19db15f863..0a19db15f863 100644..100755
--- a/scripting/source/basprov/basmethnode.hxx
+++ b/scripting/source/basprov/basmethnode.hxx
diff --git a/scripting/source/basprov/basmodnode.cxx b/scripting/source/basprov/basmodnode.cxx
index d64cdac165d4..a863e9f381b8 100644..100755
--- a/scripting/source/basprov/basmodnode.cxx
+++ b/scripting/source/basprov/basmodnode.cxx
@@ -101,7 +101,7 @@ namespace basprov
sal_Int32 nRealCount = 0;
for ( sal_Int32 i = 0; i < nCount; ++i )
{
- SbMethod* pMethod = static_cast< SbMethod* >( pMethods->Get( static_cast< USHORT >( i ) ) );
+ SbMethod* pMethod = static_cast< SbMethod* >( pMethods->Get( static_cast< sal_uInt16 >( i ) ) );
if ( pMethod && !pMethod->IsHidden() )
++nRealCount;
}
@@ -111,7 +111,7 @@ namespace basprov
sal_Int32 iTarget = 0;
for ( sal_Int32 i = 0; i < nCount; ++i )
{
- SbMethod* pMethod = static_cast< SbMethod* >( pMethods->Get( static_cast< USHORT >( i ) ) );
+ SbMethod* pMethod = static_cast< SbMethod* >( pMethods->Get( static_cast< sal_uInt16 >( i ) ) );
if ( pMethod && !pMethod->IsHidden() )
pChildNodes[iTarget++] = static_cast< browse::XBrowseNode* >( new BasicMethodNodeImpl( m_xContext, m_sScriptingContext, pMethod, m_bIsAppScript ) );
}
diff --git a/scripting/source/basprov/basmodnode.hxx b/scripting/source/basprov/basmodnode.hxx
index cc909f0ab162..cc909f0ab162 100644..100755
--- a/scripting/source/basprov/basmodnode.hxx
+++ b/scripting/source/basprov/basmodnode.hxx
diff --git a/scripting/source/basprov/basprov.component b/scripting/source/basprov/basprov.component
new file mode 100755
index 000000000000..528ab6544e1e
--- /dev/null
+++ b/scripting/source/basprov/basprov.component
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org 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 version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.scripting.ScriptProviderForBasic">
+ <service name="com.sun.star.script.browse.BrowseNode"/>
+ <service name="com.sun.star.script.provider.LanguageScriptProvider"/>
+ <service name="com.sun.star.script.provider.ScriptProvider"/>
+ <service name="com.sun.star.script.provider.ScriptProviderForBasic"/>
+ </implementation>
+</component>
diff --git a/scripting/source/basprov/basprov.cxx b/scripting/source/basprov/basprov.cxx
index e64166533f9f..40a4cced46d1 100644..100755
--- a/scripting/source/basprov/basprov.cxx
+++ b/scripting/source/basprov/basprov.cxx
@@ -412,7 +412,7 @@ namespace basprov
StarBASIC* pBasic = pBasicMgr->GetLib( aLibrary );
if ( !pBasic )
{
- USHORT nId = pBasicMgr->GetLibId( aLibrary );
+ sal_uInt16 nId = pBasicMgr->GetLibId( aLibrary );
if ( nId != LIB_NOTFOUND )
{
pBasicMgr->LoadLib( nId );
@@ -605,13 +605,6 @@ extern "C"
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
- SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(
- lang::XMultiServiceFactory * pServiceManager, registry::XRegistryKey * pRegistryKey )
- {
- return ::cppu::component_writeInfoHelper(
- pServiceManager, pRegistryKey, ::basprov::s_component_entries );
- }
-
SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory(
const sal_Char * pImplName, lang::XMultiServiceFactory * pServiceManager,
registry::XRegistryKey * pRegistryKey )
diff --git a/scripting/source/basprov/basprov.hxx b/scripting/source/basprov/basprov.hxx
index 7f7893ee1296..7f7893ee1296 100644..100755
--- a/scripting/source/basprov/basprov.hxx
+++ b/scripting/source/basprov/basprov.hxx
diff --git a/scripting/source/basprov/basprov.xml b/scripting/source/basprov/basprov.xml
index 0ae341cce157..0ae341cce157 100644..100755
--- a/scripting/source/basprov/basprov.xml
+++ b/scripting/source/basprov/basprov.xml
diff --git a/scripting/source/basprov/basscript.cxx b/scripting/source/basprov/basscript.cxx
index 978065053d5d..2d9c3b8ecd2f 100644..100755
--- a/scripting/source/basprov/basscript.cxx
+++ b/scripting/source/basprov/basscript.cxx
@@ -93,13 +93,34 @@ namespace basprov
,m_documentBasicManager( &documentBasicManager )
,m_xDocumentScriptContext( documentScriptContext )
{
- //
+ StartListening( *m_documentBasicManager );
registerProperty( BASSCRIPT_PROPERTY_CALLER, BASSCRIPT_PROPERTY_ID_CALLER, BASSCRIPT_DEFAULT_ATTRIBS(), &m_caller, ::getCppuType( &m_caller ) );
}
// -----------------------------------------------------------------------------
BasicScriptImpl::~BasicScriptImpl()
{
+ if ( m_documentBasicManager )
+ EndListening( *m_documentBasicManager );
+ }
+
+ // -----------------------------------------------------------------------------
+ // SfxListener
+ // -----------------------------------------------------------------------------
+ void BasicScriptImpl::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
+ {
+ if ( &rBC != m_documentBasicManager )
+ {
+ OSL_ENSURE( false, "BasicScriptImpl::Notify: where does this come from?" );
+ // not interested in
+ return;
+ }
+ const SfxSimpleHint* pSimpleHint = PTR_CAST( SfxSimpleHint, &rHint );
+ if ( pSimpleHint && ( pSimpleHint->GetId() == SFX_HINT_DYING ) )
+ {
+ m_documentBasicManager = NULL;
+ EndListening( rBC ); // prevent multiple notifications
+ }
}
// -----------------------------------------------------------------------------
@@ -171,7 +192,7 @@ namespace basprov
if ( pInfo )
{
sal_Int32 nSbxOptional = 0;
- USHORT n = 1;
+ sal_uInt16 n = 1;
for ( const SbxParamInfo* pParamInfo = pInfo->GetParam( n ); pParamInfo; pParamInfo = pInfo->GetParam( ++n ) )
{
if ( ( pParamInfo->nFlags & SBX_OPTIONAL ) != 0 )
@@ -204,7 +225,7 @@ namespace basprov
{
SbxVariableRef xSbxVar = new SbxVariable( SbxVARIANT );
unoToSbxValue( static_cast< SbxVariable* >( xSbxVar ), pParams[i] );
- xSbxParams->Put( xSbxVar, static_cast< USHORT >( i ) + 1 );
+ xSbxParams->Put( xSbxVar, static_cast< sal_uInt16 >( i ) + 1 );
// Enable passing by ref
if ( xSbxVar->GetType() != SbxVARIANT )
@@ -246,7 +267,7 @@ namespace basprov
if ( pInfo_ )
{
OutParamMap aOutParamMap;
- for ( USHORT n = 1, nCount = xSbxParams->Count(); n < nCount; ++n )
+ for ( sal_uInt16 n = 1, nCount = xSbxParams->Count(); n < nCount; ++n )
{
const SbxParamInfo* pParamInfo = pInfo_->GetParam( n );
if ( pParamInfo && ( pParamInfo->eType & SbxBYREF ) != 0 )
diff --git a/scripting/source/basprov/basscript.hxx b/scripting/source/basprov/basscript.hxx
index c3322e319164..0befac6c3d27 100644..100755
--- a/scripting/source/basprov/basscript.hxx
+++ b/scripting/source/basprov/basscript.hxx
@@ -36,6 +36,7 @@
#include <comphelper/proparrhlp.hxx>
#include <comphelper/propertycontainer.hxx>
#include <basic/sbmeth.hxx>
+#include <svl/lstner.hxx>
class BasicManager;
@@ -52,7 +53,7 @@ namespace basprov
::com::sun::star::script::provider::XScript > BasicScriptImpl_BASE;
- class BasicScriptImpl : public BasicScriptImpl_BASE,
+ class BasicScriptImpl : public BasicScriptImpl_BASE, public SfxListener,
public ::scripting_helper::OMutexHolder,
public ::scripting_helper::OBroadcastHelperHolder,
public ::comphelper::OPropertyContainer,
@@ -106,6 +107,9 @@ namespace basprov
// XPropertySet
virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( )
throw (::com::sun::star::uno::RuntimeException);
+
+ // SfxListener
+ virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
};
//.........................................................................
diff --git a/scripting/source/basprov/makefile.mk b/scripting/source/basprov/makefile.mk
index 5001e5db288e..bde15f95d5a4 100644..100755
--- a/scripting/source/basprov/makefile.mk
+++ b/scripting/source/basprov/makefile.mk
@@ -58,6 +58,7 @@ SHL1STDLIBS= \
$(SFX2LIB) \
$(BASICLIB) \
$(VCLLIB) \
+ $(SVLLIB) \
$(TOOLSLIB) \
$(UCBHELPERLIB) \
$(COMPHELPERLIB) \
@@ -71,3 +72,11 @@ SHL1LIBS=$(SLB)$/$(TARGET).lib
# --- Targets ------------------------------------------------------
.INCLUDE : target.mk
+
+ALLTAR : $(MISC)/basprov.component
+
+$(MISC)/basprov.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ basprov.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt basprov.component
diff --git a/scripting/source/dlgprov/DialogModelProvider.cxx b/scripting/source/dlgprov/DialogModelProvider.cxx
new file mode 100755
index 000000000000..fe8da6e511d7
--- /dev/null
+++ b/scripting/source/dlgprov/DialogModelProvider.cxx
@@ -0,0 +1,196 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org 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 version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_scripting.hxx"
+
+#include "DialogModelProvider.hxx"
+#include "dlgprov.hxx"
+#include <com/sun/star/resource/XStringResourceManager.hpp>
+#include <com/sun/star/ucb/XSimpleFileAccess.hpp>
+
+
+// component helper namespace
+namespace comp_DialogModelProvider {
+
+namespace css = ::com::sun::star;
+using namespace ::com::sun::star;
+using namespace awt;
+using namespace lang;
+using namespace uno;
+using namespace script;
+using namespace beans;
+
+
+// component and service helper functions:
+::rtl::OUString SAL_CALL _getImplementationName();
+css::uno::Sequence< ::rtl::OUString > SAL_CALL _getSupportedServiceNames();
+css::uno::Reference< css::uno::XInterface > SAL_CALL _create( css::uno::Reference< css::uno::XComponentContext > const & context );
+
+} // closing component helper namespace
+
+
+
+/// anonymous implementation namespace
+namespace dlgprov {
+
+namespace css = ::com::sun::star;
+using namespace ::com::sun::star;
+using namespace awt;
+using namespace lang;
+using namespace uno;
+using namespace script;
+using namespace beans;
+
+
+DialogModelProvider::DialogModelProvider(Reference< XComponentContext > const & context) :
+ m_xContext(context)
+{}
+
+// lang::XInitialization:
+void SAL_CALL DialogModelProvider::initialize(const css::uno::Sequence< uno::Any > & aArguments) throw (css::uno::RuntimeException, css::uno::Exception)
+{
+ if ( aArguments.getLength() == 1 )
+ {
+ ::rtl::OUString sURL;
+ if ( !( aArguments[ 0 ] >>= sURL ))
+ throw css::lang::IllegalArgumentException();
+ // Try any other URL with SimpleFileAccess
+ Reference< XMultiComponentFactory > xSMgr( m_xContext->getServiceManager(), UNO_QUERY_THROW );
+ Reference< ucb::XSimpleFileAccess > xSFI =
+ Reference< ucb::XSimpleFileAccess >( xSMgr->createInstanceWithContext
+ ( ::rtl::OUString::createFromAscii( "com.sun.star.ucb.SimpleFileAccess" ), m_xContext ), UNO_QUERY );
+
+ try
+ {
+ Reference< io::XInputStream > xInput = xSFI->openFileRead( sURL );
+ Reference< resource::XStringResourceManager > xStringResourceManager;
+ if ( xInput.is() )
+ {
+ xStringResourceManager = dlgprov::lcl_getStringResourceManager(m_xContext,sURL);
+ Any aDialogSourceURLAny;
+ aDialogSourceURLAny <<= sURL;
+
+ m_xDialogModel.set( dlgprov::lcl_createDialogModel( m_xContext,xInput , xStringResourceManager, aDialogSourceURLAny ), UNO_QUERY_THROW);
+ m_xDialogModelProp.set(m_xDialogModel, UNO_QUERY_THROW);
+ }
+ }
+ catch( Exception& )
+ {}
+ //m_sURL = sURL;
+ }
+}
+
+// container::XElementAccess:
+uno::Type SAL_CALL DialogModelProvider::getElementType() throw (css::uno::RuntimeException)
+{
+ return m_xDialogModel->getElementType();
+}
+
+::sal_Bool SAL_CALL DialogModelProvider::hasElements() throw (css::uno::RuntimeException)
+{
+ return m_xDialogModel->hasElements();
+}
+
+// container::XNameAccess:
+uno::Any SAL_CALL DialogModelProvider::getByName(const ::rtl::OUString & aName) throw (css::uno::RuntimeException, css::container::NoSuchElementException, css::lang::WrappedTargetException)
+{
+ return m_xDialogModel->getByName(aName);
+}
+
+css::uno::Sequence< ::rtl::OUString > SAL_CALL DialogModelProvider::getElementNames() throw (css::uno::RuntimeException)
+{
+ return m_xDialogModel->getElementNames();
+}
+
+::sal_Bool SAL_CALL DialogModelProvider::hasByName(const ::rtl::OUString & aName) throw (css::uno::RuntimeException)
+{
+ return m_xDialogModel->hasByName(aName);
+}
+
+// container::XNameReplace:
+void SAL_CALL DialogModelProvider::replaceByName(const ::rtl::OUString & aName, const uno::Any & aElement) throw (css::uno::RuntimeException, css::lang::IllegalArgumentException, css::container::NoSuchElementException, css::lang::WrappedTargetException)
+{
+ m_xDialogModel->replaceByName(aName,aElement);
+}
+
+// container::XNameContainer:
+void SAL_CALL DialogModelProvider::insertByName(const ::rtl::OUString & aName, const uno::Any & aElement) throw (css::uno::RuntimeException, css::lang::IllegalArgumentException, css::container::ElementExistException, css::lang::WrappedTargetException)
+{
+ m_xDialogModel->insertByName(aName,aElement);
+}
+
+void SAL_CALL DialogModelProvider::removeByName(const ::rtl::OUString & aName) throw (css::uno::RuntimeException, css::container::NoSuchElementException, css::lang::WrappedTargetException)
+{
+ m_xDialogModel->removeByName(aName);
+}
+uno::Reference< beans::XPropertySetInfo > SAL_CALL DialogModelProvider::getPropertySetInfo( ) throw (uno::RuntimeException)
+{
+ return m_xDialogModelProp->getPropertySetInfo();
+}
+void SAL_CALL DialogModelProvider::setPropertyValue( const ::rtl::OUString&, const uno::Any& ) throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
+{
+}
+uno::Any SAL_CALL DialogModelProvider::getPropertyValue( const ::rtl::OUString& PropertyName ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ return m_xDialogModelProp->getPropertyValue(PropertyName);
+}
+void SAL_CALL DialogModelProvider::addPropertyChangeListener( const ::rtl::OUString& , const uno::Reference< beans::XPropertyChangeListener >& ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
+{
+}
+void SAL_CALL DialogModelProvider::removePropertyChangeListener( const ::rtl::OUString& , const uno::Reference< beans::XPropertyChangeListener >& ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
+{
+}
+void SAL_CALL DialogModelProvider::addVetoableChangeListener( const ::rtl::OUString& , const uno::Reference< beans::XVetoableChangeListener >& ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
+{
+}
+void SAL_CALL DialogModelProvider::removeVetoableChangeListener( const ::rtl::OUString& ,const uno::Reference< beans::XVetoableChangeListener >& ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
+{
+}
+
+// com.sun.star.uno.XServiceInfo:
+::rtl::OUString SAL_CALL DialogModelProvider::getImplementationName() throw (css::uno::RuntimeException)
+{
+ return comp_DialogModelProvider::_getImplementationName();
+}
+
+::sal_Bool SAL_CALL DialogModelProvider::supportsService(::rtl::OUString const & serviceName) throw (css::uno::RuntimeException)
+{
+ css::uno::Sequence< ::rtl::OUString > serviceNames = comp_DialogModelProvider::_getSupportedServiceNames();
+ for (::sal_Int32 i = 0; i < serviceNames.getLength(); ++i) {
+ if (serviceNames[i] == serviceName)
+ return sal_True;
+ }
+ return sal_False;
+}
+
+css::uno::Sequence< ::rtl::OUString > SAL_CALL DialogModelProvider::getSupportedServiceNames() throw (css::uno::RuntimeException)
+{
+ return comp_DialogModelProvider::_getSupportedServiceNames();
+}
+
+} // closing anonymous implementation namespace
+
diff --git a/scripting/source/dlgprov/DialogModelProvider.hxx b/scripting/source/dlgprov/DialogModelProvider.hxx
new file mode 100755
index 000000000000..bc74dfe661dd
--- /dev/null
+++ b/scripting/source/dlgprov/DialogModelProvider.hxx
@@ -0,0 +1,92 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org 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 version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "sal/config.h"
+#include "cppuhelper/factory.hxx"
+#include "cppuhelper/implbase4.hxx"
+#include "com/sun/star/lang/XInitialization.hpp"
+#include "com/sun/star/container/XNameContainer.hpp"
+#include "com/sun/star/lang/XServiceInfo.hpp"
+#include "com/sun/star/beans/XPropertySet.hpp"
+
+/// anonymous implementation namespace
+namespace dlgprov{
+
+namespace css = ::com::sun::star;
+
+class DialogModelProvider:
+ public ::cppu::WeakImplHelper4<
+ css::lang::XInitialization,
+ css::container::XNameContainer,
+ css::beans::XPropertySet,
+ css::lang::XServiceInfo>
+{
+public:
+ explicit DialogModelProvider(css::uno::Reference< css::uno::XComponentContext > const & context);
+private:
+ // ::com::sun::star::lang::XInitialization:
+ virtual void SAL_CALL initialize(const css::uno::Sequence< ::com::sun::star::uno::Any > & aArguments) throw (css::uno::RuntimeException, css::uno::Exception);
+
+ // ::com::sun::star::container::XElementAccess:
+ virtual ::com::sun::star::uno::Type SAL_CALL getElementType() throw (css::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL hasElements() throw (css::uno::RuntimeException);
+
+ // ::com::sun::star::container::XNameAccess:
+ virtual ::com::sun::star::uno::Any SAL_CALL getByName(const ::rtl::OUString & aName) throw (css::uno::RuntimeException, css::container::NoSuchElementException, css::lang::WrappedTargetException);
+ virtual css::uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames() throw (css::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL hasByName(const ::rtl::OUString & aName) throw (css::uno::RuntimeException);
+
+ // ::com::sun::star::container::XNameReplace:
+ virtual void SAL_CALL replaceByName(const ::rtl::OUString & aName, const ::com::sun::star::uno::Any & aElement) throw (css::uno::RuntimeException, css::lang::IllegalArgumentException, css::container::NoSuchElementException, css::lang::WrappedTargetException);
+
+ // ::com::sun::star::container::XNameContainer:
+ virtual void SAL_CALL insertByName(const ::rtl::OUString & aName, const ::com::sun::star::uno::Any & aElement) throw (css::uno::RuntimeException, css::lang::IllegalArgumentException, css::container::ElementExistException, css::lang::WrappedTargetException);
+ virtual void SAL_CALL removeByName(const ::rtl::OUString & Name) throw (css::uno::RuntimeException, css::container::NoSuchElementException, css::lang::WrappedTargetException);
+
+ // ::com::sun::star::lang::XServiceInfo:
+ virtual ::rtl::OUString SAL_CALL getImplementationName() throw (css::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL supportsService(const ::rtl::OUString & ServiceName) throw (css::uno::RuntimeException);
+ virtual css::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw (css::uno::RuntimeException);
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+
+private:
+ DialogModelProvider(const DialogModelProvider &); // not defined
+ DialogModelProvider& operator=(const DialogModelProvider &); // not defined
+
+ // destructor is private and will be called indirectly by the release call virtual ~DialogModelProvider() {}
+
+ css::uno::Reference< css::uno::XComponentContext > m_xContext;
+ css::uno::Reference< css::container::XNameContainer> m_xDialogModel;
+ css::uno::Reference< css::beans::XPropertySet> m_xDialogModelProp;
+};
+} // closing anonymous implementation namespace
diff --git a/scripting/source/dlgprov/dlgevtatt.cxx b/scripting/source/dlgprov/dlgevtatt.cxx
index 02eb6495b464..02eb6495b464 100644..100755
--- a/scripting/source/dlgprov/dlgevtatt.cxx
+++ b/scripting/source/dlgprov/dlgevtatt.cxx
diff --git a/scripting/source/dlgprov/dlgevtatt.hxx b/scripting/source/dlgprov/dlgevtatt.hxx
index 2096aa41097d..2096aa41097d 100644..100755
--- a/scripting/source/dlgprov/dlgevtatt.hxx
+++ b/scripting/source/dlgprov/dlgevtatt.hxx
diff --git a/scripting/source/dlgprov/dlgprov.component b/scripting/source/dlgprov/dlgprov.component
new file mode 100755
index 000000000000..f7ceed336cf6
--- /dev/null
+++ b/scripting/source/dlgprov/dlgprov.component
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org 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 version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.scripting.DialogProvider">
+ <service name="com.sun.star.awt.ContainerWindowProvider"/>
+ <service name="com.sun.star.awt.DialogProvider"/>
+ <service name="com.sun.star.awt.DialogProvider2"/>
+ </implementation>
+</component>
diff --git a/scripting/source/dlgprov/dlgprov.cxx b/scripting/source/dlgprov/dlgprov.cxx
index 4a8485dd246b..c847a4a152db 100644..100755
--- a/scripting/source/dlgprov/dlgprov.cxx
+++ b/scripting/source/dlgprov/dlgprov.cxx
@@ -29,6 +29,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_scripting.hxx"
+#include "DialogModelProvider.hxx"
#include "dlgprov.hxx"
#include "dlgevtatt.hxx"
#include <com/sun/star/awt/XControlContainer.hpp>
@@ -61,20 +62,103 @@
#include <util/MiscUtils.hxx>
using namespace ::com::sun::star;
-using namespace ::com::sun::star::awt;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::script;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::document;
+using namespace awt;
+using namespace lang;
+using namespace uno;
+using namespace script;
+using namespace beans;
+using namespace document;
using namespace ::sf_misc;
+// component helper namespace
+namespace comp_DialogModelProvider
+{
+
+ ::rtl::OUString SAL_CALL _getImplementationName()
+ {
+ return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DialogModelProvider"));
+ }
+
+ uno::Sequence< ::rtl::OUString > SAL_CALL _getSupportedServiceNames()
+ {
+ uno::Sequence< ::rtl::OUString > s(1);
+ s[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlDialogModelProvider"));
+ return s;
+ }
+
+ uno::Reference< uno::XInterface > SAL_CALL _create(const uno::Reference< uno::XComponentContext > & context) SAL_THROW((uno::Exception))
+ {
+ return static_cast< ::cppu::OWeakObject * >(new dlgprov::DialogModelProvider(context));
+ }
+} // closing component helper namespace
//.........................................................................
namespace dlgprov
{
//.........................................................................
static ::rtl::OUString aResourceResolverPropName(RTL_CONSTASCII_USTRINGPARAM("ResourceResolver"));
+
+ Reference< resource::XStringResourceManager > lcl_getStringResourceManager(const Reference< XComponentContext >& i_xContext,const ::rtl::OUString& i_sURL)
+ {
+ INetURLObject aInetObj( i_sURL );
+ ::rtl::OUString aDlgName = aInetObj.GetBase();
+ aInetObj.removeSegment();
+ ::rtl::OUString aDlgLocation = aInetObj.GetMainURL( INetURLObject::NO_DECODE );
+ bool bReadOnly = true;
+ ::com::sun::star::lang::Locale aLocale = Application::GetSettings().GetUILocale();
+ ::rtl::OUString aComment;
+
+ Sequence<Any> aArgs( 6 );
+ aArgs[0] <<= aDlgLocation;
+ aArgs[1] <<= bReadOnly;
+ aArgs[2] <<= aLocale;
+ aArgs[3] <<= aDlgName;
+ aArgs[4] <<= aComment;
+
+ Reference< task::XInteractionHandler > xDummyHandler;
+ aArgs[5] <<= xDummyHandler;
+ Reference< XMultiComponentFactory > xSMgr_( i_xContext->getServiceManager(), UNO_QUERY_THROW );
+ // TODO: Ctor
+ Reference< resource::XStringResourceManager > xStringResourceManager( xSMgr_->createInstanceWithContext
+ ( ::rtl::OUString::createFromAscii( "com.sun.star.resource.StringResourceWithLocation" ),
+ i_xContext ), UNO_QUERY );
+ if( xStringResourceManager.is() )
+ {
+ Reference< XInitialization > xInit( xStringResourceManager, UNO_QUERY );
+ if( xInit.is() )
+ xInit->initialize( aArgs );
+ }
+ return xStringResourceManager;
+ }
+ Reference< container::XNameContainer > lcl_createControlModel(const Reference< XComponentContext >& i_xContext)
+ {
+ Reference< XMultiComponentFactory > xSMgr_( i_xContext->getServiceManager(), UNO_QUERY_THROW );
+ Reference< container::XNameContainer > xControlModel( xSMgr_->createInstanceWithContext( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.UnoControlDialogModel" ) ), i_xContext ), UNO_QUERY_THROW );
+ return xControlModel;
+ }
+ Reference< container::XNameContainer > lcl_createDialogModel( const Reference< XComponentContext >& i_xContext,
+ const Reference< io::XInputStream >& xInput,
+ const Reference< resource::XStringResourceManager >& xStringResourceManager,
+ const Any &aDialogSourceURL) throw ( Exception )
+ {
+ Reference< container::XNameContainer > xDialogModel( lcl_createControlModel(i_xContext) );
+
+ ::rtl::OUString aDlgSrcUrlPropName( RTL_CONSTASCII_USTRINGPARAM( "DialogSourceURL" ) );
+ Reference< beans::XPropertySet > xDlgPropSet( xDialogModel, UNO_QUERY );
+ xDlgPropSet->setPropertyValue( aDlgSrcUrlPropName, aDialogSourceURL );
+
+ ::xmlscript::importDialogModel( xInput, xDialogModel, i_xContext );
+ // Set resource property
+ if( xStringResourceManager.is() )
+ {
+ Reference< beans::XPropertySet > xDlgPSet( xDialogModel, UNO_QUERY );
+ Any aStringResourceManagerAny;
+ aStringResourceManagerAny <<= xStringResourceManager;
+ xDlgPSet->setPropertyValue( aResourceResolverPropName, aStringResourceManagerAny );
+ }
+
+ return xDialogModel;
+ }
// =============================================================================
// component operations
// =============================================================================
@@ -174,9 +258,7 @@ static ::rtl::OUString aResourceResolverPropName(RTL_CONSTASCII_USTRINGPARAM("Re
Reference< container::XNameContainer > DialogProviderImpl::createControlModel() throw ( Exception )
{
- Reference< XMultiComponentFactory > xSMgr_( m_xContext->getServiceManager(), UNO_QUERY_THROW );
- Reference< container::XNameContainer > xControlModel( xSMgr_->createInstanceWithContext( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.UnoControlDialogModel" ) ), m_xContext ), UNO_QUERY_THROW );
- return xControlModel;
+ return lcl_createControlModel(m_xContext);
}
Reference< container::XNameContainer > DialogProviderImpl::createDialogModel(
@@ -184,14 +266,9 @@ static ::rtl::OUString aResourceResolverPropName(RTL_CONSTASCII_USTRINGPARAM("Re
const Reference< resource::XStringResourceManager >& xStringResourceManager,
const Any &aDialogSourceURL) throw ( Exception )
{
- Reference< container::XNameContainer > xDialogModel( createControlModel() );
- ::rtl::OUString aDlgSrcUrlPropName( RTL_CONSTASCII_USTRINGPARAM( "DialogSourceURL" ) );
- Reference< beans::XPropertySet > xDlgPropSet( xDialogModel, UNO_QUERY );
- xDlgPropSet->setPropertyValue( aDlgSrcUrlPropName, aDialogSourceURL );
// #TODO we really need to detect the source of the Dialog, is it
- // located in the document or not. m_xModel need not be the location of
// the dialog. E.g. if the dialog was created from basic ( then we just
// can't tell where its from )
// If we are happy to always substitute the form model for the awt
@@ -199,16 +276,7 @@ static ::rtl::OUString aResourceResolverPropName(RTL_CONSTASCII_USTRINGPARAM("Re
// swapping out the models ( or perhaps we only want to do this
// for vba mode ) there are a number of feasible and valid possibilities
::xmlscript::importDialogModel( xInput, xDialogModel, m_xContext, m_xModel );
- // Set resource property
- if( xStringResourceManager.is() )
- {
- Reference< beans::XPropertySet > xDlgPSet( xDialogModel, UNO_QUERY );
- Any aStringResourceManagerAny;
- aStringResourceManagerAny <<= xStringResourceManager;
- xDlgPSet->setPropertyValue( aResourceResolverPropName, aStringResourceManagerAny );
- }
-
- return xDialogModel;
+ return lcl_createDialogModel(m_xContext,xInput,xStringResourceManager,aDialogSourceURL);
}
Reference< XControlModel > DialogProviderImpl::createDialogModelForBasic() throw ( Exception )
@@ -289,8 +357,8 @@ static ::rtl::OUString aResourceResolverPropName(RTL_CONSTASCII_USTRINGPARAM("Re
bSingleDialog = true;
// Try any other URL with SimpleFileAccess
- Reference< ::com::sun::star::ucb::XSimpleFileAccess > xSFI =
- Reference< ::com::sun::star::ucb::XSimpleFileAccess >( xSMgr->createInstanceWithContext
+ Reference< ucb::XSimpleFileAccess > xSFI =
+ Reference< ucb::XSimpleFileAccess >( xSMgr->createInstanceWithContext
( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ucb.SimpleFileAccess")), m_xContext ), UNO_QUERY );
try
@@ -422,34 +490,7 @@ static ::rtl::OUString aResourceResolverPropName(RTL_CONSTASCII_USTRINGPARAM("Re
Reference< resource::XStringResourceManager > xStringResourceManager;
if( bSingleDialog )
{
- INetURLObject aInetObj( aURL );
- ::rtl::OUString aDlgName = aInetObj.GetBase();
- aInetObj.removeSegment();
- ::rtl::OUString aDlgLocation = aInetObj.GetMainURL( INetURLObject::NO_DECODE );
- bool bReadOnly = true;
- ::com::sun ::star::lang::Locale aLocale = Application::GetSettings().GetUILocale();
- ::rtl::OUString aComment;
-
- Sequence<Any> aArgs( 6 );
- aArgs[0] <<= aDlgLocation;
- aArgs[1] <<= bReadOnly;
- aArgs[2] <<= aLocale;
- aArgs[3] <<= aDlgName;
- aArgs[4] <<= aComment;
-
- Reference< task::XInteractionHandler > xDummyHandler;
- aArgs[5] <<= xDummyHandler;
- Reference< XMultiComponentFactory > xSMgr_( m_xContext->getServiceManager(), UNO_QUERY_THROW );
- // TODO: Ctor
- xStringResourceManager = Reference< resource::XStringResourceManager >( xSMgr_->createInstanceWithContext
- ( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.resource.StringResourceWithLocation")),
- m_xContext ), UNO_QUERY );
- if( xStringResourceManager.is() )
- {
- Reference< XInitialization > xInit( xStringResourceManager, UNO_QUERY );
- if( xInit.is() )
- xInit->initialize( aArgs );
- }
+ xStringResourceManager = lcl_getStringResourceManager(m_xContext,aURL);
}
else if( xDialogLib.is() )
{
@@ -805,7 +846,7 @@ static ::rtl::OUString aResourceResolverPropName(RTL_CONSTASCII_USTRINGPARAM("Re
Reference< XWindow > DialogProviderImpl::createContainerWindow(
const ::rtl::OUString& URL, const ::rtl::OUString& WindowType,
const Reference< XWindowPeer >& xParent, const Reference< XInterface >& xHandler )
- throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException)
+ throw (lang::IllegalArgumentException, RuntimeException)
{
(void)WindowType; // for future use
if( !xParent.is() )
@@ -835,11 +876,8 @@ static ::rtl::OUString aResourceResolverPropName(RTL_CONSTASCII_USTRINGPARAM("Re
static struct ::cppu::ImplementationEntry s_component_entries [] =
{
- {
- create_DialogProviderImpl, getImplementationName_DialogProviderImpl,
- getSupportedServiceNames_DialogProviderImpl, ::cppu::createSingleComponentFactory,
- 0, 0
- },
+ {create_DialogProviderImpl, getImplementationName_DialogProviderImpl,getSupportedServiceNames_DialogProviderImpl, ::cppu::createSingleComponentFactory,0, 0},
+ { &comp_DialogModelProvider::_create,&comp_DialogModelProvider::_getImplementationName,&comp_DialogModelProvider::_getSupportedServiceNames,&::cppu::createSingleComponentFactory, 0, 0 },
{ 0, 0, 0, 0, 0, 0 }
};
@@ -864,13 +902,6 @@ extern "C"
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
- sal_Bool SAL_CALL component_writeInfo(
- lang::XMultiServiceFactory * pServiceManager, registry::XRegistryKey * pRegistryKey )
- {
- return ::cppu::component_writeInfoHelper(
- pServiceManager, pRegistryKey, ::dlgprov::s_component_entries );
- }
-
void * SAL_CALL component_getFactory(
const sal_Char * pImplName, lang::XMultiServiceFactory * pServiceManager,
registry::XRegistryKey * pRegistryKey )
diff --git a/scripting/source/dlgprov/dlgprov.hxx b/scripting/source/dlgprov/dlgprov.hxx
index 43aa99592ff9..2545961a3d5e 100644..100755
--- a/scripting/source/dlgprov/dlgprov.hxx
+++ b/scripting/source/dlgprov/dlgprov.hxx
@@ -62,6 +62,13 @@ namespace dlgprov
// =============================================================================
// class DialogProviderImpl
// =============================================================================
+ ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > lcl_createControlModel(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& i_xContext);
+ ::com::sun::star::uno::Reference< ::com::sun::star::resource::XStringResourceManager > lcl_getStringResourceManager(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& i_xContext,const ::rtl::OUString& i_sURL);
+ ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > lcl_createDialogModel(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& i_xContext,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xInput,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::resource::XStringResourceManager >& xStringResourceManager,
+ const ::com::sun::star::uno::Any &aDialogSourceURL) throw ( ::com::sun::star::uno::Exception );
typedef ::cppu::WeakImplHelper4<
::com::sun::star::lang::XServiceInfo,
diff --git a/scripting/source/dlgprov/dlgprov.xml b/scripting/source/dlgprov/dlgprov.xml
index 556cc3fe2253..556cc3fe2253 100644..100755
--- a/scripting/source/dlgprov/dlgprov.xml
+++ b/scripting/source/dlgprov/dlgprov.xml
diff --git a/scripting/source/dlgprov/makefile.mk b/scripting/source/dlgprov/makefile.mk
index 6c8ec298c760..51f834132129 100644..100755
--- a/scripting/source/dlgprov/makefile.mk
+++ b/scripting/source/dlgprov/makefile.mk
@@ -41,6 +41,7 @@ DLLPRE =
SLOFILES= \
$(SLO)$/dlgprov.obj \
+ $(SLO)$/DialogModelProvider.obj \
$(SLO)$/dlgevtatt.obj
SHL1TARGET= $(TARGET)$(DLLPOSTFIX).uno
@@ -58,6 +59,7 @@ SHL1STDLIBS= \
$(CPPUHELPERLIB) \
$(COMPHELPERLIB) \
$(UCBHELPERLIB) \
+ $(VBAHELPERLIB) \
$(CPPULIB) \
$(BASICLIB) \
$(SALLIB)
@@ -80,3 +82,11 @@ $(MISC)$/$(TARGET).don : $(SOLARBINDIR)$/oovbaapi.rdb
+$(CPPUMAKER) -O$(INCCOM)$/$(TARGET) -BUCR $(SOLARBINDIR)$/oovbaapi.rdb -X$(SOLARBINDIR)$/types.rdb && echo > $@
echo $@
+
+ALLTAR : $(MISC)/dlgprov.component
+
+$(MISC)/dlgprov.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ dlgprov.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt dlgprov.component
diff --git a/scripting/source/inc/bcholder.hxx b/scripting/source/inc/bcholder.hxx
index 4b1b7db84b7a..4b1b7db84b7a 100644..100755
--- a/scripting/source/inc/bcholder.hxx
+++ b/scripting/source/inc/bcholder.hxx
diff --git a/scripting/source/inc/util/MiscUtils.hxx b/scripting/source/inc/util/MiscUtils.hxx
index 149f46e8d53c..149f46e8d53c 100644..100755
--- a/scripting/source/inc/util/MiscUtils.hxx
+++ b/scripting/source/inc/util/MiscUtils.hxx
diff --git a/scripting/source/inc/util/scriptingconstants.hxx b/scripting/source/inc/util/scriptingconstants.hxx
index ca880a5cc216..ca880a5cc216 100644..100755
--- a/scripting/source/inc/util/scriptingconstants.hxx
+++ b/scripting/source/inc/util/scriptingconstants.hxx
diff --git a/scripting/source/inc/util/util.hxx b/scripting/source/inc/util/util.hxx
index 2b6998654192..09ad3bf1e3c3 100644..100755
--- a/scripting/source/inc/util/util.hxx
+++ b/scripting/source/inc/util/util.hxx
@@ -30,23 +30,8 @@
#ifndef _COM_SUN_STAR_SCRIPTING_UTIL_UTIL_HXX_
#define _COM_SUN_STAR_SCRIPTING_UTIL_UTIL_HXX_
-#include <rtl/ustrbuf.hxx>
-#include <osl/diagnose.h>
-
#define OUSTR(x) ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(x) )
-namespace scripting_util
-{
- inline void validateXRef(::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > xRef, const sal_Char* Msg) throw (::com::sun::star::uno::RuntimeException)
- {
- OSL_ENSURE( xRef.is(), Msg );
-
- if(!xRef.is())
- {
- throw ::com::sun::star::uno::RuntimeException(::rtl::OUString::createFromAscii(Msg), ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >());
- }
- }
-}
#endif //_COM_SUN_STAR_SCRIPTING_UTIL_UTIL_HXX_
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/scripting/source/protocolhandler/exports.dxp b/scripting/source/protocolhandler/exports.dxp
index 9630d7e06768..f0e1c69934bc 100644..100755
--- a/scripting/source/protocolhandler/exports.dxp
+++ b/scripting/source/protocolhandler/exports.dxp
@@ -1,3 +1,2 @@
component_getImplementationEnvironment
-component_writeInfo
component_getFactory
diff --git a/scripting/source/protocolhandler/makefile.mk b/scripting/source/protocolhandler/makefile.mk
index c782c1a188f5..5a2e92bbbac3 100644..100755
--- a/scripting/source/protocolhandler/makefile.mk
+++ b/scripting/source/protocolhandler/makefile.mk
@@ -45,6 +45,7 @@ SHL1TARGET= $(TARGET)$(DLLPOSTFIX)
SHL1STDLIBS= \
$(SFXLIB) \
+ $(FWELIB) \
$(CPPULIB) \
$(CPPUHELPERLIB) \
$(VCLLIB) \
@@ -61,3 +62,11 @@ DEF1EXPORTFILE= exports.dxp
# --- Targets ------------------------------------------------------
.INCLUDE : target.mk
+
+ALLTAR : $(MISC)/protocolhandler.component
+
+$(MISC)/protocolhandler.component .ERRREMOVE : \
+ $(SOLARENV)/bin/createcomponent.xslt protocolhandler.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt protocolhandler.component
diff --git a/scripting/source/protocolhandler/protocolhandler.component b/scripting/source/protocolhandler/protocolhandler.component
new file mode 100755
index 000000000000..db177a896ca4
--- /dev/null
+++ b/scripting/source/protocolhandler/protocolhandler.component
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org 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 version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.ScriptProtocolHandler">
+ <service name="com.sun.star.frame.ProtocolHandler"/>
+ </implementation>
+</component>
diff --git a/scripting/source/protocolhandler/scripthandler.cxx b/scripting/source/protocolhandler/scripthandler.cxx
index dce9ddee15f5..3c2f97a040ba 100644..100755
--- a/scripting/source/protocolhandler/scripthandler.cxx
+++ b/scripting/source/protocolhandler/scripthandler.cxx
@@ -50,10 +50,12 @@
#include <sfx2/frame.hxx>
#include <sfx2/sfxdlg.hxx>
#include <vcl/abstdlg.hxx>
+#include <tools/diagnose_ex.h>
#include <cppuhelper/factory.hxx>
#include <cppuhelper/exc_hlp.hxx>
#include <util/util.hxx>
+#include <framework/documentundoguard.hxx>
#include "com/sun/star/uno/XComponentContext.hpp"
#include "com/sun/star/uri/XUriReference.hpp"
@@ -70,7 +72,6 @@ using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::script;
using namespace ::com::sun::star::script::provider;
using namespace ::com::sun::star::document;
-using namespace ::scripting_util;
namespace scripting_protocolhandler
{
@@ -98,8 +99,7 @@ void SAL_CALL ScriptProtocolHandler::initialize(
throw RuntimeException( temp, Reference< XInterface >() );
}
- validateXRef( m_xFactory,
- "ScriptProtocolHandler::initialize: No Service Manager available" );
+ ENSURE_OR_THROW( m_xFactory.is(), "ScriptProtocolHandler::initialize: No Service Manager available" );
m_bInitialised = true;
}
@@ -156,14 +156,14 @@ void SAL_CALL ScriptProtocolHandler::dispatchWithNotification(
sal_Bool bSuccess = sal_False;
Any invokeResult;
- bool bCaughtException = FALSE;
+ bool bCaughtException = sal_False;
Any aException;
if ( m_bInitialised )
{
try
{
- bool bIsDocumentScript = ( aURL.Complete.indexOf( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("document")) ) !=-1 );
+ bool bIsDocumentScript = ( aURL.Complete.indexOfAsciiL( RTL_CONSTASCII_STRINGPARAM( "document" ) ) !=-1 );
// TODO: isn't this somewhat strange? This should be a test for a location=document parameter, shouldn't it?
if ( bIsDocumentScript )
@@ -183,7 +183,7 @@ void SAL_CALL ScriptProtocolHandler::dispatchWithNotification(
Reference< provider::XScript > xFunc =
m_xScriptProvider->getScript( aURL.Complete );
- validateXRef( xFunc,
+ ENSURE_OR_THROW( xFunc.is(),
"ScriptProtocolHandler::dispatchWithNotification: validate xFunc - unable to obtain XScript interface" );
@@ -208,6 +208,11 @@ void SAL_CALL ScriptProtocolHandler::dispatchWithNotification(
}
}
+ // attempt to protect the document against the script tampering with its Undo Context
+ ::std::auto_ptr< ::framework::DocumentUndoGuard > pUndoGuard;
+ if ( bIsDocumentScript )
+ pUndoGuard.reset( new ::framework::DocumentUndoGuard( m_xScriptInvocation ) );
+
bSuccess = sal_False;
while ( !bSuccess )
{
@@ -247,18 +252,8 @@ void SAL_CALL ScriptProtocolHandler::dispatchWithNotification(
invokeResult <<= reason.concat( aException.getValueTypeName() ).concat( e.Message );
- bCaughtException = TRUE;
- }
-#ifdef _DEBUG
- catch ( ... )
- {
- ::rtl::OUString reason(RTL_CONSTASCII_USTRINGPARAM(
- "ScriptProtocolHandler::dispatch: caught unknown exception" ));
-
- invokeResult <<= reason;
+ bCaughtException = sal_True;
}
-#endif
-
}
else
{
@@ -359,13 +354,11 @@ ScriptProtocolHandler::getScriptInvocation()
return m_xScriptInvocation.is();
}
-void
-ScriptProtocolHandler::createScriptProvider()
+void ScriptProtocolHandler::createScriptProvider()
{
if ( m_xScriptProvider.is() )
- {
return;
- }
+
try
{
// first, ask the component supporting the XScriptInvocationContext interface
@@ -398,6 +391,7 @@ ScriptProtocolHandler::createScriptProvider()
m_xScriptProvider = xSPS->getScriptProvider();
}
+ // if nothing of this is successful, use the master script provider
if ( !m_xScriptProvider.is() )
{
Reference< XPropertySet > xProps( m_xFactory, UNO_QUERY_THROW );
@@ -431,15 +425,6 @@ ScriptProtocolHandler::createScriptProvider()
::rtl::OUString temp = OUSTR( "ScriptProtocolHandler::createScriptProvider: " );
throw RuntimeException( temp.concat( e.Message ), Reference< XInterface >() );
}
-#ifdef _DEBUG
- catch ( ... )
- {
- throw RuntimeException(
- OUSTR( "ScriptProtocolHandler::createScriptProvider: UnknownException: " ),
- Reference< XInterface > () );
- }
-#endif
-
}
ScriptProtocolHandler::ScriptProtocolHandler(
@@ -538,27 +523,6 @@ extern "C"
*ppEnvironmentTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME ;
}
- sal_Bool SAL_CALL component_writeInfo( void * pServiceManager ,
- void * pRegistryKey )
- {
- (void)pServiceManager;
-
- Reference< css::registry::XRegistryKey > xKey(
- reinterpret_cast< css::registry::XRegistryKey* >( pRegistryKey ) ) ;
-
- ::rtl::OUString aStr = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/" ) );
- aStr +=
- ::scripting_protocolhandler::ScriptProtocolHandler::impl_getStaticImplementationName();
-
- aStr += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/UNO/SERVICES" ) );
- Reference< css::registry::XRegistryKey > xNewKey = xKey->createKey( aStr );
- xNewKey->createKey(
- ::rtl::OUString::createFromAscii( ::scripting_protocolhandler::MYSERVICENAME )
- );
-
- return sal_True;
- }
-
void* SAL_CALL component_getFactory( const sal_Char * pImplementationName ,
void * pServiceManager ,
void * pRegistryKey )
diff --git a/scripting/source/protocolhandler/scripthandler.hxx b/scripting/source/protocolhandler/scripthandler.hxx
index cf3c68cc3341..cf3c68cc3341 100644..100755
--- a/scripting/source/protocolhandler/scripthandler.hxx
+++ b/scripting/source/protocolhandler/scripthandler.hxx
diff --git a/scripting/source/provider/ActiveMSPList.cxx b/scripting/source/provider/ActiveMSPList.cxx
index 226951ff9fbd..a1fef891bb55 100644..100755
--- a/scripting/source/provider/ActiveMSPList.cxx
+++ b/scripting/source/provider/ActiveMSPList.cxx
@@ -50,7 +50,6 @@
using namespace com::sun::star;
using namespace com::sun::star::uno;
using namespace com::sun::star::script;
-using namespace ::scripting_util;
using namespace ::sf_misc;
namespace func_provider
diff --git a/scripting/source/provider/ActiveMSPList.hxx b/scripting/source/provider/ActiveMSPList.hxx
index 42964cd0b4fd..42964cd0b4fd 100644..100755
--- a/scripting/source/provider/ActiveMSPList.hxx
+++ b/scripting/source/provider/ActiveMSPList.hxx
diff --git a/scripting/source/provider/BrowseNodeFactoryImpl.cxx b/scripting/source/provider/BrowseNodeFactoryImpl.cxx
index 434e7d962eb4..434e7d962eb4 100644..100755
--- a/scripting/source/provider/BrowseNodeFactoryImpl.cxx
+++ b/scripting/source/provider/BrowseNodeFactoryImpl.cxx
diff --git a/scripting/source/provider/BrowseNodeFactoryImpl.hxx b/scripting/source/provider/BrowseNodeFactoryImpl.hxx
index 9594b6f6f067..9594b6f6f067 100644..100755
--- a/scripting/source/provider/BrowseNodeFactoryImpl.hxx
+++ b/scripting/source/provider/BrowseNodeFactoryImpl.hxx
diff --git a/scripting/source/provider/MasterScriptProvider.cxx b/scripting/source/provider/MasterScriptProvider.cxx
index b326bf6a31bf..28be68cb0391 100644..100755
--- a/scripting/source/provider/MasterScriptProvider.cxx
+++ b/scripting/source/provider/MasterScriptProvider.cxx
@@ -34,6 +34,8 @@
#include <cppuhelper/implementationentry.hxx>
#include <cppuhelper/exc_hlp.hxx>
#include <cppuhelper/factory.hxx>
+#include <tools/diagnose_ex.h>
+
#include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/lang/EventObject.hpp>
#include <com/sun/star/container/XContentEnumerationAccess.hpp>
@@ -61,7 +63,6 @@ using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::script;
using namespace ::com::sun::star::document;
using namespace ::sf_misc;
-using namespace ::scripting_util;
namespace func_provider
{
@@ -96,10 +97,9 @@ MasterScriptProvider::MasterScriptProvider( const Reference< XComponentContext >
m_xContext( xContext ), m_bIsValid( false ), m_bInitialised( false ),
m_bIsPkgMSP( false ), m_pPCache( 0 )
{
- validateXRef( m_xContext, "MasterScriptProvider::MasterScriptProvider: No context available\n" );
+ ENSURE_OR_THROW( m_xContext.is(), "MasterScriptProvider::MasterScriptProvider: No context available\n" );
m_xMgr = m_xContext->getServiceManager();
- validateXRef( m_xMgr,
- "MasterScriptProvider::MasterScriptProvider: No service manager available\n" );
+ ENSURE_OR_THROW( m_xMgr.is(), "MasterScriptProvider::MasterScriptProvider: No service manager available\n" );
m_bIsValid = true;
}
@@ -982,42 +982,6 @@ extern "C"
}
/**
- * This function creates an implementation section in the registry and another subkey
- *
- * for each supported service.
- * @param pServiceManager the service manager
- * @param pRegistryKey the registry key
- */
- SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(
- lang::XMultiServiceFactory * pServiceManager,
- registry::XRegistryKey * pRegistryKey )
- {
- if (::cppu::component_writeInfoHelper( pServiceManager, pRegistryKey,
- ::scripting_runtimemgr::s_entries ))
- {
- try
- {
- // MasterScriptProviderFactory Mangager singleton
- registry::XRegistryKey * pKey =
- reinterpret_cast< registry::XRegistryKey * >(pRegistryKey);
-
- Reference< registry::XRegistryKey >xKey = pKey->createKey(
- OUSTR("com.sun.star.script.provider.MasterScriptProviderFactory/UNO/SINGLETONS/com.sun.star.script.provider.theMasterScriptProviderFactory"));
- xKey->setStringValue( OUSTR("com.sun.star.script.provider.MasterScriptProviderFactory") );
- // BrowseNodeFactory Mangager singleton
- xKey = pKey->createKey(
- OUSTR("com.sun.star.script.browse.BrowseNodeFactory/UNO/SINGLETONS/com.sun.star.script.browse.theBrowseNodeFactory"));
- xKey->setStringValue( OUSTR("com.sun.star.script.browse.BrowseNodeFactory") );
- return sal_True;
- }
- catch (Exception &)
- {
- }
- }
- return sal_False;
- }
-
- /**
* This function is called to get service factories for an implementation.
*
* @param pImplName name of implementation
diff --git a/scripting/source/provider/MasterScriptProvider.hxx b/scripting/source/provider/MasterScriptProvider.hxx
index 89336a9dadb9..89336a9dadb9 100644..100755
--- a/scripting/source/provider/MasterScriptProvider.hxx
+++ b/scripting/source/provider/MasterScriptProvider.hxx
diff --git a/scripting/source/provider/MasterScriptProviderFactory.cxx b/scripting/source/provider/MasterScriptProviderFactory.cxx
index 946793461ed9..946793461ed9 100644..100755
--- a/scripting/source/provider/MasterScriptProviderFactory.cxx
+++ b/scripting/source/provider/MasterScriptProviderFactory.cxx
diff --git a/scripting/source/provider/MasterScriptProviderFactory.hxx b/scripting/source/provider/MasterScriptProviderFactory.hxx
index 9db031e2e87e..9db031e2e87e 100644..100755
--- a/scripting/source/provider/MasterScriptProviderFactory.hxx
+++ b/scripting/source/provider/MasterScriptProviderFactory.hxx
diff --git a/scripting/source/provider/ProviderCache.cxx b/scripting/source/provider/ProviderCache.cxx
index ae0f0858f6f7..77a7609ddb7f 100644..100755
--- a/scripting/source/provider/ProviderCache.cxx
+++ b/scripting/source/provider/ProviderCache.cxx
@@ -30,6 +30,7 @@
#include "precompiled_scripting.hxx"
#include <cppuhelper/implementationentry.hxx>
#include <cppuhelper/factory.hxx>
+#include <tools/diagnose_ex.h>
#include <util/scriptingconstants.hxx>
#include <util/util.hxx>
@@ -40,7 +41,6 @@
using namespace com::sun::star;
using namespace com::sun::star::uno;
using namespace com::sun::star::script;
-using namespace ::scripting_util;
namespace func_provider
{
@@ -52,7 +52,7 @@ ProviderCache::ProviderCache( const Reference< XComponentContext >& xContext, co
// will use createContentEnumeration
m_xMgr = m_xContext->getServiceManager();
- validateXRef( m_xMgr, "ProviderCache::ProviderCache() failed to obtain ServiceManager" );
+ ENSURE_OR_THROW( m_xMgr.is(), "ProviderCache::ProviderCache() failed to obtain ServiceManager" );
populateCache();
}
@@ -65,7 +65,7 @@ ProviderCache::ProviderCache( const Reference< XComponentContext >& xContext, co
// will use createContentEnumeration
m_xMgr = m_xContext->getServiceManager();
- validateXRef( m_xMgr, "ProviderCache::ProviderCache() failed to obtain ServiceManager" );
+ ENSURE_OR_THROW( m_xMgr.is(), "ProviderCache::ProviderCache() failed to obtain ServiceManager" );
populateCache();
}
@@ -164,14 +164,8 @@ ProviderCache::populateCache() throw ( RuntimeException )
while ( xEnum->hasMoreElements() )
{
- Reference< lang::XSingleComponentFactory > factory;
- if ( sal_False == ( xEnum->nextElement() >>= factory ) )
- {
- throw new RuntimeException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" error extracting XSingleComponentFactory from Content enumeration. ")), Reference< XInterface >() );
- }
- validateXRef( factory, "ProviderCache::populateCache() invalid factory" );
+ Reference< lang::XSingleComponentFactory > factory( xEnum->nextElement(), UNO_QUERY_THROW );
Reference< lang::XServiceInfo > xServiceInfo( factory, UNO_QUERY_THROW );
- validateXRef( xServiceInfo, "ProviderCache::populateCache() failed to get XServiceInfo from factory" );
Sequence< ::rtl::OUString > serviceNames = xServiceInfo->getSupportedServiceNames();
@@ -208,9 +202,8 @@ ProviderCache::createProvider( ProviderDetails& details ) throw ( RuntimeExcepti
{
try
{
- details.provider = Reference< provider::XScriptProvider >(
+ details.provider.set(
details.factory->createInstanceWithArgumentsAndContext( m_Sctx, m_xContext ), UNO_QUERY_THROW );
- validateXRef( details.provider, "ProviderCache::createProvider, failed to create provider");
}
catch ( RuntimeException& e )
{
diff --git a/scripting/source/provider/ProviderCache.hxx b/scripting/source/provider/ProviderCache.hxx
index db1c7d3db70e..db1c7d3db70e 100644..100755
--- a/scripting/source/provider/ProviderCache.hxx
+++ b/scripting/source/provider/ProviderCache.hxx
diff --git a/scripting/source/provider/ScriptImpl.cxx b/scripting/source/provider/ScriptImpl.cxx
index 45c030d6c3ec..10b0f86c0bfc 100644..100755
--- a/scripting/source/provider/ScriptImpl.cxx
+++ b/scripting/source/provider/ScriptImpl.cxx
@@ -47,15 +47,11 @@ ScriptImpl::ScriptImpl(
const Reference< runtime::XScriptInvocation > & runtimeMgr,
const ::rtl::OUString& scriptURI )
throw ( RuntimeException ) :
- m_XScriptingContext( scriptingContext ),
- m_RunTimeManager( runtimeMgr ),
+ m_XScriptingContext( scriptingContext, UNO_SET_THROW ),
+ m_RunTimeManager( runtimeMgr, UNO_SET_THROW ),
m_ScriptURI( scriptURI )
{
OSL_TRACE( "<!constucting a ScriptImpl>\n" );
- validateXRef( m_XScriptingContext,
- "ScriptImpl::ScriptImpl: No XScriptingContext\n" );
- validateXRef( m_RunTimeManager,
- "ScriptImpl::ScriptImpl: No XScriptInvocation\n" );
}
//*************************************************************************
diff --git a/scripting/source/provider/ScriptImpl.hxx b/scripting/source/provider/ScriptImpl.hxx
index be90c11631e8..be90c11631e8 100644..100755
--- a/scripting/source/provider/ScriptImpl.hxx
+++ b/scripting/source/provider/ScriptImpl.hxx
diff --git a/scripting/source/provider/ScriptingContext.cxx b/scripting/source/provider/ScriptingContext.cxx
index 788e4df432e2..063e48ed3094 100644..100755
--- a/scripting/source/provider/ScriptingContext.cxx
+++ b/scripting/source/provider/ScriptingContext.cxx
@@ -56,13 +56,10 @@ namespace func_provider
//*************************************************************************
ScriptingContext::ScriptingContext( const Reference< XComponentContext > & xContext ) : //ScriptingContextImpl_BASE( GetMutex()),
OPropertyContainer( GetBroadcastHelper() ),
- m_xContext( xContext )
+ m_xContext( xContext, UNO_SET_THROW )
{
OSL_TRACE( "< ScriptingContext ctor called >\n" );
- validateXRef( m_xContext,
- "ScriptingContext::ScriptingContext: No context available\n" );
-
Any nullAny;
scripting_constants::ScriptingConstantsPool& scriptingConstantsPool =
diff --git a/scripting/source/provider/ScriptingContext.hxx b/scripting/source/provider/ScriptingContext.hxx
index 97998c25ade5..97998c25ade5 100644..100755
--- a/scripting/source/provider/ScriptingContext.hxx
+++ b/scripting/source/provider/ScriptingContext.hxx
diff --git a/scripting/source/provider/URIHelper.cxx b/scripting/source/provider/URIHelper.cxx
index e5ab80f838cf..e5ab80f838cf 100644..100755
--- a/scripting/source/provider/URIHelper.cxx
+++ b/scripting/source/provider/URIHelper.cxx
diff --git a/scripting/source/provider/URIHelper.hxx b/scripting/source/provider/URIHelper.hxx
index 25683dcbb916..25683dcbb916 100644..100755
--- a/scripting/source/provider/URIHelper.hxx
+++ b/scripting/source/provider/URIHelper.hxx
diff --git a/scripting/source/provider/exports.dxp b/scripting/source/provider/exports.dxp
index 9630d7e06768..f0e1c69934bc 100644..100755
--- a/scripting/source/provider/exports.dxp
+++ b/scripting/source/provider/exports.dxp
@@ -1,3 +1,2 @@
component_getImplementationEnvironment
-component_writeInfo
component_getFactory
diff --git a/scripting/source/provider/makefile.mk b/scripting/source/provider/makefile.mk
index a63ae078d837..a63ae078d837 100644..100755
--- a/scripting/source/provider/makefile.mk
+++ b/scripting/source/provider/makefile.mk
diff --git a/scripting/source/pyprov/delzip b/scripting/source/pyprov/delzip
index e69de29bb2d1..e69de29bb2d1 100644..100755
--- a/scripting/source/pyprov/delzip
+++ b/scripting/source/pyprov/delzip
diff --git a/scripting/source/pyprov/description.xml b/scripting/source/pyprov/description.xml
index 1fe0a3d923da..1fe0a3d923da 100644..100755
--- a/scripting/source/pyprov/description.xml
+++ b/scripting/source/pyprov/description.xml
diff --git a/scripting/source/pyprov/mailmerge.component b/scripting/source/pyprov/mailmerge.component
new file mode 100755
index 000000000000..dd6a65e9a1ce
--- /dev/null
+++ b/scripting/source/pyprov/mailmerge.component
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org 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 version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.Python"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="org.openoffice.pyuno.MailMessage">
+ <service name="com.sun.star.mail.MailMessage"/>
+ </implementation>
+ <implementation name="org.openoffice.pyuno.MailServiceProvider">
+ <service name="com.sun.star.mail.MailServiceProvider"/>
+ </implementation>
+</component>
diff --git a/scripting/source/pyprov/mailmerge.py b/scripting/source/pyprov/mailmerge.py
index 8fd697fee96e..8fd697fee96e 100644..100755
--- a/scripting/source/pyprov/mailmerge.py
+++ b/scripting/source/pyprov/mailmerge.py
diff --git a/scripting/source/pyprov/makefile.mk b/scripting/source/pyprov/makefile.mk
index e9a065ad1e23..f534cb5b3b53 100644..100755
--- a/scripting/source/pyprov/makefile.mk
+++ b/scripting/source/pyprov/makefile.mk
@@ -58,4 +58,18 @@ COMPONENT_FILES=$(EXTENSIONDIR)$/pythonscript.py
.INCLUDE : target.mk
+ALLTAR : $(MISC)/mailmerge.component $(MISC)/pythonscript.component
+
+$(MISC)/mailmerge.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ mailmerge.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_PYTHON)mailmerge' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt mailmerge.component
+
+$(MISC)/pythonscript.component .ERRREMOVE : \
+ $(SOLARENV)/bin/createcomponent.xslt pythonscript.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_PYTHON)pythonscript' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt pythonscript.component
+
.ENDIF
diff --git a/scripting/source/pyprov/manifest.xml b/scripting/source/pyprov/manifest.xml
index 7e4e0456ea97..7e4e0456ea97 100644..100755
--- a/scripting/source/pyprov/manifest.xml
+++ b/scripting/source/pyprov/manifest.xml
diff --git a/scripting/source/pyprov/officehelper.py b/scripting/source/pyprov/officehelper.py
index 610ac5f9dbe7..610ac5f9dbe7 100644..100755
--- a/scripting/source/pyprov/officehelper.py
+++ b/scripting/source/pyprov/officehelper.py
diff --git a/scripting/source/pyprov/pythonscript.component b/scripting/source/pyprov/pythonscript.component
new file mode 100755
index 000000000000..08f895097203
--- /dev/null
+++ b/scripting/source/pyprov/pythonscript.component
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org 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 version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.Python"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="org.openoffice.pyuno.LanguageScriptProviderForPython">
+ <service name="com.sun.star.script.provider.LanguageScriptProvider"/>
+ <service name="com.sun.star.script.provider.ScriptProviderForPython"/>
+ </implementation>
+</component>
diff --git a/scripting/source/pyprov/pythonscript.py b/scripting/source/pyprov/pythonscript.py
index 2ca46b0ef37e..2ca46b0ef37e 100644..100755
--- a/scripting/source/pyprov/pythonscript.py
+++ b/scripting/source/pyprov/pythonscript.py
diff --git a/scripting/source/runtimemgr/ScriptExecDialog.hrc b/scripting/source/runtimemgr/ScriptExecDialog.hrc
index 8b1a63df29f3..8b1a63df29f3 100644..100755
--- a/scripting/source/runtimemgr/ScriptExecDialog.hrc
+++ b/scripting/source/runtimemgr/ScriptExecDialog.hrc
diff --git a/scripting/source/runtimemgr/ScriptExecDialog.src b/scripting/source/runtimemgr/ScriptExecDialog.src
index dbc7f7e88795..dbc7f7e88795 100644..100755
--- a/scripting/source/runtimemgr/ScriptExecDialog.src
+++ b/scripting/source/runtimemgr/ScriptExecDialog.src
diff --git a/scripting/source/runtimemgr/ScriptNameResolverImpl.cxx b/scripting/source/runtimemgr/ScriptNameResolverImpl.cxx
index 4ce06254b30f..7be13f8a6a1c 100644..100755
--- a/scripting/source/runtimemgr/ScriptNameResolverImpl.cxx
+++ b/scripting/source/runtimemgr/ScriptNameResolverImpl.cxx
@@ -71,13 +71,11 @@ static ::std::vector< sal_Int32 >* m_pSearchIDs = NULL;
//*************************************************************************
ScriptNameResolverImpl::ScriptNameResolverImpl(
const Reference< XComponentContext > & xContext ) :
- m_xContext( xContext )
+ m_xContext( xContext, UNO_SET_THROW )
{
OSL_TRACE( "< ScriptNameResolverImpl ctor called >\n" );
validateXRef( m_xContext, "ScriptNameResolverImpl::ScriptNameResolverImpl: invalid context" );
- m_xMultiComFac = m_xContext->getServiceManager();
-
- validateXRef( m_xMultiComFac, "ScriptNameResolverImpl::ScriptNameResolverImpl: invalid XMultiComponentFactory " );
+ m_xMultiComFac.set( m_xContext->getServiceManager(), UNO_SET_THROW );
if( !m_pSearchIDs )
{
@@ -221,11 +219,14 @@ throw ( lang::IllegalArgumentException, script::CannotConvertException, RuntimeE
OUString temp = OUSTR( "ScriptNameResolverImpl::resolve: " );
throw RuntimeException( temp.concat( e.Message ), Reference< XInterface >() );
}
- Reference< XInterface > xInterface = m_xMultiComFac->createInstanceWithContext(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.ucb.SimpleFileAccess" )), m_xContext );
- validateXRef( xInterface,
- "ScriptProvider::initialise: cannot get SimpleFileAccess Service\n" );
+ Reference< XInterface > xInterface(
+ m_xMultiComFac->createInstanceWithContext(
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.ucb.SimpleFileAccess" ),
+ m_xContext
+ ),
+ UNO_SET_THROW
+ );
Reference < ucb::XSimpleFileAccess > xSimpleFileAccess = Reference <
ucb::XSimpleFileAccess > ( xInterface, UNO_QUERY_THROW );
@@ -237,15 +238,8 @@ throw ( lang::IllegalArgumentException, script::CannotConvertException, RuntimeE
try
{
// need to get the ScriptStorageManager
- Any a = m_xContext->getValueByName(
- scriptingConstantsPool.SCRIPTSTORAGEMANAGER_SERVICE );
- if ( sal_False == ( a >>= xScriptStorageMgr ) )
- {
- OUString temp = OUSTR( "ScriptNameResolverImpl::resolve: failed to get ScriptStorageManager" );
- throw RuntimeException( temp, Reference< XInterface >() );
- // need to throw
- }
- validateXRef( xScriptStorageMgr, "Cannot get ScriptStorageManager" );
+ xScriptStorageMgr.set( m_xContext->getValueByName(
+ scriptingConstantsPool.SCRIPTSTORAGEMANAGER_SERVICE ), UNO_QUERY_THROW );
filesysScriptStorageID =
xScriptStorageMgr->createScriptStorageWithURI(
xSimpleFileAccess, filesysURL );
@@ -365,20 +359,12 @@ throw ( lang::IllegalArgumentException, script::CannotConvertException, RuntimeE
if( filesysScriptStorageID > 2 )
{
// get the filesys storage and dispose of it
- Reference< XInterface > xScriptStorage =
- xScriptStorageMgr->getScriptStorage( filesysScriptStorageID );
- validateXRef( xScriptStorage,
- "ScriptNameResolverImpl::getStorageInstance: cannot get Script Storage service" );
+ Reference< XInterface > xScriptStorage( xScriptStorageMgr->getScriptStorage( filesysScriptStorageID ), UNO_SET_THROW );
Reference< storage::XScriptInfoAccess > xScriptInfoAccess = Reference<
storage::XScriptInfoAccess > ( xScriptStorage, UNO_QUERY_THROW );
- validateXRef( xScriptInfoAccess,
- "ScriptNameResolverImpl::resolveURIFromStorageID: cannot get XScriptInfoAccess" );
Sequence< Reference< storage::XScriptInfo > > results =
xScriptInfoAccess->getAllImplementations( );
- Reference < lang::XEventListener > xEL_ScriptStorageMgr =
- Reference< lang::XEventListener >
- ( xScriptStorageMgr ,UNO_QUERY_THROW );
- validateXRef( xEL_ScriptStorageMgr, "ScriptNameResolverImpl::resolve: can't get ScriptStorageManager XEventListener interface when trying to dispose of filesystem storage" );
+ Reference < lang::XEventListener > xEL_ScriptStorageMgr(( xScriptStorageMgr ,UNO_QUERY_THROW );
lang::EventObject event( results[ 0 ] );
xEL_ScriptStorageMgr->disposing( event );
}
@@ -448,9 +434,7 @@ SAL_THROW ( ( lang::IllegalArgumentException, css::security::AccessControlExcept
throw RuntimeException( temp.concat( e.Message ), Reference< XInterface >() );
}
}
- Reference< storage::XScriptInfoAccess > storage = getStorageInstance( sid, permissionURI );
- validateXRef( storage,
- "ScriptNameResolverImpl::resolveURIFromStorageID: cannot get XScriptInfoAccess" );
+ Reference< storage::XScriptInfoAccess > storage( getStorageInstance( sid, permissionURI ), UNO_SET_THROW );
Sequence< Reference< storage::XScriptInfo > > results =
storage->getImplementations( scriptURI );
@@ -517,22 +501,10 @@ const ::rtl::OUString & permissionURI ) SAL_THROW ( ( RuntimeException, css::sec
Reference< storage::XScriptInfoAccess > xScriptInfoAccess;
try
{
- Reference< XInterface > xInterface;
-
- Any a = m_xContext->getValueByName(
- OUString(RTL_CONSTASCII_USTRINGPARAM( SCRIPTSTORAGEMANAGER_SERVICE )) );
- if ( sal_False == ( a >>= xInterface ) )
- {
- throw RuntimeException(
- OUSTR( "ScriptNameResolverImpl::getStorageInstance: could not obtain ScriptStorageManager singleton" ),
- Reference< XInterface >() );
- }
- validateXRef( xInterface,
- "ScriptNameResolverImpl::getStorageInstance: cannot get Storage service" );
+ Reference< XInterface > xInterface( m_xContext->getValueByName(
+ OUString::createFromAscii( SCRIPTSTORAGEMANAGER_SERVICE ) ), UNO_QUERY_THROW );
// check that we have permissions for this storage
Reference< dcsssf::security::XScriptSecurity > xScriptSecurity( xInterface, UNO_QUERY_THROW );
- validateXRef( xScriptSecurity,
- "ScriptNameResolverImpl::getStorageInstance: cannot get Script Security service" );
scripting_constants::ScriptingConstantsPool& scriptingConstantsPool =
scripting_constants::ScriptingConstantsPool::instance();
// if we dealing with a document storage (ie. not user or share
@@ -547,14 +519,8 @@ const ::rtl::OUString & permissionURI ) SAL_THROW ( ( RuntimeException, css::sec
OSL_TRACE( "ScriptNameResolverImpl::getStorageInstance: got execute permission for ID=%d", sid );
}
Reference< storage::XScriptStorageManager > xScriptStorageManager( xInterface, UNO_QUERY_THROW );
- validateXRef( xScriptStorageManager,
- "ScriptNameResolverImpl::getStorageInstance: cannot get Script Storage Manager service" );
- Reference< XInterface > xScriptStorage =
- xScriptStorageManager->getScriptStorage( sid );
- validateXRef( xScriptStorage,
- "ScriptNameResolverImpl::getStorageInstance: cannot get Script Storage service" );
- xScriptInfoAccess = Reference<
- storage::XScriptInfoAccess > ( xScriptStorage, UNO_QUERY_THROW );
+ Reference< XInterface > xScriptStorage( ScriptStorageManager->getScriptStorage( sid ), UNO_SET_THROW );
+ xScriptInfoAccess.set( xScriptStorage, UNO_QUERY_THROW );
}
catch ( lang::IllegalArgumentException & e )
{
diff --git a/scripting/source/runtimemgr/ScriptNameResolverImpl.hxx b/scripting/source/runtimemgr/ScriptNameResolverImpl.hxx
index 09611e4bc0a0..09611e4bc0a0 100644..100755
--- a/scripting/source/runtimemgr/ScriptNameResolverImpl.hxx
+++ b/scripting/source/runtimemgr/ScriptNameResolverImpl.hxx
diff --git a/scripting/source/runtimemgr/ScriptRuntimeManager.cxx b/scripting/source/runtimemgr/ScriptRuntimeManager.cxx
index 06dc463b4878..6a9ccede733d 100644..100755
--- a/scripting/source/runtimemgr/ScriptRuntimeManager.cxx
+++ b/scripting/source/runtimemgr/ScriptRuntimeManager.cxx
@@ -36,6 +36,7 @@
#include <util/scriptingconstants.hxx>
#include <cppuhelper/implementationentry.hxx>
+#include <tools/diagnose_ex.h>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/lang/XEventListener.hpp>
@@ -67,14 +68,10 @@ static Sequence< OUString > s_serviceNames = Sequence< OUString >( &s_serviceNam
// ScriptRuntimeManager Constructor
ScriptRuntimeManager::ScriptRuntimeManager(
const Reference< XComponentContext > & xContext ) :
- m_xContext( xContext )
+ m_xContext( xContext, UNO_SET_THROW )
{
OSL_TRACE( "< ScriptRuntimeManager ctor called >\n" );
- validateXRef( m_xContext,
- "ScriptRuntimeManager::ScriptRuntimeManager: invalid context" );
- m_xMgr = m_xContext->getServiceManager();
- validateXRef( m_xMgr,
- "ScriptRuntimeManager::ScriptRuntimeManager: cannot get ServiceManager" );
+ m_xMgr.set( m_xContext->getServiceManager(), UNO_SET_THROW );
s_moduleCount.modCnt.acquire( &s_moduleCount.modCnt );
// test
//scripting_securitymgr::ScriptSecurityManager ssm(xContext);
@@ -105,22 +102,12 @@ throw( RuntimeException )
Reference< storage::XScriptInfo > sinfo =
Reference< storage::XScriptInfo >( scriptInfo, UNO_QUERY_THROW );
- OUStringBuffer *buf = new OUStringBuffer(80);
- buf->appendAscii("/singletons/drafts.com.sun.star.script.framework.runtime.theScriptRuntimeFor");
- buf->append(sinfo->getLanguage());
+ OUStringBuffer* buf( 80 );
+ buf.appendAscii("/singletons/drafts.com.sun.star.script.framework.runtime.theScriptRuntimeFor");
+ buf.append(sinfo->getLanguage());
- Any a = m_xContext->getValueByName(buf->makeStringAndClear());
-
- if ( sal_False == ( a >>= xInterface ) )
- {
- throw RuntimeException(
- sinfo->getLanguage().concat( OUSTR( " runtime support is not installed for this language" ) ),
- Reference< XInterface >() );
- }
- validateXRef( xInterface,
- "ScriptRuntimeManager::GetScriptRuntime: cannot get appropriate ScriptRuntime Service"
- );
- xScriptInvocation = Reference< runtime::XScriptInvocation >( xInterface, UNO_QUERY_THROW );
+ xInterface.set( m_xContext->getValueByName( buf.makeStringAndClear() ), UNO_QUERY_THROW );
+ xScriptInvocation.set( xInterface, UNO_QUERY_THROW );
}
catch ( Exception & e )
{
@@ -142,13 +129,15 @@ throw( RuntimeException )
try
{
- Reference< XInterface > xInterface = m_xMgr->createInstanceWithContext(
- OUString(RTL_CONSTASCII_USTRINGPARAM(
- "drafts.com.sun.star.script.framework.runtime.DefaultScriptNameResolver" )),
- m_xContext );
- validateXRef( xInterface,
- "ScriptRuntimeManager::GetScriptRuntime: cannot get instance of DefaultScriptNameResolver" );
- xScriptNameResolver = Reference< runtime::XScriptNameResolver >( xInterface, UNO_QUERY_THROW );
+ Reference< XInterface > xInterface(
+ m_xMgr->createInstanceWithContext(
+ OUString(RTL_CONSTASCII_USTRINGPARAM(
+ "drafts.com.sun.star.script.framework.runtime.DefaultScriptNameResolver" )),
+ m_xContext
+ ),
+ UNO_SET_THROW
+ );
+ xScriptNameResolver.set( xInterface, UNO_QUERY_THROW );
}
catch ( Exception & e )
{
@@ -181,9 +170,8 @@ Any SAL_CALL ScriptRuntimeManager::invoke(
try
{
- Reference< storage::XScriptInfo > resolvedScript = resolve( scriptURI,
- resolvedCtx );
- validateXRef( resolvedScript, "ScriptRuntimeManager::invoke: No resolvedURI" );
+ Reference< storage::XScriptInfo > resolvedScript = resolve( scriptURI, resolvedCtx );
+ ENSURE_OR_THROW( resolvedScript.is(), "ScriptRuntimeManager::invoke: No resolvedURI" );
Reference< beans::XPropertySet > xPropSetResolvedCtx;
if ( sal_False == ( resolvedCtx >>= xPropSetResolvedCtx ) )
@@ -215,7 +203,7 @@ Any SAL_CALL ScriptRuntimeManager::invoke(
Reference< runtime::XScriptInvocation > xScriptInvocation =
getScriptRuntime( resolvedScript );
- validateXRef( xScriptInvocation,
+ ENSURE_OR_THROW( xScriptInvocation.is(),
"ScriptRuntimeManager::invoke: cannot get instance of language specific runtime." );
// the scriptURI is currently passed to the language-dept runtime but
@@ -231,13 +219,7 @@ Any SAL_CALL ScriptRuntimeManager::invoke(
{
Any a = m_xContext->getValueByName(
scriptingConstantsPool.SCRIPTSTORAGEMANAGER_SERVICE );
- Reference < lang::XEventListener > xEL_ScriptStorageManager;
- if ( sal_False == ( a >>= xEL_ScriptStorageManager ) )
- {
- throw RuntimeException( OUSTR( "ScriptRuntimeManager::invoke: can't get ScriptStorageManager XEventListener interface when trying to dispose of filesystem storage" ),
- Reference< XInterface > () );
- }
- validateXRef( xEL_ScriptStorageManager, "Cannot get XEventListener from ScriptStorageManager" );
+ Reference < lang::XEventListener > xEL_ScriptStorageManager( a, UNO_QUERY_THROW );
lang::EventObject event(resolvedScript);
xEL_ScriptStorageManager->disposing( event );
}
@@ -309,7 +291,7 @@ throw( lang::IllegalArgumentException, script::CannotConvertException, RuntimeEx
Reference< storage::XScriptInfo > resolvedURI;
Reference< runtime::XScriptNameResolver > xScriptNameResolver = getScriptNameResolver();
- validateXRef( xScriptNameResolver,
+ ENSURE_OR_THROW( xScriptNameResolver.is(),
"ScriptRuntimeManager::resolve: No ScriptNameResolver" );
try
@@ -485,68 +467,6 @@ extern "C"
}
/**
- * This function creates an implementation section in the registry and another subkey
- *
- * for each supported service.
- * @param pServiceManager the service manager
- * @param pRegistryKey the registry key
- */
- sal_Bool SAL_CALL component_writeInfo( lang::XMultiServiceFactory * pServiceManager,
- registry::XRegistryKey * pRegistryKey )
- {
- if (::cppu::component_writeInfoHelper( pServiceManager, pRegistryKey,
- ::scripting_runtimemgr::s_entries ))
- {
- try
- {
- // register RuntimeManager singleton
-
- registry::XRegistryKey * pKey =
- reinterpret_cast< registry::XRegistryKey * >(pRegistryKey);
-
- Reference< registry::XRegistryKey > xKey(
- pKey->createKey(
-
- OUSTR("drafts.com.sun.star.script.framework.runtime.ScriptRuntimeManager/UNO/SINGLETONS/drafts.com.sun.star.script.framework.runtime.theScriptRuntimeManager")));
- xKey->setStringValue( OUSTR("drafts.com.sun.star.script.framework.runtime.ScriptRuntimeManager") );
-
- // ScriptStorage Mangaer singleton
-
- xKey = pKey->createKey(
- OUSTR("drafts.com.sun.star.script.framework.storage.ScriptStorageManager/UNO/SINGLETONS/drafts.com.sun.star.script.framework.storage.theScriptStorageManager"));
- xKey->setStringValue( OUSTR("drafts.com.sun.star.script.framework.storage.ScriptStorageManager") );
- // Singleton entries are not handled by the setup process
- // below is the only alternative at the momement which
- // is to programmatically do this.
-
- // "Java" Runtime singleton entry
-
- xKey = pKey->createKey(
- OUSTR("com.sun.star.scripting.runtime.java.ScriptRuntimeForJava$_ScriptRuntimeForJava/UNO/SINGLETONS/drafts.com.sun.star.script.framework.runtime.theScriptRuntimeForJava"));
- xKey->setStringValue( OUSTR("drafts.com.sun.star.script.framework.runtime.ScriptRuntimeForJava") );
-
- // "JavaScript" Runtime singleton entry
-
- xKey = pKey->createKey(
- OUSTR("com.sun.star.scripting.runtime.javascript.ScriptRuntimeForJavaScript$_ScriptRuntimeForJavaScript/UNO/SINGLETONS/drafts.com.sun.star.script.framework.runtime.theScriptRuntimeForJavaScript"));
- xKey->setStringValue( OUSTR("drafts.com.sun.star.script.framework.runtime.ScriptRuntimeForJavaScript") );
-
- // "BeanShell" Runtime singleton entry
-
- xKey = pKey->createKey(
- OUSTR("com.sun.star.scripting.runtime.beanshell.ScriptRuntimeForBeanShell$_ScriptRuntimeForBeanShell/UNO/SINGLETONS/drafts.com.sun.star.script.framework.runtime.theScriptRuntimeForBeanShell"));
- xKey->setStringValue( OUSTR("drafts.com.sun.star.script.framework.runtime.ScriptRuntimeForBeanShell") );
-
- return sal_True;
- }
- catch (Exception & exc)
- {
- }
- }
- return sal_False;
- }
-
- /**
* This function is called to get service factories for an implementation.
*
* @param pImplName name of implementation
diff --git a/scripting/source/runtimemgr/ScriptRuntimeManager.hxx b/scripting/source/runtimemgr/ScriptRuntimeManager.hxx
index 0358ce7659ab..0358ce7659ab 100644..100755
--- a/scripting/source/runtimemgr/ScriptRuntimeManager.hxx
+++ b/scripting/source/runtimemgr/ScriptRuntimeManager.hxx
diff --git a/scripting/source/runtimemgr/StorageBridge.cxx b/scripting/source/runtimemgr/StorageBridge.cxx
index f422a4a67666..c81dba2c825f 100644..100755
--- a/scripting/source/runtimemgr/StorageBridge.cxx
+++ b/scripting/source/runtimemgr/StorageBridge.cxx
@@ -55,9 +55,8 @@ const int STORAGEPROXY = 0;
//*************************************************************************
// StorageBridge Constructor
StorageBridge::StorageBridge( const Reference< XComponentContext >& xContext,
- sal_Int32 sid ) : m_xContext( xContext ), m_sid( sid )
+ sal_Int32 sid ) : m_xContext( xContext, UNO_SET_THROW ), m_sid( sid )
{
- validateXRef( m_xContext, "StorageBridge::StorageBridge: invalid context" );
try
{
initStorage();
@@ -75,31 +74,12 @@ StorageBridge::initStorage() throw ( ::com::sun::star::uno::RuntimeException )
{
try
{
- Reference< lang::XMultiComponentFactory > xMultiComFac =
- m_xContext->getServiceManager();
- validateXRef( xMultiComFac,
- "StorageBridge::StorageBridge: cannot get multicomponentfactory from multiservice factory" );
- Reference< XInterface > temp;
-
- Any a = m_xContext->getValueByName(
- OUString(RTL_CONSTASCII_USTRINGPARAM( SCRIPTSTORAGEMANAGER_SERVICE )) );
- if ( sal_False == ( a >>= temp ) )
- {
- throw RuntimeException(
- OUSTR( "StorageBridge::StorageBridge: could not obtain ScriptStorageManager singleton" ),
- Reference< XInterface >() );
- }
- validateXRef( temp,
- "StorageBridge::StorageBridge: cannot get Storage service" );
+ Reference< lang::XMultiComponentFactory > xMultiComFac( m_xContext->getServiceManager(), UNO_SET_THROW );
+ Reference< XInterface > temp( m_xContext->getValueByName(
+ OUString::createFromAscii( SCRIPTSTORAGEMANAGER_SERVICE ) ), UNO_QUERY_THROW );
Reference< storage::XScriptStorageManager > xScriptStorageManager( temp, UNO_QUERY_THROW );
- validateXRef( xScriptStorageManager,
- "StorageBridge::StorageBridge: cannot get Script Storage Manager service" );
- Reference< XInterface > xScriptStorage =
- xScriptStorageManager->getScriptStorage( m_sid );
- validateXRef( xScriptStorage,
- "StorageBridge::StorageBridge: cannot get Script Storage service" );
- m_xScriptInfoAccess =
- Reference< storage::XScriptInfoAccess > ( xScriptStorage, UNO_QUERY_THROW );
+ Reference< XInterface > xScriptStorage( xScriptStorageManager->getScriptStorage( m_sid ), UNO_SET_THROW );
+ m_xScriptInfoAccess.set( xScriptStorage, UNO_QUERY_THROW );
}
catch ( RuntimeException & re )
{
diff --git a/scripting/source/runtimemgr/StorageBridge.hxx b/scripting/source/runtimemgr/StorageBridge.hxx
index 052102de1ab7..052102de1ab7 100644..100755
--- a/scripting/source/runtimemgr/StorageBridge.hxx
+++ b/scripting/source/runtimemgr/StorageBridge.hxx
diff --git a/scripting/source/runtimemgr/StorageBridgeFactory.cxx b/scripting/source/runtimemgr/StorageBridgeFactory.cxx
index 88b0fdac3ef8..88b0fdac3ef8 100644..100755
--- a/scripting/source/runtimemgr/StorageBridgeFactory.cxx
+++ b/scripting/source/runtimemgr/StorageBridgeFactory.cxx
diff --git a/scripting/source/runtimemgr/StorageBridgeFactory.hxx b/scripting/source/runtimemgr/StorageBridgeFactory.hxx
index 591fe6de4e83..591fe6de4e83 100644..100755
--- a/scripting/source/runtimemgr/StorageBridgeFactory.hxx
+++ b/scripting/source/runtimemgr/StorageBridgeFactory.hxx
diff --git a/scripting/source/runtimemgr/exports.dxp b/scripting/source/runtimemgr/exports.dxp
index 9630d7e06768..f0e1c69934bc 100644..100755
--- a/scripting/source/runtimemgr/exports.dxp
+++ b/scripting/source/runtimemgr/exports.dxp
@@ -1,3 +1,2 @@
component_getImplementationEnvironment
-component_writeInfo
component_getFactory
diff --git a/scripting/source/runtimemgr/makefile.mk b/scripting/source/runtimemgr/makefile.mk
index d802fd240a2c..d802fd240a2c 100644..100755
--- a/scripting/source/runtimemgr/makefile.mk
+++ b/scripting/source/runtimemgr/makefile.mk
diff --git a/scripting/source/storage/ScriptData.hxx b/scripting/source/storage/ScriptData.hxx
index f26f7c3149d2..f26f7c3149d2 100644..100755
--- a/scripting/source/storage/ScriptData.hxx
+++ b/scripting/source/storage/ScriptData.hxx
diff --git a/scripting/source/storage/ScriptElement.cxx b/scripting/source/storage/ScriptElement.cxx
index 422e62aab361..422e62aab361 100644..100755
--- a/scripting/source/storage/ScriptElement.cxx
+++ b/scripting/source/storage/ScriptElement.cxx
diff --git a/scripting/source/storage/ScriptElement.hxx b/scripting/source/storage/ScriptElement.hxx
index 50cde2732413..50cde2732413 100644..100755
--- a/scripting/source/storage/ScriptElement.hxx
+++ b/scripting/source/storage/ScriptElement.hxx
diff --git a/scripting/source/storage/ScriptInfo.cxx b/scripting/source/storage/ScriptInfo.cxx
index d292ecb20224..d292ecb20224 100644..100755
--- a/scripting/source/storage/ScriptInfo.cxx
+++ b/scripting/source/storage/ScriptInfo.cxx
diff --git a/scripting/source/storage/ScriptInfo.hxx b/scripting/source/storage/ScriptInfo.hxx
index c4db0142daec..c4db0142daec 100644..100755
--- a/scripting/source/storage/ScriptInfo.hxx
+++ b/scripting/source/storage/ScriptInfo.hxx
diff --git a/scripting/source/storage/ScriptInfoImpl.hxx b/scripting/source/storage/ScriptInfoImpl.hxx
index 3b038535dee7..3b038535dee7 100644..100755
--- a/scripting/source/storage/ScriptInfoImpl.hxx
+++ b/scripting/source/storage/ScriptInfoImpl.hxx
diff --git a/scripting/source/storage/ScriptMetadataImporter.cxx b/scripting/source/storage/ScriptMetadataImporter.cxx
index 70fcca0bd3af..b7d7c379abdf 100644..100755
--- a/scripting/source/storage/ScriptMetadataImporter.cxx
+++ b/scripting/source/storage/ScriptMetadataImporter.cxx
@@ -39,7 +39,7 @@
#include <com/sun/star/xml/sax/XParser.hpp>
#include <rtl/string.h>
-
+#include <tools/diagnose_ex.h>
#include <util/util.hxx>
@@ -83,31 +83,14 @@ void ScriptMetadataImporter::parseMetaData(
ms_parcelURI = parcelURI;
//Get the parser service
- validateXRef( m_xContext,
+ ENSURE_OR_THROW( m_xContext.is(),
"ScriptMetadataImporter::parseMetaData: No context available" );
- Reference< lang::XMultiComponentFactory > xMgr =
- m_xContext->getServiceManager();
-
- validateXRef( xMgr,
- "ScriptMetadataImporter::parseMetaData: No service manager available" );
-
- Reference< XInterface > xInterface = xMgr->createInstanceWithContext(
- OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.sax.Parser")), m_xContext );
+ Reference< lang::XMultiComponentFactory > xMgr( m_xContext->getServiceManager(), UNO_SET_THROW );
- validateXRef( xInterface, "ScriptMetadataImporter::parseMetaData: cannot get SAX Parser" );
- Reference< xml::sax::XParser > xParser;
- try
- {
- xParser.set( xInterface ,UNO_QUERY_THROW );
- }
- catch (RuntimeException & re )
- {
- OUString msg(RTL_CONSTASCII_USTRINGPARAM(
- "ScriptMetadata:Importer::parserMetaData cannot get XParser" ));
- msg.concat( re.Message );
- throw RuntimeException( msg, Reference< XInterface > () );
- }
+ Reference< xml::sax::XParser > xParser(
+ xMgr->createInstanceWithContext( OUString::createFromAscii( "com.sun.star.xml.sax.Parser" ), m_xContext ),
+ UNO_QUERY_THROW );
// xxx todo: error handler, entity resolver omitted
// This class is the document handler for the parser
diff --git a/scripting/source/storage/ScriptMetadataImporter.hxx b/scripting/source/storage/ScriptMetadataImporter.hxx
index 3c94bff75d26..3c94bff75d26 100644..100755
--- a/scripting/source/storage/ScriptMetadataImporter.hxx
+++ b/scripting/source/storage/ScriptMetadataImporter.hxx
diff --git a/scripting/source/storage/ScriptSecurityManager.cxx b/scripting/source/storage/ScriptSecurityManager.cxx
index 8ca3859cb430..5c12fcdc0a13 100644..100755
--- a/scripting/source/storage/ScriptSecurityManager.cxx
+++ b/scripting/source/storage/ScriptSecurityManager.cxx
@@ -48,7 +48,7 @@
#include "ScriptSecurityManager.hxx"
#include <util/util.hxx>
#include <util/scriptingconstants.hxx>
-
+#include <tools/diagnose_ex.h>
using namespace ::rtl;
using namespace ::osl;
@@ -86,28 +86,15 @@ static const int ADD_TO_PATH = 2;
// ScriptSecurityManager Constructor
ScriptSecurityManager::ScriptSecurityManager(
const Reference< XComponentContext > & xContext ) throw ( RuntimeException )
- : m_xContext( xContext)
+ : m_xContext( xContext, UNO_SET_THROW )
{
OSL_TRACE( "< ScriptSecurityManager ctor called >\n" );
- validateXRef( m_xContext,
- "ScriptSecurityManager::ScriptSecurityManager: invalid context" );
// get the service manager from the context
- Reference< lang::XMultiComponentFactory > xMgr = m_xContext->getServiceManager();
- validateXRef( xMgr,
- "ScriptSecurityManager::ScriptSecurityManager: cannot get ServiceManager" );
+ Reference< lang::XMultiComponentFactory > xMgr( m_xContext->getServiceManager(), UNO_SET_THROW );
// create an instance of the ConfigurationProvider
- Reference< XInterface > xInterface = xMgr->createInstanceWithContext(
- s_configProv, m_xContext );
- validateXRef( xInterface,
- "ScriptSecurityManager::ScriptSecurityManager: cannot get ConfigurationProvider" );
- // create an instance of the ConfigurationAccess for accessing the
- // scripting security settings
- m_xConfigProvFactory = Reference < lang::XMultiServiceFactory > ( xInterface, UNO_QUERY );
- validateXRef( m_xConfigProvFactory,
- "ScriptSecurityManager::ScriptSecurityManager: cannot get XMultiServiceFactory interface from ConfigurationProvider" );
-
+ m_xConfigProvFactory.set( xMgr->createInstanceWithContext( s_configProv, m_xContext ), UNO_QUERY_THROW );
}
void ScriptSecurityManager::addScriptStorage( rtl::OUString scriptStorageURL,
@@ -289,17 +276,12 @@ throw ( RuntimeException )
short result;
try
{
- Reference< lang::XMultiComponentFactory > xMgr = m_xContext->getServiceManager();
- validateXRef( xMgr,
- "ScriptSecurityManager::executeDialog: cannot get ServiceManager" );
- Reference< XInterface > xInterface =
- xMgr->createInstanceWithArgumentsAndContext( s_securityDialog,
- aArgs, m_xContext );
- validateXRef( xInterface, "ScriptSecurityManager::executeDialog: Can't create SecurityDialog" );
- Reference< awt::XDialog > xDialog( xInterface, UNO_QUERY_THROW );
+ Reference< lang::XMultiComponentFactory > xMgr( m_xContext->getServiceManager(), UNO_SET_THROW );
+ Reference< awt::XDialog > xDialog(
+ xMgr->createInstanceWithArgumentsAndContext( s_securityDialog, aArgs, m_xContext ),
+ UNO_QUERY_THROW );
result = xDialog->execute();
- Reference< lang::XComponent > xComponent( xInterface, UNO_QUERY_THROW );
- validateXRef( xInterface, "ScriptSecurityManager::executeDialog: Can't get XComponent to dispose dialog" );
+ Reference< lang::XComponent > xComponent( xDialog, UNO_QUERY_THROW );
xComponent->dispose();
}
catch ( RuntimeException & rte )
@@ -382,31 +364,20 @@ void ScriptSecurityManager::removePermissionSettings ( ::rtl::OUString & scriptS
void ScriptSecurityManager::readConfiguration()
throw ( RuntimeException)
{
- Reference< XInterface > xInterface;
try
{
- beans::PropertyValue configPath;
- configPath.Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("nodepath"));
- configPath.Value <<= ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.Common/Security/Scripting"));
- Sequence < Any > aargs( 1 );
- aargs[ 0 ] <<= configPath;
- validateXRef( m_xConfigProvFactory,
- "ScriptSecurityManager::readConfiguration: ConfigProviderFactory no longer valid!" );
- xInterface = m_xConfigProvFactory->createInstanceWithArguments( s_configAccess,
- aargs );
- validateXRef( xInterface,
- "ScriptSecurityManager::readConfiguration: cannot get ConfigurationAccess" );
- // get the XPropertySet interface from the ConfigurationAccess service
- Reference < beans::XPropertySet > xPropSet( xInterface, UNO_QUERY );
- Any value;
-
- value=xPropSet->getPropertyValue( OUSTR( "Confirmation" ) );
- if ( sal_False == ( value >>= m_confirmationRequired ) )
- {
- throw RuntimeException(
- OUSTR( "ScriptSecurityManager:readConfiguration: can't get Confirmation setting" ),
- Reference< XInterface > () );
- }
+ beans::PropertyValue configPath;
+ configPath.Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("nodepath"));
+ configPath.Value <<= ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.Common/Security/Scripting"));
+ Sequence < Any > aargs( 1 );
+ aargs[ 0 ] <<= configPath;
+ ENSURE_OR_THROW( m_xConfigProvFactory.is(),
+ "ScriptSecurityManager::readConfiguration: ConfigProviderFactory no longer valid!" );
+ // get the XPropertySet interface from the ConfigurationAccess service
+ Reference < beans::XPropertySet > xPropSet( m_xConfigProvFactory->createInstanceWithArguments( s_configAccess, aargs ), UNO_QUERY_THROW );
+
+ m_confirmationRequired = sal_True;
+ OSL_VERIFY( xPropSet->getPropertyValue( OUSTR( "Confirmation" ) ) >>= m_confirmationRequired );
if ( m_confirmationRequired == sal_True )
{
OSL_TRACE( "ScriptSecurityManager:readConfiguration: confirmation is true" );
@@ -415,13 +386,10 @@ void ScriptSecurityManager::readConfiguration()
{
OSL_TRACE( "ScriptSecurityManager:readConfiguration: confirmation is false" );
}
- value=xPropSet->getPropertyValue( OUSTR( "Warning" ) );
- if ( sal_False == ( value >>= m_warning ) )
- {
- throw RuntimeException(
- OUSTR( "ScriptSecurityManager:readConfiguration: can't get Warning setting" ),
- Reference< XInterface > () );
- }
+
+ m_warning = true;
+ OSL_VERIFY( xPropSet->getPropertyValue( OUSTR( "Warning" ) ) >>= m_warning );
+
if ( m_warning == sal_True )
{
OSL_TRACE( "ScriptSecurityManager:readConfiguration: warning is true" );
@@ -430,21 +398,13 @@ void ScriptSecurityManager::readConfiguration()
{
OSL_TRACE( "ScriptSecurityManager:readConfiguration: warning is false" );
}
- value=xPropSet->getPropertyValue( OUSTR( "OfficeBasic" ) );
- if ( sal_False == ( value >>= m_runMacroSetting ) )
- {
- throw RuntimeException(
- OUSTR( "ScriptSecurityManager:readConfiguration: can't get OfficeBasic setting" ),
- Reference< XInterface > () );
- }
+
+ m_runMacroSetting = sal_True;
+ OSL_VERIFY( xPropSet->getPropertyValue( OUSTR( "OfficeBasic" ) ) >>= m_runMacroSetting );
OSL_TRACE( "ScriptSecurityManager:readConfiguration: OfficeBasic = %d", m_runMacroSetting );
- value=xPropSet->getPropertyValue( OUSTR( "SecureURL" ) );
- if ( sal_False == ( value >>= m_secureURL ) )
- {
- throw RuntimeException(
- OUSTR( "ScriptSecurityManager:readConfiguration: can't get SecureURL setting" ),
- Reference< XInterface > () );
- }
+
+ m_secureURL = ::rtl::OUString();
+ OSL_VERIFY( xPropSet->getPropertyValue( OUSTR( "SecureURL" ) ) >>= m_secureURL );
}
catch ( beans::UnknownPropertyException & upe )
{
@@ -480,18 +440,14 @@ void ScriptSecurityManager::readConfiguration()
int length = m_secureURL.getLength();
// PathSubstitution needed to interpret variables found in config
- Reference< lang::XMultiComponentFactory > xMgr = m_xContext->getServiceManager();
- validateXRef( xMgr,
- "ScriptSecurityManager::readConfiguration: cannot get XMultiComponentFactory" );
- xInterface = xMgr->createInstanceWithContext(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.util.PathSubstitution")), m_xContext);
- validateXRef( xInterface,
- "ScriptSecurityManager::readConfiguration: cannot get ConfigurationProvider" );
+ Reference< lang::XMultiComponentFactory > xMgr( m_xContext->getServiceManager(), UNO_SET_THROW );
+ Reference< XInterface > xInterface = );
Reference< util::XStringSubstitution > xStringSubstitution(
- xInterface, UNO_QUERY);
- validateXRef( xStringSubstitution,
- "ScriptSecurityManager::readConfiguration: cannot get ConfigurationProvider" );
+ xMgr->createInstanceWithContext(
+ ::rtl::OUString::createFromAscii( "com.sun.star.util.PathSubstitution" ), m_xContext
+ ),
+ UNO_QUERY_THROW
+ );
for( int i = 0; i < length; i++ )
{
OSL_TRACE( "ScriptSecurityManager:readConfiguration path = %s",
@@ -524,16 +480,9 @@ throw ( RuntimeException )
configPath.Value <<= ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.Common/Security/Scripting"));
Sequence < Any > aargs( 1 );
aargs[ 0 ] <<= configPath;
- Reference< XInterface > xInterface = m_xConfigProvFactory->createInstanceWithArguments( s_configUpdate,
- aargs );
- validateXRef( xInterface,
- "ScriptSecurityManager::addToSecurePaths: ScriptSecurityManager: cannot get ConfigurationUpdateAccess" );
- Reference < container::XNameReplace > xNameReplace( xInterface, UNO_QUERY );
- validateXRef( xNameReplace,
- "ScriptSecurityManager::addToSecurePaths: ScriptSecurityManager: cannot get XNameReplace" );
- Reference < util::XChangesBatch > xChangesBatch( xInterface, UNO_QUERY );
- validateXRef( xChangesBatch,
- "ScriptSecurityManager::addToSecurePaths: cannot get XChangesBatch" );
+ Reference < container::XNameReplace > xNameReplace(
+ m_xConfigProvFactory->createInstanceWithArguments( s_configUpdate, aargs ), UNO_QUERY_THROW );
+ Reference < util::XChangesBatch > xChangesBatch( xNameReplace, UNO_QUERY_THROW );
OSL_TRACE( "--->ScriptSecurityManager::addToSecurePaths: after if stuff" );
Reference < beans::XPropertySet > xPropSet( xInterface, UNO_QUERY );
diff --git a/scripting/source/storage/ScriptSecurityManager.hxx b/scripting/source/storage/ScriptSecurityManager.hxx
index 37dffcadcd42..37dffcadcd42 100644..100755
--- a/scripting/source/storage/ScriptSecurityManager.hxx
+++ b/scripting/source/storage/ScriptSecurityManager.hxx
diff --git a/scripting/source/storage/ScriptStorage.cxx b/scripting/source/storage/ScriptStorage.cxx
index f5ee1e766210..c723b802f5b7 100644..100755
--- a/scripting/source/storage/ScriptStorage.cxx
+++ b/scripting/source/storage/ScriptStorage.cxx
@@ -82,16 +82,11 @@ const sal_uInt16 NUMBER_STORAGE_INITIALIZE_ARGS = 3;
ScriptStorage::ScriptStorage( const Reference <
XComponentContext > & xContext )
throw ( RuntimeException )
- : m_xContext( xContext ), m_bInitialised( false )
+ : m_xContext( xContext, UNO_SET_THROW ), m_bInitialised( false )
{
OSL_TRACE( "< ScriptStorage ctor called >\n" );
- validateXRef( m_xContext,
- "ScriptStorage::ScriptStorage : cannot get component context" );
-
- m_xMgr = m_xContext->getServiceManager();
- validateXRef( m_xMgr,
- "ScriptStorage::ScriptStorage : cannot get service manager" );
+ m_xMgr.set( m_xContext->getServiceManager(), UNO_SET_THROW );
if( !mh_scriptLangs )
{
@@ -99,47 +94,31 @@ throw ( RuntimeException )
if( !mh_scriptLangs )
{
mh_scriptLangs = new ScriptLanguages_hash();
- Reference< XInterface > xInterface =
- m_xMgr->createInstanceWithContext(
- OUString(RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.configuration.ConfigurationProvider" ))
- , m_xContext );
- validateXRef( xInterface,
- "ScriptStorage::ScriptStorage: cannot get ConfigurationProvider" );
+ Reference< lang::XMultiServiceFactory > xConfigProvFactory(
+ m_xMgr->createInstanceWithContext( OUString::createFromAscii( "com.sun.star.configuration.ConfigurationProvider" ), m_xContext ),
+ UNO_QUERY_THROW );
// create an instance of the ConfigurationAccess for accessing the
// scripting runtime settings
- Reference< lang::XMultiServiceFactory > xConfigProvFactory =
- Reference < lang::XMultiServiceFactory >
- ( xInterface, UNO_QUERY_THROW );
- validateXRef( xConfigProvFactory,
- "ScriptStorage::ScriptStorage: cannot get XMultiServiceFactory interface from ConfigurationProvider" );
beans::PropertyValue configPath;
configPath.Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("nodepath"));
configPath.Value <<= ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.Scripting/ScriptRuntimes"));
Sequence < Any > aargs( 1 );
aargs[ 0 ] <<= configPath;
- xInterface = xConfigProvFactory->createInstanceWithArguments(
+ Reference< container::XNameAccess > xNameAccess(
+ xConfigProvFactory->createInstanceWithArguments(
OUString(RTL_CONSTASCII_USTRINGPARAM(
"com.sun.star.configuration.ConfigurationAccess")),
- aargs );
- validateXRef( xInterface,
- "ScriptStorage::ScriptStorage: cannot get ConfigurationAccess" );
- Reference< container::XNameAccess > xNameAccess =
- Reference < container::XNameAccess > ( xInterface,
- UNO_QUERY_THROW );
- validateXRef( xNameAccess,
- "ScriptStorage::ScriptStorage: cannot get ConfigurationAccess" );
+ aargs
+ ),
+ UNO_QUERY_THROW );
+
Sequence< OUString > names = xNameAccess->getElementNames();
for( int i = 0 ; i < names.getLength() ; i++ )
{
OSL_TRACE( "Getting propertyset for Lang=%s",
::rtl::OUStringToOString( names[i], RTL_TEXTENCODING_ASCII_US ).pData->buffer );
- Reference< beans::XPropertySet > xPropSet =
- Reference< beans::XPropertySet >( xNameAccess->getByName(names[i]),
- UNO_QUERY_THROW );
- validateXRef( xPropSet,
- "ScriptStorage::ScriptStorage: cannot get XPropertySet for name" );
+ Reference< beans::XPropertySet > xPropSet( xNameAccess->getByName( names[i] ), UNO_QUERY_THROW );
Any aProp = xPropSet->getPropertyValue(
OUString(RTL_CONSTASCII_USTRINGPARAM("SupportedFileExtensions")) );
Sequence< OUString > extns;
@@ -281,9 +260,7 @@ throw ( RuntimeException, Exception )
OUString xStringUri(m_stringUri);
ScriptMetadataImporter* SMI = new ScriptMetadataImporter( m_xContext );
- Reference< xml::sax::XExtendedDocumentHandler > xSMI( SMI );
-
- validateXRef( xSMI, "ScriptStorage::create: failed to obtain valid XExtendedDocumentHandler" );
+ Reference< xml::sax::XExtendedDocumentHandler > xSMI( SMI, UNO_SET_THROW );
xStringUri = xStringUri.concat( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
SCRIPT_DIR )) );
@@ -583,15 +560,14 @@ throw ( RuntimeException )
"/parcel.xml" )) ),
RTL_TEXTENCODING_ASCII_US ).pData->buffer );
- Reference< XInterface > xInterface =
+ xHandler.set(
m_xMgr->createInstanceWithContext(
- OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.sax.Writer")),
- m_xContext );
- validateXRef( xInterface, "ScriptStorage::save: cannot get sax.Writer" );
- xHandler = Reference<xml::sax::XExtendedDocumentHandler>(
- xInterface, UNO_QUERY_THROW );
- xSource = Reference< io::XActiveDataSource >(
- xHandler, UNO_QUERY_THROW );
+ OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.sax.Writer")),
+ m_xContext
+ ),
+ UNO_QUERY_THROW
+ );
+ xSource.set( xHandler, UNO_QUERY_THROW );
xSource->setOutputStream( xOS );
writeMetadataHeader( xHandler );
diff --git a/scripting/source/storage/ScriptStorage.hxx b/scripting/source/storage/ScriptStorage.hxx
index cb39bbadda06..cb39bbadda06 100644..100755
--- a/scripting/source/storage/ScriptStorage.hxx
+++ b/scripting/source/storage/ScriptStorage.hxx
diff --git a/scripting/source/storage/ScriptStorageManager.cxx b/scripting/source/storage/ScriptStorageManager.cxx
index b276e7fb7ff0..c99ad08988e2 100644..100755
--- a/scripting/source/storage/ScriptStorageManager.cxx
+++ b/scripting/source/storage/ScriptStorageManager.cxx
@@ -46,6 +46,7 @@
#include "ScriptStorageManager.hxx"
#include <util/util.hxx>
#include <util/scriptingconstants.hxx>
+#include <tools/diagnose_ex.h>
using namespace ::rtl;
using namespace ::com::sun::star;
@@ -66,31 +67,18 @@ static Sequence< OUString > s_serviceNames = Sequence< OUString >( &s_serviceNam
// ScriptStorageManager Constructor
ScriptStorageManager::ScriptStorageManager( const Reference<
XComponentContext > & xContext ) SAL_THROW ( ( RuntimeException ) )
- : m_xContext( xContext ), m_count( 0 ), m_securityMgr( xContext )
+ : m_xContext( xContext, UNO_SET_THROW ), m_count( 0 ), m_securityMgr( xContext )
{
OSL_TRACE( "< ScriptStorageManager ctor called >\n" );
- validateXRef( m_xContext,
- "ScriptStorageManager::ScriptStorageManager : cannot get component context" );
-
- m_xMgr = m_xContext->getServiceManager();
- validateXRef( m_xMgr,
- "ScriptStorageManager::ScriptStorageManager : cannot get service manager" );
+ m_xMgr.set( m_xContext->getServiceManager(), UNO_SET_THROW );
try
{
// obtain the macro expander singleton to use in determining the
// location of the application script storage
- Any aAny = m_xContext->getValueByName( OUString(RTL_CONSTASCII_USTRINGPARAM(
- "/singletons/com.sun.star.util.theMacroExpander" )) );
- Reference< util::XMacroExpander > xME;
- if ( sal_False == ( aAny >>= xME ) )
- {
- throw RuntimeException(
- OUSTR( "ScriptStorageManager::ScriptStorageManager: can't get XMacroExpander" ),
- Reference< XInterface >() );
- }
- validateXRef( xME, "ScriptStorageManager constructor: can't get MacroExpander" );
+ Reference< util::XMacroExpander > xME( m_xContext->getValueByName( OUString::createFromAscii(
+ "/singletons/com.sun.star.util.theMacroExpander" ) ), UNO_QUERY_THROW );
OUString base(RTL_CONSTASCII_USTRINGPARAM(
SAL_CONFIGFILE( "${$BRAND_BASE_DIR/program/bootstrap" )) );
@@ -121,12 +109,13 @@ SAL_THROW ( ( RuntimeException ) )
{
try
{
- Reference< XInterface > xInterface =
+ Reference< ucb::XSimpleFileAccess > xSFA(
m_xMgr->createInstanceWithContext(
- OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ucb.SimpleFileAccess")), m_xContext );
- validateXRef( xInterface,
- "ScriptStorageManager constructor: can't get SimpleFileAccess XInterface" );
- Reference< ucb::XSimpleFileAccess > xSFA( xInterface, UNO_QUERY_THROW );
+ OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ucb.SimpleFileAccess")),
+ m_xContext
+ ),
+ UNO_QUERY_THROW
+ );
setupAnyStorage( xSFA, xME->expandMacros( storageStr ), appStr );
}
@@ -163,13 +152,15 @@ SAL_THROW ( ( RuntimeException ) )
::rtl::OUStringToOString( storageStr,
RTL_TEXTENCODING_ASCII_US ).pData->buffer );
- Reference< XInterface > xInterface =
+ Reference< XInterface > xInterface(
m_xMgr->createInstanceWithArgumentsAndContext(
OUString(RTL_CONSTASCII_USTRINGPARAM(
"drafts.com.sun.star.script.framework.storage.ScriptStorage" )),
- aArgs, m_xContext );
-
- validateXRef( xInterface, "ScriptStorageManager:: setupAnyStorage: Can't create ScriptStorage for share" );
+ aArgs,
+ m_xContext
+ ),
+ UNO_QUERY_THROW
+ );
// and place it in the boost::unordered_map. Increment the counter
m_ScriptStorageMap[ m_count++ ] = xInterface;
@@ -209,8 +200,7 @@ ScriptStorageManager::createScriptStorage(
throw ( RuntimeException )
{
OSL_TRACE( "** ==> ScriptStorageManager in createScriptingStorage\n" );
- validateXRef( xSFA,
- "ScriptStorageManager::createScriptStorage: XSimpleFileAccess is not valid" );
+ ENSURE_OR_THROW( xSFA.is(), "ScriptStorageManager::createScriptStorage: XSimpleFileAccess is not valid" );
return setupAnyStorage( xSFA, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("")),
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("")) );
@@ -223,7 +213,7 @@ ScriptStorageManager::createScriptStorageWithURI(
throw ( RuntimeException )
{
OSL_TRACE( "** ==> ScriptStorageManager in createScriptingStorageWithURI\n" );
- validateXRef( xSFA, "ScriptStorageManager::createScriptStorage: XSimpleFileAccess is not valid" );
+ ENSURE_OR_THROW( xSFA.is(), "ScriptStorageManager::createScriptStorage: XSimpleFileAccess is not valid" );
// related to issue 11866
// warning dialog gets launched when adding binding to script in doc
@@ -281,7 +271,7 @@ throw( RuntimeException )
OUSTR( "ScriptStorageManager::getScriptStorage: invalid storage ID" ),
Reference< XInterface >() );
}
- validateXRef( itr->second,
+ ENSURE_OR_THROW( itr->second.is(),
"ScriptStorageManager::getScriptStorage: Cannot get ScriptStorage from ScriptStorageHash" );
return itr->second;
}
diff --git a/scripting/source/storage/ScriptStorageManager.hxx b/scripting/source/storage/ScriptStorageManager.hxx
index c5456a58a7eb..c5456a58a7eb 100644..100755
--- a/scripting/source/storage/ScriptStorageManager.hxx
+++ b/scripting/source/storage/ScriptStorageManager.hxx
diff --git a/scripting/source/storage/ScriptURI.cxx b/scripting/source/storage/ScriptURI.cxx
index 72e91f32c549..72e91f32c549 100644..100755
--- a/scripting/source/storage/ScriptURI.cxx
+++ b/scripting/source/storage/ScriptURI.cxx
diff --git a/scripting/source/storage/ScriptURI.hxx b/scripting/source/storage/ScriptURI.hxx
index 24de44a00597..24de44a00597 100644..100755
--- a/scripting/source/storage/ScriptURI.hxx
+++ b/scripting/source/storage/ScriptURI.hxx
diff --git a/scripting/source/storage/XMLElement.cxx b/scripting/source/storage/XMLElement.cxx
index b80efd4b2ad5..b80efd4b2ad5 100644..100755
--- a/scripting/source/storage/XMLElement.cxx
+++ b/scripting/source/storage/XMLElement.cxx
diff --git a/scripting/source/storage/XMLElement.hxx b/scripting/source/storage/XMLElement.hxx
index aae705d9b2ea..aae705d9b2ea 100644..100755
--- a/scripting/source/storage/XMLElement.hxx
+++ b/scripting/source/storage/XMLElement.hxx
diff --git a/scripting/source/storage/exports.dxp b/scripting/source/storage/exports.dxp
index 9630d7e06768..f0e1c69934bc 100644..100755
--- a/scripting/source/storage/exports.dxp
+++ b/scripting/source/storage/exports.dxp
@@ -1,3 +1,2 @@
component_getImplementationEnvironment
-component_writeInfo
component_getFactory
diff --git a/scripting/source/storage/makefile.mk b/scripting/source/storage/makefile.mk
index 7ba35edf0692..7ba35edf0692 100644..100755
--- a/scripting/source/storage/makefile.mk
+++ b/scripting/source/storage/makefile.mk
diff --git a/scripting/source/storage/storage.xml b/scripting/source/storage/storage.xml
index 6438dc7006b2..6438dc7006b2 100644..100755
--- a/scripting/source/storage/storage.xml
+++ b/scripting/source/storage/storage.xml
diff --git a/scripting/source/stringresource/makefile.mk b/scripting/source/stringresource/makefile.mk
index dfc2d1979190..71f8ee39e748 100644..100755
--- a/scripting/source/stringresource/makefile.mk
+++ b/scripting/source/stringresource/makefile.mk
@@ -60,3 +60,11 @@ SHL1LIBS=$(SLB)$/$(TARGET).lib
# --- Targets ------------------------------------------------------
.INCLUDE : target.mk
+
+ALLTAR : $(MISC)/stringresource.component
+
+$(MISC)/stringresource.component .ERRREMOVE : \
+ $(SOLARENV)/bin/createcomponent.xslt stringresource.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt stringresource.component
diff --git a/scripting/source/stringresource/stringresource.component b/scripting/source/stringresource/stringresource.component
new file mode 100755
index 000000000000..6d64d9553945
--- /dev/null
+++ b/scripting/source/stringresource/stringresource.component
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org 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 version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.scripting.StringResource">
+ <service name="com.sun.star.resource.StringResource"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.scripting.StringResourceWithLocation">
+ <service name="com.sun.star.resource.StringResourceWithLocation"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.scripting.StringResourceWithStorage">
+ <service name="com.sun.star.resource.StringResourceWithStorage"/>
+ </implementation>
+</component>
diff --git a/scripting/source/stringresource/stringresource.cxx b/scripting/source/stringresource/stringresource.cxx
index cf04f09e3ec5..db57c6b7ca39 100644..100755
--- a/scripting/source/stringresource/stringresource.cxx
+++ b/scripting/source/stringresource/stringresource.cxx
@@ -3079,13 +3079,6 @@ extern "C"
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
- sal_Bool SAL_CALL component_writeInfo(
- lang::XMultiServiceFactory * pServiceManager, registry::XRegistryKey * pRegistryKey )
- {
- return ::cppu::component_writeInfoHelper(
- pServiceManager, pRegistryKey, ::stringresource::s_component_entries );
- }
-
void * SAL_CALL component_getFactory(
const sal_Char * pImplName, lang::XMultiServiceFactory * pServiceManager,
registry::XRegistryKey * pRegistryKey )
diff --git a/scripting/source/stringresource/stringresource.hxx b/scripting/source/stringresource/stringresource.hxx
index 972d28dbdf5d..972d28dbdf5d 100644..100755
--- a/scripting/source/stringresource/stringresource.hxx
+++ b/scripting/source/stringresource/stringresource.hxx
diff --git a/scripting/source/stringresource/stringresource.xml b/scripting/source/stringresource/stringresource.xml
index 51cbf9921d8a..51cbf9921d8a 100644..100755
--- a/scripting/source/stringresource/stringresource.xml
+++ b/scripting/source/stringresource/stringresource.xml
diff --git a/scripting/source/vbaevents/eventhelper.cxx b/scripting/source/vbaevents/eventhelper.cxx
index b9ee8b3216c4..b9ee8b3216c4 100644..100755
--- a/scripting/source/vbaevents/eventhelper.cxx
+++ b/scripting/source/vbaevents/eventhelper.cxx
diff --git a/scripting/source/vbaevents/makefile.mk b/scripting/source/vbaevents/makefile.mk
index 09180a1c616d..d7bca56b9670 100644..100755
--- a/scripting/source/vbaevents/makefile.mk
+++ b/scripting/source/vbaevents/makefile.mk
@@ -29,11 +29,6 @@ PRJ=..$/..
PRJNAME=scripting
TARGET=vbaevents
-.IF "$(ENABLE_VBA)"!="YES"
-dummy:
- @echo "not building vbaevents..."
-.ENDIF
-
VISIBILITY_HIDDEN=TRUE
NO_BSYMBOLIC= TRUE
ENABLE_EXCEPTIONS=TRUE
@@ -86,3 +81,11 @@ $(MISC)$/$(TARGET).don : $(SOLARBINDIR)$/oovbaapi.rdb
+$(CPPUMAKER) -O$(INCCOM)$/$(TARGET) -BUCR $(SOLARBINDIR)$/oovbaapi.rdb -X$(SOLARBINDIR)$/types.rdb && echo > $@
echo $@
+
+ALLTAR : $(MISC)/vbaevents.component
+
+$(MISC)/vbaevents.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ vbaevents.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt vbaevents.component
diff --git a/scripting/source/vbaevents/service.cxx b/scripting/source/vbaevents/service.cxx
index dce5ddcf6884..b77c35013be7 100644..100755
--- a/scripting/source/vbaevents/service.cxx
+++ b/scripting/source/vbaevents/service.cxx
@@ -108,16 +108,6 @@ extern "C"
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
- SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(
- lang::XMultiServiceFactory * pServiceManager, registry::XRegistryKey * pRegistryKey )
- {
- OSL_TRACE("In component_writeInfo");
- if ( ::cppu::component_writeInfoHelper(
- pServiceManager, pRegistryKey, s_component_entries ) )
- return sal_True;
- return sal_False;
- }
-
SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory(
const sal_Char * pImplName, lang::XMultiServiceFactory * pServiceManager,
registry::XRegistryKey * pRegistryKey )
diff --git a/scripting/source/vbaevents/vbaevents.component b/scripting/source/vbaevents/vbaevents.component
new file mode 100755
index 000000000000..e8cbf3d88ff7
--- /dev/null
+++ b/scripting/source/vbaevents/vbaevents.component
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org 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 version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="ooo.vba.EventListener">
+ <service name="ooo.vba.EventListener"/>
+ </implementation>
+ <implementation name="ooo.vba.VBAToOOEventDesc">
+ <service name="ooo.vba.VBAToOOEventDesc"/>
+ </implementation>
+</component>
diff --git a/scripting/source/vbaevents/vbamsformreturntypes.hxx b/scripting/source/vbaevents/vbamsformreturntypes.hxx
index 82e6ddce8ff4..82e6ddce8ff4 100644..100755
--- a/scripting/source/vbaevents/vbamsformreturntypes.hxx
+++ b/scripting/source/vbaevents/vbamsformreturntypes.hxx