Skip to content

Commit

Permalink
Fix bug when there are more than 1 slide master.
Browse files Browse the repository at this point in the history
Solution: when there are more than 1 slide master, each slide master
needs 1 theme, make changes to create new theme when creating new slide
master, and make the new slide master refer to the new theme.
  • Loading branch information
yz41676578 committed Jun 24, 2014
1 parent e4d770a commit ba003ef
Show file tree
Hide file tree
Showing 2 changed files with 697 additions and 695 deletions.
Expand Up @@ -52,14 +52,14 @@ public class Presentation extends Component

private int slideMasterId = 1;
private int slideLayoutId = 1;
private int themeId = 1;

private long globalId = 2147483648L;

private int width = 0, height = 0;

private Package pkg;

private Theme theme;
private HashMap<String, SlideMaster> slideMasters = new HashMap<String, SlideMaster>();
private List<Slide> slides = new ArrayList<Slide>( );
private String author, title, description, subject;
Expand All @@ -79,9 +79,6 @@ public Presentation( OutputStream out, String tempFileDir,
{
writer = part.getCacheWriter( );
initialize( );
theme = new Theme( part );
//createSlideMaster( );
//slideMaster.referTo( theme );
}
catch ( IOException e )
{
Expand All @@ -96,6 +93,7 @@ public SlideMaster getSlideMaster( String name ) throws IOException

public SlideMaster createSlideMaster(String name, PageArea area) throws IOException
{
Theme theme = new Theme( part, this );
SlideMaster slideMaster = new SlideMaster( this, area );
slideMaster.referTo( theme );
slideMasters.put( name, slideMaster);
Expand Down Expand Up @@ -254,6 +252,10 @@ public int getNextSlideMasterId() {
return slideMasterId++;
}

public int getNextThemeId() {
return themeId++;
}

public int getNextSlideLayoutId() {
return slideLayoutId++;
}
Expand Down

0 comments on commit ba003ef

Please sign in to comment.