slideOne.setNotes(notesOne);
- assertEquals(notesOne.getSheetNumber(), sa.getNotesID());
+ assertEquals(notesOne._getSheetNumber(), sa.getNotesID());
}
}
\r
Slide s1 = ppt.createSlide();\r
assertTrue(ppt.getSlides().length == 1);\r
- assertEquals(3, s1.getSheetNumber());\r
+ assertEquals(3, s1._getSheetRefId());\r
+ assertEquals(256, s1._getSheetNumber());\r
assertEquals(1, s1.getSlideNumber());\r
\r
//serialize and read again\r
\r
Slide s1 = ppt.createSlide();\r
assertTrue(ppt.getSlides().length == 1);\r
- assertEquals(3, s1.getSheetNumber());\r
+ assertEquals(3, s1._getSheetRefId());\r
+ assertEquals(256, s1._getSheetNumber());\r
assertEquals(1, s1.getSlideNumber());\r
\r
Slide s2 = ppt.createSlide();\r
assertTrue(ppt.getSlides().length == 2);\r
- assertEquals(4, s2.getSheetNumber());\r
+ assertEquals(4, s2._getSheetRefId());\r
+ assertEquals(257, s2._getSheetNumber());\r
assertEquals(2, s2.getSlideNumber());\r
\r
//serialize and read again\r
\r
Slide s1 = ppt.createSlide();\r
assertTrue(ppt.getSlides().length == 1);\r
- assertEquals(3, s1.getSheetNumber());\r
+ assertEquals(3, s1._getSheetRefId());\r
+ assertEquals(256, s1._getSheetNumber());\r
assertEquals(1, s1.getSlideNumber());\r
\r
Slide s2 = ppt.createSlide();\r
assertTrue(ppt.getSlides().length == 2);\r
- assertEquals(4, s2.getSheetNumber());\r
+ assertEquals(4, s2._getSheetRefId());\r
+ assertEquals(257, s2._getSheetNumber());\r
assertEquals(2, s2.getSlideNumber());\r
\r
Slide s3 = ppt.createSlide();\r
assertTrue(ppt.getSlides().length == 3);\r
- assertEquals(5, s3.getSheetNumber());\r
+ assertEquals(5, s3._getSheetRefId());\r
+ assertEquals(258, s3._getSheetNumber());\r
assertEquals(3, s3.getSlideNumber());\r
\r
//serialize and read again\r
assertEquals(1, slides[0].getSlideNumber());
assertEquals(2, slides[1].getSlideNumber());
- // The internal IDs are 4 and 6
- assertEquals(4, slides[0].getSheetNumber());
- assertEquals(6, slides[1].getSheetNumber());
+ // The ref IDs are 4 and 6
+ assertEquals(4, slides[0]._getSheetRefId());
+ assertEquals(6, slides[1]._getSheetRefId());
+
+ // These are slides 1+2 -> 256+257
+ assertEquals(256, slides[0]._getSheetNumber());
+ assertEquals(257, slides[1]._getSheetNumber());
}
public void testNotesCount() throws Exception {
Notes[] notes = ss.getNotes();
- // Two sheets -> two notes, plus the notes on the slide master
- assertEquals(3, notes.length);
+ // Two sheets -> two notes
+ // Note: there are also notes on the slide master
+ //assertEquals(3, notes.length); // When we do slide masters
+ assertEquals(2, notes.length);
// First is for master
- assertEquals(-2147483648, notes[0].getSlideInternalNumber());
+ //assertEquals(-2147483648, notes[0]._getSheetNumber()); // When we do slide masters
// Next two are for the two slides
- assertEquals(256, notes[1].getSlideInternalNumber());
- assertEquals(257, notes[2].getSlideInternalNumber());
+ assertEquals(256, notes[0]._getSheetNumber());
+ assertEquals(257, notes[1]._getSheetNumber());
- // They go between the slides
- assertEquals(5, notes[1].getSheetNumber());
- assertEquals(7, notes[2].getSheetNumber());
+ // They happen to go between the two slides in Ref terms
+ assertEquals(5, notes[0]._getSheetRefId());
+ assertEquals(7, notes[1]._getSheetRefId());
}
}
}
public void testNotesOne() throws Exception {
- Notes notes = ss.getNotes()[1];
+ Notes notes = ss.getNotes()[0];
String[] expectText = new String[] {"These are the notes for page 1"};
assertEquals(expectText.length, notes.getTextRuns().length);
}
public void testNotesTwo() throws Exception {
- Notes notes = ss.getNotes()[2];
+ Notes notes = ss.getNotes()[1];
String[] expectText = new String[] {"These are the notes on page two, again lacking formatting"};
assertEquals(expectText.length, notes.getTextRuns().length);
for(int i=0; i<expectText.length; i++) {
private SlideShow ss;
private SlideShow ssRichA;
private SlideShow ssRichB;
+ private SlideShow ssRichC;
private HSLFSlideShow hss;
private HSLFSlideShow hssRichA;
private HSLFSlideShow hssRichB;
+ private HSLFSlideShow hssRichC;
protected void setUp() throws Exception {
String dirname = System.getProperty("HSLF.testdata.path");
filename = dirname + "/Single_Coloured_Page_With_Fonts_and_Alignments.ppt";
hssRichB = new HSLFSlideShow(filename);
ssRichB = new SlideShow(hssRichB);
+
+ // Rich test file C - has paragraph styles that run out before
+ // the character ones do
+ filename = dirname + "/ParagraphStylesShorterThanCharStyles.ppt";
+ hssRichC = new HSLFSlideShow(filename);
+ ssRichC = new SlideShow(hssRichC);
}
/**
assertEquals("Courier", rtrRRa.getFontName());
}
}
+
+ /**
+ * Test that we can do the right things when the paragraph styles
+ * run out before the character styles do
+ * NOTE: Disabled, as we can't currently do this!
+ */
+ public void BROKENtestParagraphStylesShorterTheCharStyles() {
+ // TODO
+ }
}