Summary: | RichTextRun.setBullet(false) doesn't work, bullets still here | ||
---|---|---|---|
Product: | POI | Reporter: | Constantin <cvolozhin> |
Component: | HSLF | Assignee: | 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 |
Note: POI SVN code at revision 685064 doesn't have this problem. |
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) { } }