summaryrefslogtreecommitdiff
path: root/svl/source/items/style.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'svl/source/items/style.cxx')
-rw-r--r--svl/source/items/style.cxx22
1 files changed, 21 insertions, 1 deletions
diff --git a/svl/source/items/style.cxx b/svl/source/items/style.cxx
index b8bed49b603b..60c622208d53 100644
--- a/svl/source/items/style.cxx
+++ b/svl/source/items/style.cxx
@@ -28,7 +28,8 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svl.hxx"
-#ifndef GCC
+#ifndef _COM_SUN_STAR_LANG_XCOMPONENT_HPP_
+#include <com/sun/star/lang/XComponent.hpp>
#endif
#define _SVSTDARR_STRINGS
@@ -808,6 +809,16 @@ void SfxStyleSheetBasePool::Remove( SfxStyleSheetBase* p )
{
// Alle Styles umsetzen, deren Parent dieser hier ist
ChangeParent( p->GetName(), p->GetParent() );
+
+ com::sun::star::uno::Reference< com::sun::star::lang::XComponent > xComp( static_cast< ::cppu::OWeakObject* >((*aIter).get()), com::sun::star::uno::UNO_QUERY );
+ if( xComp.is() ) try
+ {
+ xComp->dispose();
+ }
+ catch( com::sun::star::uno::Exception& )
+ {
+ }
+
aStyles.erase(aIter);
Broadcast( SfxStyleSheetHint( SFX_STYLESHEET_ERASED, *p ) );
}
@@ -838,6 +849,15 @@ void SfxStyleSheetBasePool::Clear()
SfxStyles::iterator aIter( aClearStyles.begin() );
while( aIter != aClearStyles.end() )
{
+ com::sun::star::uno::Reference< com::sun::star::lang::XComponent > xComp( static_cast< ::cppu::OWeakObject* >((*aIter).get()), com::sun::star::uno::UNO_QUERY );
+ if( xComp.is() ) try
+ {
+ xComp->dispose();
+ }
+ catch( com::sun::star::uno::Exception& )
+ {
+ }
+
Broadcast( SfxStyleSheetHint( SFX_STYLESHEET_ERASED, *(*aIter++).get() ) );
}
}