It might be a bug or a not supported feature, it is hard to tell without a test case. Can you create a bug in Bugzilla and attach the input .pptx template and sample code that results in XmlValueDisconnectedException?
On Fri, Jan 11, 2013 at 10:14 AM, Georgi Sokolov <[email protected]> wrote: > Yegor, > > Yes it does. This works if I copy slides from the same presentation. But if > I try to copy slides from 2 different presentations, I get this error: > > Exception in thread "main" > org.apache.xmlbeans.impl.values.XmlValueDisconnectedException > at > org.apache.xmlbeans.impl.values.XmlObjectBase.check_orphaned(XmlObjectBase.java:1213) > at > org.openxmlformats.schemas.drawingml.x2006.main.impl.CTShapePropertiesImpl.getLn(Unknown > Source) > at > org.apache.poi.xslf.usermodel.RenderableShape$5.fetch(RenderableShape.java:401) > at > org.apache.poi.xslf.usermodel.XSLFSimpleShape.fetchShapeProperty(XSLFSimpleShape.java:602) > at > org.apache.poi.xslf.usermodel.RenderableShape.getLinePaint(RenderableShape.java:417) > at > org.apache.poi.xslf.usermodel.XSLFSimpleShape.getLineColor(XSLFSimpleShape.java:288) > at > org.apache.poi.xslf.usermodel.XSLFSimpleShape.copy(XSLFSimpleShape.java:663) > at org.apache.poi.xslf.usermodel.XSLFTextShape.copy(XSLFTextShape.java:561) > at org.apache.poi.xslf.usermodel.XSLFSheet.importContent(XSLFSheet.java:310) > at org.apache.poi.xslf.usermodel.XSLFSlide.importContent(XSLFSlide.java:226) > > Can you help? > > Georgi > > На 11.1.2013 г. 07:43 ч., Yegor Kozlov написа: > >> You need to call importContent on the slide layout too. Add the >> following line to your code: >> >> XSLFSlideLayout src_sl = slide.getSlideLayout(); >> XSLFSlideLayout new_sl = newSlide.getSlideLayout(); >> >> new_sl.importContent(src_sl); >> >> >> Yegor >> >> On Thu, Jan 10, 2013 at 4:28 PM, Georgi Sokolov <[email protected]> >> wrote: >>> >>> Guys, >>> >>> I have the following problem with the current 3.9 version of the >>> components. >>> I couldn't see answer anywhere in the mailing list. >>> >>> I have been using the library with great success to read and split/merge >>> PPTX files. The only problem that I have is that when I merge 2 >>> presentations, it does not copy the Master pages. What I want to do is: >>> >>> If we have the following input files: >>> >>> presentation1.pptx >>> presentation2.pptx >>> >>> And an empty: >>> >>> out.pptx >>> >>> I want to get slide 5 from presentation1.pptx and slide 3 from >>> presentation2.pptx and put them as slides 1 and 2 in out.pptx. >>> >>> It works fine for the content but if I have some background/layout set in >>> the master page for the page 5, it does not copy it. I tried almost >>> everything, including some snippets that I got off the internet like: >>> >>> XMLSlideShow ppt = new XMLSlideShow(file); >>> XMLSlideShow ppt_out = new XMLSlideShow(); >>> >>> XSLFSlide slide = ppt.getSlides()[0]; >>> XSLFSlide newSlide = ppt_out.createSlide(); >>> >>> XSLFSlideMaster src_sm = slide.getSlideMaster(); >>> XSLFSlideMaster new_sm = newSlide.getSlideMaster(); >>> >>> new_sm.importContent(src_sm); >>> newSlide.importContent(slide); >>> >>> This does not work though, nothing of the original master gets copied. Is >>> it >>> a problem with the library or something I'm doing wrong? If it is a >>> problem >>> with the library, do we have some ETA when we think this will get >>> resolved? >>> Can I help somehow? >>> >>> Georgi >>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: [email protected] >>> For additional commands, e-mail: [email protected] >>> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: [email protected] >> For additional commands, e-mail: [email protected] >> > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
