case LwgElement.CHAPTER:
rtfElements.add(new RtfChapter(rtfDoc, (Chapter) element));
break;
case LwgElement.TABLE:
try {
rtfElements.add(new RtfTable(rtfDoc, (Table) element));
}
catch(ClassCastException e) {
rtfElements.add(new RtfTable(rtfDoc, ((SimpleTable) element).createTable()));
}
break;
case LwgElement.PTABLE:
try {
rtfElements.add(new RtfTable(rtfDoc, (LwgPdfPTable) element));
}
catch(ClassCastException e) {
rtfElements.add(new RtfTable(rtfDoc, ((SimpleTable) element).createTable()));
}
break;
}
return (RtfBasicElement[]) rtfElements.toArray(new RtfBasicElement[rtfElements.size()]);