if (this instanceof PlaceableShape) {
PlaceableShape<?,?> ps = (PlaceableShape<?,?>)this;
- ps.setAnchor(sh.getAnchor());
+ Rectangle2D anchor = sh.getAnchor();
+ if (anchor != null) {
+ ps.setAnchor(anchor);
+ }
}
protected XmlObject getShapeProperties() {
return getChild(CTShapeProperties.class, PML_NS, "spPr");
}
-}
\ No newline at end of file
+}
return this;
}
+ XSLFNotes srcNotes = ((XSLFSlide)src).getNotes();
+ if (srcNotes != null) {
+ getSlideShow().getNotesSlide(this).importContent(srcNotes);
+ }
+
// only copy direct backgrounds - not backgrounds of master sheet
CTBackground bgOther = ((XSLFSlide)src)._slide.getCSld().getBg();
if (bgOther == null) {
ppt.close();
}
+
+ @Test
+ void importNotes() throws IOException {
+
+ XMLSlideShow ppt = XSLFTestDataSamples.openSampleDocument("sample.pptx");
+ XMLSlideShow newShow = new XMLSlideShow();
+
+ for (XSLFSlide slide : ppt.getSlides()) {
+ XSLFNotes slideNotes = slide.getNotes();
+ assertNotNull(slideNotes);
+ XSLFNotes notesSlide = ppt.getNotesSlide(slide);
+ assertNotNull(notesSlide);
+ assertEquals(notesSlide, slideNotes);
+
+ XSLFSlide newSlide = newShow.createSlide().importContent(slide);
+ XSLFNotes newNotes = newSlide.getNotes();
+ assertNotNull(newNotes);
+ }
+
+ ppt.close();
+ }
}