diff options
Diffstat (limited to 'scripting/source/basprov')
-rwxr-xr-x[-rw-r--r--] | scripting/source/basprov/baslibnode.cxx | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | scripting/source/basprov/baslibnode.hxx | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | scripting/source/basprov/basmethnode.cxx | 2 | ||||
-rwxr-xr-x[-rw-r--r--] | scripting/source/basprov/basmethnode.hxx | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | scripting/source/basprov/basmodnode.cxx | 4 | ||||
-rwxr-xr-x[-rw-r--r--] | scripting/source/basprov/basmodnode.hxx | 0 | ||||
-rwxr-xr-x | scripting/source/basprov/basprov.component | 37 | ||||
-rwxr-xr-x[-rw-r--r--] | scripting/source/basprov/basprov.cxx | 9 | ||||
-rwxr-xr-x[-rw-r--r--] | scripting/source/basprov/basprov.hxx | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | scripting/source/basprov/basprov.xml | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | scripting/source/basprov/basscript.cxx | 29 | ||||
-rwxr-xr-x[-rw-r--r--] | scripting/source/basprov/basscript.hxx | 6 | ||||
-rwxr-xr-x[-rw-r--r--] | scripting/source/basprov/makefile.mk | 9 |
13 files changed, 80 insertions, 16 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 |