diff options
Diffstat (limited to 'sd/source/core/drawdoc3.cxx')
-rw-r--r-- | sd/source/core/drawdoc3.cxx | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sd/source/core/drawdoc3.cxx b/sd/source/core/drawdoc3.cxx index a86bdbd05912..0673299e2d94 100644 --- a/sd/source/core/drawdoc3.cxx +++ b/sd/source/core/drawdoc3.cxx @@ -1245,6 +1245,7 @@ void SdDrawDocument::RemoveUnnecessaryMasterPages(SdPage* pMasterPage, bool bOnl { // Do not delete master pages that have their precious flag set bool bDeleteMaster = !pMaster->IsPrecious(); + bool bSoleOwnerOfStyleSheet = true; OUString aLayoutName = pMaster->GetLayoutName(); if(bOnlyDuplicatePages ) @@ -1259,6 +1260,10 @@ void SdDrawDocument::RemoveUnnecessaryMasterPages(SdPage* pMasterPage, bool bOnl { // duplicate page found -> remove it bDeleteMaster = true; + + const SfxStyleSheet* pRefSheet = pMaster->getSdrPageProperties().GetStyleSheet(); + const SfxStyleSheet* pTestSheet = pMPg->getSdrPageProperties().GetStyleSheet(); + bSoleOwnerOfStyleSheet = pRefSheet != pTestSheet; } } } @@ -1292,7 +1297,7 @@ void SdDrawDocument::RemoveUnnecessaryMasterPages(SdPage* pMasterPage, bool bOnl delete pNotesMaster; if( bUndo ) - AddUndo(GetSdrUndoFactory().CreateUndoDeletePage(*pMaster)); + AddUndo(GetSdrUndoFactory().CreateUndoDeletePage(*pMaster, bSoleOwnerOfStyleSheet)); RemoveMasterPage( pMaster->GetPageNum() ); |