diff options
author | Mikhail Voytenko <mav@openoffice.org> | 2011-01-06 14:57:12 +0100 |
---|---|---|
committer | Mikhail Voytenko <mav@openoffice.org> | 2011-01-06 14:57:12 +0100 |
commit | 8ff51afa0dcd4e5e644e923131ee72435c80b57b (patch) | |
tree | d63f6b6e298485b5f29f60c7af25baca46f59375 /scripting | |
parent | fa1f3c352c6126b24ab5af87ea4ebea742c546c2 (diff) | |
parent | 794c821e4d48c34aa376cdc7b6ab2cb029d9574d (diff) |
removetooltypes01: rebase to DEV300_m96
Diffstat (limited to 'scripting')
-rwxr-xr-x | scripting/prj/build.lst | 2 | ||||
-rw-r--r-- | scripting/source/basprov/basscript.cxx | 22 | ||||
-rw-r--r-- | scripting/source/basprov/basscript.hxx | 6 | ||||
-rw-r--r-- | scripting/source/basprov/makefile.mk | 1 |
4 files changed, 29 insertions, 2 deletions
diff --git a/scripting/prj/build.lst b/scripting/prj/build.lst index 7d5162173eae..d0ceb4cb818c 100755 --- a/scripting/prj/build.lst +++ b/scripting/prj/build.lst @@ -1,4 +1,4 @@ -tc scripting : oovbaapi vbahelper bridges rdbmaker vcl xmlscript basic sfx2 rhino BSH:beanshell javaunohelper NULL +tc scripting : oovbaapi vbahelper bridges rdbmaker vcl xmlscript basic sfx2 rhino BSH:beanshell javaunohelper LIBXSLT:libxslt NULL tc scripting usr1 - all tc1_mkout NULL tc scripting\inc nmake - all tc1_inc NULL tc scripting\source\provider nmake - all tc1_scriptingprovider tc1_inc NULL diff --git a/scripting/source/basprov/basscript.cxx b/scripting/source/basprov/basscript.cxx index c6de155e3ed0..24bba1e7bff6 100644 --- a/scripting/source/basprov/basscript.cxx +++ b/scripting/source/basprov/basscript.cxx @@ -80,11 +80,33 @@ namespace basprov ,m_documentBasicManager( &documentBasicManager ) ,m_xDocumentScriptContext( documentScriptContext ) { + StartListening( *m_documentBasicManager ); } // ----------------------------------------------------------------------------- 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 + } } // ----------------------------------------------------------------------------- diff --git a/scripting/source/basprov/basscript.hxx b/scripting/source/basprov/basscript.hxx index 4a3d6f1ab61d..772a9166cde3 100644 --- a/scripting/source/basprov/basscript.hxx +++ b/scripting/source/basprov/basscript.hxx @@ -32,6 +32,7 @@ #include <com/sun/star/document/XScriptInvocationContext.hpp> #include <cppuhelper/implbase1.hxx> #include <basic/sbmeth.hxx> +#include <svl/lstner.hxx> class BasicManager; @@ -49,7 +50,7 @@ namespace basprov ::com::sun::star::script::provider::XScript > BasicScriptImpl_BASE; - class BasicScriptImpl : public BasicScriptImpl_BASE + class BasicScriptImpl : public BasicScriptImpl_BASE, public SfxListener { private: SbMethodRef m_xMethod; @@ -80,6 +81,9 @@ namespace basprov ::com::sun::star::script::provider::ScriptFrameworkErrorException, ::com::sun::star::reflection::InvocationTargetException, ::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 c98f961e6bd3..bde15f95d5a4 100644 --- a/scripting/source/basprov/makefile.mk +++ b/scripting/source/basprov/makefile.mk @@ -58,6 +58,7 @@ SHL1STDLIBS= \ $(SFX2LIB) \ $(BASICLIB) \ $(VCLLIB) \ + $(SVLLIB) \ $(TOOLSLIB) \ $(UCBHELPERLIB) \ $(COMPHELPERLIB) \ |