summaryrefslogtreecommitdiff
path: root/svl
diff options
context:
space:
mode:
authorArmin Le Grand <alg@apache.org>2012-06-20 08:17:23 +0000
committerAndras Timar <andras.timar@collabora.com>2013-11-05 10:38:56 +0100
commitf6badb7d40047cc9f582d64e999c905786437449 (patch)
treefb3bfdecda900c8d35566a409283b0f6e2068aef /svl
parentb3e430cf69f75130c50cf23600f611b5a2e15859 (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 (cherry picked from commit 4c8ffa01131f2df2b314218731d83bd776944802) Signed-off-by: Thorsten Behrens <tbehrens@suse.com>
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 6df5bfa71b6e..ea08cc309e51 100644
--- a/svl/source/items/style.cxx
+++ b/svl/source/items/style.cxx
@@ -765,14 +765,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 ) );