diff options
author | Andre Fischer <af@apache.org> | 2012-07-06 10:45:08 +0000 |
---|---|---|
committer | Andre Fischer <af@apache.org> | 2012-07-06 10:45:08 +0000 |
commit | 7daa651fbc74a6fc08d713282b9e25cda14e39e9 (patch) | |
tree | 6c39f2630b672fb8642f131f58af9bd588ddf364 | |
parent | 2cede59569e9f86848f6e193e323caaa106a0985 (diff) |
#i119902# Rename all master pages in a template, not only the first one.
Patch by: Ma Bingbing
Review by: Andre Fischer
Notes
Notes:
merged as: 4da833308a496363cd05baad577a073e5bfb0872
-rw-r--r-- | sd/source/ui/docshell/docshel4.cxx | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/sd/source/ui/docshell/docshel4.cxx b/sd/source/ui/docshell/docshel4.cxx index 33418960780d..85c63cc63ed8 100644 --- a/sd/source/ui/docshell/docshel4.cxx +++ b/sd/source/ui/docshell/docshel4.cxx @@ -946,8 +946,17 @@ sal_Bool DrawDocShell::SaveAsOwnFormat( SfxMedium& rMedium ) if( aLayoutName.Len() ) { - String aOldPageLayoutName = mpDoc->GetSdPage(0, PK_STANDARD)->GetLayoutName(); - mpDoc->RenameLayoutTemplate(aOldPageLayoutName, aLayoutName); + sal_uInt32 nCount = mpDoc->GetMasterSdPageCount(PK_STANDARD); + for(sal_uInt32 i = 0; i < nCount; i++) + { + String aOldPageLayoutName = mpDoc->GetMasterSdPage(i, PK_STANDARD)->GetLayoutName(); + String aNewLayoutName = aLayoutName; + // Don't add suffix for the first master page + if( i > 0 ) + aNewLayoutName += String::CreateFromInt32(i); + + mpDoc->RenameLayoutTemplate(aOldPageLayoutName, aNewLayoutName); + } } } |