undoapi: merge after pulling DEV300.m94
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
@@ -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 );
|
||||
};
|
||||
|
||||
//.........................................................................
|
||||
|
@@ -58,6 +58,7 @@ SHL1STDLIBS= \
|
||||
$(SFX2LIB) \
|
||||
$(BASICLIB) \
|
||||
$(VCLLIB) \
|
||||
$(SVLLIB) \
|
||||
$(TOOLSLIB) \
|
||||
$(UCBHELPERLIB) \
|
||||
$(COMPHELPERLIB) \
|
||||
|
Reference in New Issue
Block a user