https://bz.apache.org/bugzilla/show_bug.cgi?id=60552
--- Comment #9 from Javen O'Neal <[email protected]> --- (In reply to Anand from comment #8) > BTW is there any issue in the way I have used PIO? or is it a bug in PIO? Is > it possible to confirm? I thought what I am doing was a pretty basic stuf. > Am I right? Your code looks fairly straightforward, though importing content into a slide and embedding pictures are more advanced features. There are a couple spots that look suspicious to me: 1) You never close srcPPT, destPPT, or spptIS 2) You import slide layout and slide. This might cause a problem if importing a slide implicitly imports a layout. If the same layout is imported twice, this would be reason for PowerPoint to complain. 3) your second call to setText writes the text to slide1. Should it have written it to slide2? (modified for clarity) > XSLFSlide destSlide = destPPT.createSlide(); > destSlide.getSlideLayout().importContent( srcSlide.getSlideLayout() ); > destSlide.importContent( srcSlide ); Your test code currently does several things: * create a blank slide and import slide layout and content from the source slide * add two jpeg pictures to the slide * add a textbox to the slide * repeat these 3 things to a second slide. Do you still get a corrupt workbook if you comment out some of these lines? Without understanding where the workbook becomes corrupted, we have no chance at determining if it's a bug in POI or a bug in your code. Only then could we figure out if POI can raise an exception just before the workbook becomes corrupt. > XSLFSlide slide1 = createSlide(destPPT, srcSlide, visitedLOs); > setPic(destPPT, slide1, cvPic, CV_PH_NAME); > setPic(destPPT, slide1, lvPic, LV_PH_NAME); > setText(slide1, LOC_PH_NAME, locTxt); > > XSLFSlide slide2 = createSlide(destPPT, srcSlide, visitedLOs); > setPic(destPPT, slide2, cvPic, CV_PH_NAME); > setPic(destPPT, slide2, lvPic, LV_PH_NAME); > setText(slide1, LOC_PH_NAME, locTxt); //slide2??? -- You are receiving this mail because: You are the assignee for the bug. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
