incubator-ooo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a.@apache.org
Subject svn commit: r1358139 - /incubator/ooo/trunk/main/sd/source/ui/docshell/docshel4.cxx
Date Fri, 06 Jul 2012 11:45:08 GMT
Author: af
Date: Fri Jul  6 11:45:08 2012
New Revision: 1358139

URL: http://svn.apache.org/viewvc?rev=1358139&view=rev
Log:
#i119902# Rename all master pages in a template, not only the first one.

          Patch by: Ma Bingbing
          Review by: Andre Fischer

Modified:
    incubator/ooo/trunk/main/sd/source/ui/docshell/docshel4.cxx

Modified: incubator/ooo/trunk/main/sd/source/ui/docshell/docshel4.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sd/source/ui/docshell/docshel4.cxx?rev=1358139&r1=1358138&r2=1358139&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sd/source/ui/docshell/docshel4.cxx (original)
+++ incubator/ooo/trunk/main/sd/source/ui/docshell/docshel4.cxx Fri Jul  6 11:45:08 2012
@@ -946,8 +946,17 @@ sal_Bool DrawDocShell::SaveAsOwnFormat( 
 
 		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);
+			}			
 		}
 	}
 



Mime
View raw message