summaryrefslogtreecommitdiff
path: root/framework/source/services/tabwindowservice.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'framework/source/services/tabwindowservice.cxx')
-rw-r--r--framework/source/services/tabwindowservice.cxx32
1 files changed, 24 insertions, 8 deletions
diff --git a/framework/source/services/tabwindowservice.cxx b/framework/source/services/tabwindowservice.cxx
index 6c78600aa9..71136a9ac4 100644
--- a/framework/source/services/tabwindowservice.cxx
+++ b/framework/source/services/tabwindowservice.cxx
@@ -75,18 +75,20 @@ namespace framework{
// css::uno::XInterface, XTypeProvider, XServiceInfo
//*****************************************************************************************************************
-DEFINE_XINTERFACE_5 ( TabWindowService ,
+DEFINE_XINTERFACE_6 ( TabWindowService ,
OWeakObject ,
DIRECT_INTERFACE(css::lang::XTypeProvider ),
DIRECT_INTERFACE(css::lang::XServiceInfo ),
+ DIRECT_INTERFACE(css::lang::XComponent),
DIRECT_INTERFACE(css::awt::XSimpleTabController),
DIRECT_INTERFACE(css::beans::XPropertySet ),
DIRECT_INTERFACE(css::beans::XPropertySetInfo )
)
-DEFINE_XTYPEPROVIDER_5 ( TabWindowService ,
+DEFINE_XTYPEPROVIDER_6 ( TabWindowService ,
css::lang::XTypeProvider ,
css::lang::XServiceInfo ,
+ css::lang::XComponent ,
css::awt::XSimpleTabController ,
css::beans::XPropertySet ,
css::beans::XPropertySetInfo
@@ -100,7 +102,7 @@ DEFINE_XSERVICEINFO_MULTISERVICE ( TabWindowService ,
DEFINE_INIT_SERVICE ( TabWindowService,
{
- impl_initializePropInfo();
+ impl_initializePropInfo();
m_aTransactionManager.setWorkingMode( E_WORK );
}
)
@@ -141,7 +143,12 @@ TabWindowService::TabWindowService( const css::uno::Reference< css::lang::XMulti
// destructor
//*****************************************************************************************************************
TabWindowService::~TabWindowService()
-{
+{
+ // SAFE->
+ ResetableGuard aGuard(m_aLock);
+
+ if (m_pTabWin)
+ m_pTabWin->RemoveEventListener( LINK( this, TabWindowService, EventListener ) );
}
//*****************************************************************************************************************
@@ -286,8 +293,11 @@ void SAL_CALL TabWindowService::dispose()
m_lListener.disposeAndClear (aEvent);
+ if (m_pTabWin)
+ m_pTabWin->RemoveEventListener( LINK( this, TabWindowService, EventListener ) );
+
m_pTabWin = NULL;
- m_xTabWin.clear ();
+ m_xTabWin.clear();
}
//*****************************************************************************************************************
@@ -357,6 +367,7 @@ css::uno::Any SAL_CALL TabWindowService::impl_getPropertyValue(const ::rtl::OUSt
//*****************************************************************************************************************
IMPL_LINK( TabWindowService, EventListener, VclSimpleEvent*, pEvent )
{
+
if ( !pEvent && !pEvent->ISA(VclWindowEvent))
return 0;
@@ -369,6 +380,11 @@ IMPL_LINK( TabWindowService, EventListener, VclSimpleEvent*, pEvent )
if (nEventId == VCLEVENT_OBJECT_DYING)
{
m_lListener.disposeAndClear (aEvent);
+
+ m_pTabWin->RemoveEventListener( LINK( this, TabWindowService, EventListener ) );
+ m_pTabWin = NULL;
+ m_xTabWin.clear();
+
return 0;
}
@@ -454,9 +470,9 @@ FwkTabWindow* TabWindowService::mem_TabWin ()
FwkTabWindow* pWin = NULL;
if ( ! m_xTabWin.is ())
- {
- Window* pFakeParent = dynamic_cast< Window* >(Application::GetDefaultDevice ());
-
+ {
+ Window* pFakeParent = dynamic_cast< Window* >(Application::GetDefaultDevice ());
+
m_pTabWin = new FwkTabWindow (pFakeParent);
m_xTabWin = VCLUnoHelper::GetInterface (m_pTabWin);