diff -ru svx.orig/source/svdraw/svdpntv.cxx svx/source/svdraw/svdpntv.cxx --- svx.orig/source/svdraw/svdpntv.cxx 2010-02-04 11:40:05.000000000 +0000 +++ svx/source/svdraw/svdpntv.cxx 2010-02-04 14:25:45.000000000 +0000 @@ -296,6 +296,8 @@ SdrPaintView::~SdrPaintView() { DBG_DTOR(SdrPaintView,NULL); + if (pDefaultStyleSheet) + EndListening(*pDefaultStyleSheet); EndListening( maColorConfig ); ClearPageView(); @@ -319,8 +321,16 @@ //////////////////////////////////////////////////////////////////////////////////////////////////// -void __EXPORT SdrPaintView::Notify(SfxBroadcaster& /*rBC*/, const SfxHint& rHint) +void __EXPORT SdrPaintView::Notify(SfxBroadcaster& rBC, const SfxHint& rHint) { + //If the stylesheet has been destroyed + if (&rBC == pDefaultStyleSheet) + { + if (rHint.ISA(SfxSimpleHint) && ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING) + pDefaultStyleSheet = NULL; + return; + } + BOOL bObjChg=!bSomeObjChgdFlag; // TRUE= auswerten fuer ComeBack-Timer if (bObjChg) { SdrHint* pSdrHint=PTR_CAST(SdrHint,&rHint); @@ -1240,7 +1250,12 @@ void SdrPaintView::SetDefaultStyleSheet(SfxStyleSheet* pStyleSheet, BOOL bDontRemoveHardAttr) { - pDefaultStyleSheet=pStyleSheet; + if (pDefaultStyleSheet) + EndListening(*pDefaultStyleSheet); + pDefaultStyleSheet=pStyleSheet; + if (pDefaultStyleSheet) + StartListening(*pDefaultStyleSheet); + if (pStyleSheet!=NULL && !bDontRemoveHardAttr) { SfxWhichIter aIter(pStyleSheet->GetItemSet()); USHORT nWhich=aIter.FirstWhich();