summaryrefslogtreecommitdiff
path: root/sd/source/ui
diff options
context:
space:
mode:
authorAndre Fischer <af@apache.org>2012-07-06 10:45:08 +0000
committerCaolán McNamara <caolanm@redhat.com>2013-05-12 16:28:12 +0100
commit4da833308a496363cd05baad577a073e5bfb0872 (patch)
tree00016ac62b92d7fd6bf5c5da92f40b859956f70e /sd/source/ui
parentdca437578e09ac00c6df8aa0b8908d4ae24188fe (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/ui')
-rw-r--r--sd/source/ui/docshell/docshel4.cxx13
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);
+ }
}
}