diff options
Diffstat (limited to 'sd/source/ui/docshell/docshel4.cxx')
-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); + } } } |