Bug 45908 - RichTextRun.setBullet(false) doesn't work, bullets still here
Summary: RichTextRun.setBullet(false) doesn't work, bullets still here
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: HSLF (show other bugs)
Version: 3.2-dev
Hardware: PC Linux
: P1 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-29 03:52 UTC by Constantin
Modified: 2015-11-01 22:55 UTC (History)
0 users



Attachments
New_Slide.ppt file (69.00 KB, application/octet-stream)
2008-09-29 03:52 UTC, Constantin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Constantin 2008-09-29 03:52:13 UTC
Created attachment 22644 [details]
New_Slide.ppt file

When using rt.setBullet(false) method, bullets in table still here. (See resulting file ppt_out.ppt)
When my code doesn't have any setBullet* methods - bullets still in table also.
Looks like bug.

POI code: trunk

code snippet:

    public static void main(String[] args) {

        SlideShow sourcePpt = null;
        try {
            sourcePpt = new SlideShow(new HSLFSlideShow("New_Slide.ppt"));
        } catch (IOException e) {
        }
        
        Slide slide = sourcePpt.getSlides()[0];
        Shape[] shapes = slide.getShapes();
        AutoShape styleShape = (AutoShape) shapes[1];
        
        
        int rows = 5;
        int cols = 2;
        Table table = new Table(rows, cols);
        for (int i = 0; i < rows; i++) {
            for (int j = 0; j < cols; j++) {
                
                TableCell cell = table.getCell(i, j);
                cell.setText("Test");

                RichTextRun rt = cell.getTextRun().getRichTextRunAt(0);
                RichTextRun textStyle = styleShape.getTextRun().getRichTextRunAt(0);
                
                rt.setBullet(false); // <--- this method doesn't work!
                
                /*rt.setBulletChar('%');
                rt.setBulletColor(richTextRun.getBulletColor());
                rt.setBulletFont(richTextRun.getBulletFont()); 
                rt.setBulletOffset(richTextRun.getBulletOffset());
                rt.setBulletSize(richTextRun.getBulletSize());*/
                
                rt.setAlignment(textStyle.getAlignment());
                rt.setBold(textStyle.isBold());
                rt.setEmbossed(textStyle.isEmbossed());
                rt.setFontColor(Color.BLACK);
                rt.setFontName(textStyle.getFontName());
                rt.setFontSize(textStyle.getFontSize());
                rt.setIndentLevel(textStyle.getIndentLevel());
                rt.setItalic(textStyle.isItalic());
                rt.setShadowed(textStyle.isShadowed());
                rt.setSpaceAfter(textStyle.getSpaceAfter());
                rt.setSpaceBefore(textStyle.getSpaceBefore());
                rt.setStrikethrough(textStyle.isStrikethrough());
                rt.setUnderlined(textStyle.isUnderlined());

            }
        }

        slide.addShape(table);
        table.moveTo(100, 100);
        
        FileOutputStream out;
        try {
            out = new FileOutputStream("ppt_out.ppt");
            sourcePpt.write(out);
            out.close();
        } catch (IOException e) {
        }

    }
Comment 1 Constantin 2008-09-29 04:12:29 UTC
Note: POI SVN code at revision 685064 doesn't have this problem.
Comment 2 Andreas Beeker 2015-11-01 22:55:08 UTC
fixed with r1711858