Bug 45908

Summary: RichTextRun.setBullet(false) doesn't work, bullets still here
Product: POI Reporter: Constantin <cvolozhin>
Component: HSLFAssignee: POI Developers List <dev>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P1    
Version: 3.2-dev   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Attachments: New_Slide.ppt file

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