diff options
author | Jens-Heiner Rechtien <hr@openoffice.org> | 2007-11-01 14:29:46 +0000 |
---|---|---|
committer | Jens-Heiner Rechtien <hr@openoffice.org> | 2007-11-01 14:29:46 +0000 |
commit | bdf2c919ca46f78ef4af900caa8d5cd875f57525 (patch) | |
tree | 4432029e68be031fda6daea982a0ec55ac2bd353 /sd/source/ui/view/unmodpg.cxx | |
parent | 1d78946969aec28864ec01432179f69907750608 (diff) |
INTEGRATION: CWS impress131_SRC680 (1.10.190); FILE MERGED
2007/10/17 16:10:53 cl 1.10.190.1: #i75001# added undo for renaming a master page
Diffstat (limited to 'sd/source/ui/view/unmodpg.cxx')
-rw-r--r-- | sd/source/ui/view/unmodpg.cxx | 40 |
1 files changed, 38 insertions, 2 deletions
diff --git a/sd/source/ui/view/unmodpg.cxx b/sd/source/ui/view/unmodpg.cxx index 77451b5a1272..e0927924b920 100644 --- a/sd/source/ui/view/unmodpg.cxx +++ b/sd/source/ui/view/unmodpg.cxx @@ -4,9 +4,9 @@ * * $RCSfile: unmodpg.cxx,v $ * - * $Revision: 1.10 $ + * $Revision: 1.11 $ * - * last change: $Author: kz $ $Date: 2006-12-12 19:23:04 $ + * last change: $Author: hr $ $Date: 2007-11-01 15:29:46 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -48,6 +48,7 @@ #include "strings.hrc" +#include "glob.hxx" #include "glob.hrc" // STR_BCKGRND, STR_BCKGRNDOBJ #include "app.hrc" // SID_SWITCHPAGE @@ -227,4 +228,39 @@ String ModifyPageUndoAction::GetComment() const return maComment; } +// -------------------------------------------------------------------- + +RenameLayoutTemplateUndoAction::RenameLayoutTemplateUndoAction( SdDrawDocument* pDocument, const String& rOldLayoutName, const String& rNewLayoutName ) +: SdUndoAction(pDocument) +, maOldName( rOldLayoutName ) +, maNewName( rNewLayoutName ) +, maComment(SdResId(STR_TITLE_RENAMESLIDE)) +{ + USHORT nPos = maOldName.SearchAscii( SD_LT_SEPARATOR ); + if( nPos != (USHORT)-1 ) + maOldName.Erase(nPos); +} + +void RenameLayoutTemplateUndoAction::Undo() +{ + String aLayoutName( maNewName ); + aLayoutName.AppendAscii( RTL_CONSTASCII_STRINGPARAM( SD_LT_SEPARATOR )); + aLayoutName.Append( String(SdResId(STR_LAYOUT_OUTLINE))) ; + + mpDoc->RenameLayoutTemplate( aLayoutName, maOldName ); +} + +void RenameLayoutTemplateUndoAction::Redo() +{ + String aLayoutName( maOldName ); + aLayoutName.AppendAscii( RTL_CONSTASCII_STRINGPARAM( SD_LT_SEPARATOR )); + aLayoutName.Append( String(SdResId(STR_LAYOUT_OUTLINE))) ; + + mpDoc->RenameLayoutTemplate( aLayoutName, maNewName ); +} + +String RenameLayoutTemplateUndoAction::GetComment() const +{ + return maComment; +} |