diff options
author | Andre Fischer <af@apache.org> | 2012-07-06 10:45:08 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-05-12 16:28:12 +0100 |
commit | 4da833308a496363cd05baad577a073e5bfb0872 (patch) | |
tree | 00016ac62b92d7fd6bf5c5da92f40b859956f70e /sd/source | |
parent | dca437578e09ac00c6df8aa0b8908d4ae24188fe (diff) |
Resolves: #i119902# Rename all master pages in a template...
not only the first one.
Patch by: Ma Bingbing
Review by: Andre Fischer
(cherry picked from commit 7daa651fbc74a6fc08d713282b9e25cda14e39e9)
Change-Id: Ibd8bf8c6f04785c93b7dae70b57fd9eb14623aaf
Diffstat (limited to 'sd/source')
-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 9422ba9261a8..9c998a33a4d7 100644 --- a/sd/source/ui/docshell/docshel4.cxx +++ b/sd/source/ui/docshell/docshel4.cxx @@ -867,8 +867,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) + { + OUString aOldPageLayoutName = mpDoc->GetMasterSdPage(i, PK_STANDARD)->GetLayoutName(); + OUString aNewLayoutName = aLayoutName; + // Don't add suffix for the first master page + if( i > 0 ) + aNewLayoutName += OUString::number(i); + + mpDoc->RenameLayoutTemplate(aOldPageLayoutName, aNewLayoutName); + } } } |