summaryrefslogtreecommitdiff
path: root/svx/source/svdraw/svdpntv.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'svx/source/svdraw/svdpntv.cxx')
-rwxr-xr-x[-rw-r--r--]svx/source/svdraw/svdpntv.cxx20
1 files changed, 18 insertions, 2 deletions
diff --git a/svx/source/svdraw/svdpntv.cxx b/svx/source/svdraw/svdpntv.cxx
index fb47734b1091..998c687608fc 100644..100755
--- a/svx/source/svdraw/svdpntv.cxx
+++ b/svx/source/svdraw/svdpntv.cxx
@@ -294,6 +294,9 @@ SdrPaintView::SdrPaintView(SdrModel* pModel1, OutputDevice* pOut)
SdrPaintView::~SdrPaintView()
{
DBG_DTOR(SdrPaintView,NULL);
+ if (pDefaultStyleSheet)
+ EndListening(*pDefaultStyleSheet);
+
maColorConfig.RemoveListener(this);
ClearPageView();
@@ -317,8 +320,16 @@ SdrPaintView::~SdrPaintView()
////////////////////////////////////////////////////////////////////////////////////////////////////
-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);
@@ -333,7 +344,7 @@ void __EXPORT SdrPaintView::Notify(SfxBroadcaster& /*rBC*/, const SfxHint& rHint
if (eKind==HINT_PAGEORDERCHG) {
const SdrPage* pPg=pSdrHint->GetPage();
- if(!pPg->IsInserted())
+ if(pPg && !pPg->IsInserted())
{
if(mpPageView && mpPageView->GetPage() == pPg)
{
@@ -1238,7 +1249,12 @@ void SdrPaintView::SetDefaultAttr(const SfxItemSet& rAttr, BOOL bReplaceAll)
void SdrPaintView::SetDefaultStyleSheet(SfxStyleSheet* pStyleSheet, BOOL bDontRemoveHardAttr)
{
+ if (pDefaultStyleSheet)
+ EndListening(*pDefaultStyleSheet);
pDefaultStyleSheet=pStyleSheet;
+ if (pDefaultStyleSheet)
+ StartListening(*pDefaultStyleSheet);
+
if (pStyleSheet!=NULL && !bDontRemoveHardAttr) {
SfxWhichIter aIter(pStyleSheet->GetItemSet());
USHORT nWhich=aIter.FirstWhich();