https://issues.apache.org/bugzilla/show_bug.cgi?id=46021

           Summary: Basic non-destructive modification breaks powerpoint
                    file
           Product: POI
           Version: 3.1
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: major
          Priority: P1
         Component: HSLF
        AssignedTo: [email protected]
        ReportedBy: [EMAIL PROTECTED]


The following code snippet will cause exceptions and errors on many powerpoint
documents and will generally result in corrupted file output:

Exception handling, imports removed for clarity.

public class TestPowerPoint
{

 public static void main(String[] args)
 {
  new TestPowerPoint(args[0]);
 }

 public TestPowerPoint(String fileToTest)
 {
  SlideShow ppt = new SlideShow(new FileInputStream(fileToTest));
  for (Slide slide : ppt.getSlides())
  {
   for (TextRun textRun : slide.getTextRuns())
   {
    for (RichTextRun richTextRun : textRun.getRichTextRuns())
    {
    String text = richTextRun.getText();
    richTextRun.setText(text);
    }
   }
  }
  ppt.write(new FileOutputStream("new"+fileToTest));
 }

}


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- 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]

Reply via email to