summaryrefslogtreecommitdiff
path: root/svx/source/svdraw/svdpntv.cxx
diff options
context:
space:
mode:
authorVladimir Glazunov <vg@openoffice.org>2010-03-24 15:39:09 +0100
committerVladimir Glazunov <vg@openoffice.org>2010-03-24 15:39:09 +0100
commite327e7e9a2647675a9d09d2df69a086631c5ca68 (patch)
treeb646b59ce2b66fa4d50c00a838c09a8931f42aa3 /svx/source/svdraw/svdpntv.cxx
parent584eac4b8be31ea46c297b63fb1dc330560bfc5f (diff)
#i108976# applied patch fix a crash when default style is deleted - transplanted from 263352@impresscomments1
Diffstat (limited to 'svx/source/svdraw/svdpntv.cxx')
-rwxr-xr-xsvx/source/svdraw/svdpntv.cxx18
1 files changed, 17 insertions, 1 deletions
diff --git a/svx/source/svdraw/svdpntv.cxx b/svx/source/svdraw/svdpntv.cxx
index 0d526ff8a279..998c687608fc 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);
@@ -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();