Issue 119902 - only rename the first master page, the other master pages keep default name
only rename the first master page, the other master pages keep default name
Status: CLOSED FIXED
Product: Impress
Classification: Application
Component: formatting
3.4.0
All All
: P3 normal (vote)
: 4.0.0
Assigned To: AOO issues mailing list
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-06-08 02:46 UTC by Ma Bingbing
Modified: 2013-07-11 13:30 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation on: ---
Developer Difficulty: ---


Attachments
solution for this defect (919 bytes, patch)
2012-06-08 02:53 UTC, Ma Bingbing
jiazema: review?
Details | Diff
new patch (917 bytes, patch)
2012-07-02 11:48 UTC, Ma Bingbing
awf.aoo: review+
Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description Ma Bingbing 2012-06-08 02:46:49 UTC
when save a file as template file(*.otp), we just auto rename the first master page name as the file name. But, the other master pages keep default name.

test case:
  1. create a new Presentation
  2. select "View -> Master -> Slide Master"
  3. create at least two master page and edit them.(<data/time>, <footer>, <number>)
  4. save the file as *.otp
  5. open the .otp file, and check the "Master Pages" in Tasks span, only the first master page has the same name with the file name.
Comment 1 Ma Bingbing 2012-06-08 02:53:55 UTC
Created attachment 78159 [details]
solution for this defect
Comment 2 liuping 2012-06-12 07:27:53 UTC
reproduce the bug ,confirm
Comment 3 liuping 2012-06-12 07:32:55 UTC
this bug don't exist in symphony 3.0.1
Comment 4 bjcheny 2012-06-13 01:49:25 UTC
I would suggest adding some notes for your solution when you upload your patch.

(In reply to comment #1)
> Created attachment 78159 [details]
> solution for this defect
Comment 5 Ma Bingbing 2012-06-13 02:30:28 UTC
Solution:
Get the whole master page list and rename them one by one. The new name is template file name append a number.
Comment 6 Andre 2012-06-19 11:15:52 UTC
@Ma Bingbing: Could you describe why the above behavior is an error and what problems it can cause?
Comment 7 Ma Bingbing 2012-06-20 03:19:09 UTC
  (In reply to comment #6)
> @Ma Bingbing: Could you describe why the above behavior is an error and what
> problems it can cause?

   1. The different master page in different .odt(ex. template1.odt and template2.odt both have 3 master page) have the same name(the name of 2nd master page is "default1"). It may mislead the users.
   2. Master page should have the same naming rule.
   So, we should correct the behavior in my opinion, and I don't find any problems caused by it.
Comment 8 Andre 2012-06-21 15:14:59 UTC
I am generally in favor of the renaming but have some remarks/questions:

1. The patch looks like the first master page is renamed twice.

2. The standard master pages are renamed but what about notes and handout master pages?

3. The indices of original name and new name are different.  Original index of page n is n+1 while the index of the new name is n.

4. The original names contain the string SD_LT_SEPARATOR ("~LT~") that is used in various places.  The new names don't.  Does the code that uses this string still work?  
grep SD_LT_SEPARATOR sd/source/* found 69 places.
Comment 9 Ma Bingbing 2012-07-02 11:39:15 UTC
(In reply to comment #8)
> I am generally in favor of the renaming but have some remarks/questions:
> 
> 1. The patch looks like the first master page is renamed twice.
> 
  Yes, it is a mistake.

> 2. The standard master pages are renamed but what about notes and handout
> master pages?
> 
  The patch works well to all the master pages, not only the standard master page.

> 3. The indices of original name and new name are different.  Original index
> of page n is n+1 while the index of the new name is n.
> 
  Before this change, the names of all master pages are "docName","Default 1","Default 2",... "Default n"
  After this patch, the names will be "docName", "docName1" "docName2",...,"docNamen"

> 4. The original names contain the string SD_LT_SEPARATOR ("~LT~") that is
> used in various places.  The new names don't.  Does the code that uses this
> string still work?  
> grep SD_LT_SEPARATOR sd/source/* found 69 places.
  Yes, the code can be worked too. 
  The new names be used to show on the "master pages" view of task span which just like the first master page before this change.
  The string SD_LT_SEPARATOR may be a symbol of master page name, used to be different with other names.
Comment 10 Ma Bingbing 2012-07-02 11:48:39 UTC
Created attachment 78548 [details]
new patch

new patch
Comment 11 Andre 2012-07-02 12:46:58 UTC
(In reply to comment #9)
> > 4. The original names contain the string SD_LT_SEPARATOR ("~LT~") that is
> > used in various places.  The new names don't.  Does the code that uses this
> > string still work?  
> > grep SD_LT_SEPARATOR sd/source/* found 69 places.
>   Yes, the code can be worked too. 
>   The new names be used to show on the "master pages" view of task span
> which just like the first master page before this change.
>   The string SD_LT_SEPARATOR may be a symbol of master page name, used to be
> different with other names.

I am not sure that I understand the answer.  There are several places that assume that SD_LT_SEPARATOR is part of the name and that split the name at this string.  Did you check that your patch works with this functionality?
Comment 12 Ma Bingbing 2012-07-03 03:10:57 UTC
> 4. The original names contain the string SD_LT_SEPARATOR ("~LT~") that is
> used in various places.  The new names don't.  Does the code that uses this
> string still work?  
> grep SD_LT_SEPARATOR sd/source/* found 69 places.

  Actually, we use void SdDrawDocument::RenameLayoutTemplate(const String& rOldLayoutName, const String& rNewName) in \main\sd\source\core\drawdoc4.cxx(line:) to set new layout name for master page. And in this function, we append string SD_LT_SEPARATOR as part of the new name(Line 1237-1239). So, the new names also contain the string SD_LT_SEPARATOR.
Comment 13 Andre 2012-07-06 11:46:12 UTC
Thanks for your patience with all my questions.

Checked in your new patch.  SVN revision is 1358139.
Comment 14 Andre 2012-07-06 11:46:35 UTC
Comment on attachment 78548 [details]
new patch

Reviewed, OK.
Comment 15 Ma Bingbing 2012-07-08 14:10:15 UTC
Andre, thanks for your review.
Comment 16 Li Feng Wang 2012-08-30 08:56:50 UTC
Verify pass on AOO trunk r1378003.

Verify steps:
  1. create a new Presentation
  2. select "View -> Master -> Slide Master"
  3. create at least two master page and edit them.(<data/time>, <footer>, <number>)
  4. save the file as *.otp
  5. open the .otp file, and check the "Master Pages" in Tasks span, The master page has the name is template file name append a number.