summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
Diffstat (limited to 'sd')
-rw-r--r--sd/source/core/drawdoc3.cxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/sd/source/core/drawdoc3.cxx b/sd/source/core/drawdoc3.cxx
index 480a1d71cc31..e379ed0e9717 100644
--- a/sd/source/core/drawdoc3.cxx
+++ b/sd/source/core/drawdoc3.cxx
@@ -1571,10 +1571,12 @@ void SdDrawDocument::SetMasterPage(sal_uInt16 nSdPageNum,
DBG_ASSERT(bTest, "Renaming StyleSheet failed.");
pMySheet->GetItemSet().ClearItem(0); // Delete all
- StyleSheetUndoAction* pUndoChStyle = new StyleSheetUndoAction(this,
- pMySheet, &pHisSheet->GetItemSet());
if (bUndo)
+ {
+ StyleSheetUndoAction* pUndoChStyle = new StyleSheetUndoAction(this,
+ pMySheet, &pHisSheet->GetItemSet());
pUndoMgr->AddUndoAction(pUndoChStyle);
+ }
pMySheet->GetItemSet().Put(pHisSheet->GetItemSet());
pMySheet->Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED));
}