From ef7c5c7534ecf24b2af1bc0de6e221327b4a4c49 Mon Sep 17 00:00:00 2001 From: Kurt Zenker Date: Thu, 4 Jun 2009 16:21:29 +0000 Subject: CWS-TOOLING: integrate CWS clnoundo 2009-05-18 09:40:22 +0200 wg r271998 : i102011 2009-04-28 12:20:24 +0200 cl r271318 : CWS-TOOLING: rebase CWS clnoundo to trunk@270723 (milestone: DEV300:m46) 2009-04-02 11:37:14 +0200 cl r270388 : #i100371# check valid positions all the time to avoid crashes during model lock 2009-03-30 13:02:27 +0200 cl r270219 : #i100371# do not create undo actions in drawing layer during load 2009-03-30 12:59:41 +0200 cl r270218 : #i100371# do not create undo actions in drawing layer during load 2009-03-30 12:55:06 +0200 cl r270217 : #i100371# do not create undo actions in drawing layer during load 2009-03-30 12:53:27 +0200 cl r270216 : #i100371# do not create undo actions in drawing layer during load 2009-03-30 12:49:28 +0200 cl r270215 : #i100371# added EnableUndo() and IsUndoEnabled() --- sd/source/ui/view/viewshe3.cxx | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'sd/source/ui/view/viewshe3.cxx') diff --git a/sd/source/ui/view/viewshe3.cxx b/sd/source/ui/view/viewshe3.cxx index 046dfab9526e..38e2b6b88001 100644 --- a/sd/source/ui/view/viewshe3.cxx +++ b/sd/source/ui/view/viewshe3.cxx @@ -324,7 +324,9 @@ SdPage* ViewShell::CreateOrDuplicatePage ( // 2. Create a new page or duplicate an existing one. View* pDrView = GetView(); - pDrView->BegUndo( String( SdResId(STR_INSERTPAGE) ) ); + const bool bUndo = pDrView && pDrView->IsUndoEnabled(); + if( bUndo ) + pDrView->BegUndo( String( SdResId(STR_INSERTPAGE) ) ); USHORT nNewPageIndex = 0xffff; switch (nSId) @@ -403,13 +405,18 @@ SdPage* ViewShell::CreateOrDuplicatePage ( } SdPage* pNewPage = 0; if(nNewPageIndex != 0xffff) - { pNewPage = pDocument->GetSdPage(nNewPageIndex, PK_STANDARD); - pDrView->AddUndo(pDocument->GetSdrUndoFactory().CreateUndoNewPage(*pNewPage)); - pDrView->AddUndo(pDocument->GetSdrUndoFactory().CreateUndoNewPage(*pDocument->GetSdPage (nNewPageIndex, PK_NOTES))); - } - pDrView->EndUndo(); + if( bUndo ) + { + if( pNewPage ) + { + pDrView->AddUndo(pDocument->GetSdrUndoFactory().CreateUndoNewPage(*pNewPage)); + pDrView->AddUndo(pDocument->GetSdrUndoFactory().CreateUndoNewPage(*pDocument->GetSdPage (nNewPageIndex, PK_NOTES))); + } + + pDrView->EndUndo(); + } return pNewPage; } -- cgit