https://issues.apache.org/bugzilla/show_bug.cgi?id=55800
--- Comment #5 from [email protected] --- The reason is it won't copy the XSSFCellFill and XSSFCellBorder. This also gives problem with borders. I have added a method in org.apache.poi.xssf.model.StylesTable which will help in creating a copy of workbook. public void copyTo(StylesTable stylesTable){ stylesTable.numberFormats.clear(); stylesTable.fonts.clear(); stylesTable.fills.clear(); stylesTable.borders.clear(); stylesTable.styleXfs.clear(); stylesTable.xfs.clear(); stylesTable.dxfs.clear(); for(String str : numberFormats.values()) stylesTable.putNumberFormat(str); for(XSSFFont font : fonts){ XSSFFont fontNew = new XSSFFont(font.getCTFont()); fontNew.registerTo(stylesTable); } for(XSSFCellFill fill : fills){ XSSFCellFill fillNew = new XSSFCellFill(fill.getCTFill()); stylesTable.putFill(fillNew); } for(XSSFCellBorder border : borders){ XSSFCellBorder borderNew = new XSSFCellBorder(border.getCTBorder()); stylesTable.putBorder(borderNew); } for(CTXf ctxf : styleXfs){ CTXf ctxfNew = (CTXf)ctxf.copy(); stylesTable.putCellStyleXf(ctxfNew); } for(CTXf ctxf : xfs){ CTXf ctxfNew = (CTXf)ctxf.copy(); stylesTable.putCellXf(ctxfNew); } for(CTDxf dxf : dxfs){ CTDxf dxfNew = (CTDxf)dxf.copy(); stylesTable.putDxf(dxfNew); } } -- 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]
