summaryrefslogtreecommitdiff
path: root/svl
diff options
context:
space:
mode:
authorArmin Le Grand <alg@apache.org>2012-06-20 08:17:23 +0000
committerMichael Meeks <michael.meeks@suse.com>2013-04-30 15:39:57 +0100
commit4c8ffa01131f2df2b314218731d83bd776944802 (patch)
tree485475b3f905e01825b98b13a116cef6da99977d /svl
parent6ab8f15653af431fcacffb3c9227f90aa04456f7 (diff)
i#120015# Let SdrUndoAttrObj remember a reference to the used style to survive
removal of the style by UI (which creates no undo actions). Re-add the style when undoing if needed. Change-Id: I6069a1cb42dfaeb0dd35fdc15687fd307f2b641e
Diffstat (limited to 'svl')
-rw-r--r--svl/source/items/style.cxx21
1 files changed, 13 insertions, 8 deletions
diff --git a/svl/source/items/style.cxx b/svl/source/items/style.cxx
index c2879e799f1a..8c8c19314736 100644
--- a/svl/source/items/style.cxx
+++ b/svl/source/items/style.cxx
@@ -734,14 +734,19 @@ 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& )
- {
- }
+ // #120015# Do not dispose, the removed StyleSheet may still be used in
+ // existing SdrUndoAttrObj incarnations. Rely on refcounting for disposal,
+ // this works well under normal conditions (checked breaking and counting
+ // on SfxStyleSheetBase constructors and destructors)
+ //
+ // 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 ) );