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

           Summary: inserting text or images wipes out boldness and makes
                    everything italic
           Product: POI
           Version: 3.0
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: major
          Priority: P2
         Component: HSLF
        AssignedTo: [email protected]
        ReportedBy: [EMAIL PROTECTED]


Created an attachment (id=22064)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=22064)
The input ppt -- see slide 1 before running

Hello:

If you run the code below:
------------------------------------------
package hslf;

import java.io.FileOutputStream;
import java.io.IOException;

import org.apache.poi.hslf.HSLFSlideShow;
import org.apache.poi.hslf.model.Shape;
import org.apache.poi.hslf.model.Slide;
import org.apache.poi.hslf.model.TextBox;
import org.apache.poi.hslf.usermodel.RichTextRun;
import org.apache.poi.hslf.usermodel.SlideShow;

public class InsertText {
    public InsertText() {
    }

    public static void main(String[] args) throws IOException {
        InsertText insertText = new InsertText();
        insertText.insertText();
    }

    public void insertText() throws IOException {
        SlideShow ppt = new SlideShow(new HSLFSlideShow("c:/test/bug2.ppt"));
        Slide slide1 = ppt.getSlides()[1];

        TextBox res = new TextBox();
        res.setAnchor(new java.awt.Rectangle(60, 150, 700, 100));
        res.setText("I am italic-false, bold-true inserted text");
        res.setHorizontalAlignment(TextBox.AlignLeft);
        res.setVerticalAlignment(TextBox.AlignCenter);

        RichTextRun rt2 = res.getTextRun().getRichTextRuns()[0];
        rt2.setFontSize(32);
        rt2.setItalic(false);
        rt2.setBulletOffset(0);
        rt2.setBold(true);
        rt2.setBullet(true);
        rt2.setBulletChar('\u00B7');
        rt2.setFontName("Arial Narrow");

        slide1.addShape(res);        

        FileOutputStream out = new FileOutputStream("c:/test/bug2.ppt");
        ppt.write(out);
        out.close(); 
    }

}
--------------------------------

the inserted text will not be bold and will be italic.  In addition, all text
on every slide that was bold and not italic loses its boldness and becomes
italic.
For example, the text on slide 1 in bug.ppt reacts this way when text is
inserted on slide 2.

Eric Hamacher


-- 
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