XSSFWorkbook wb = (XSSFWorkbook)getDrawing().getParent().getParent();
str.setStylesTableReference(wb.getStylesSource());
CTTextParagraph p = CTTextParagraph.Factory.newInstance();
if(str.numFormattingRuns() == 0){
CTRegularTextRun r = p.addNewR();
CTTextCharacterProperties rPr = r.addNewRPr();
rPr.setLang("en-US");
rPr.setSz(1100);
r.setT(str.getString());
} else {
for (int i = 0; i < str.getCTRst().sizeOfRArray(); i++) {
CTRElt lt = str.getCTRst().getRArray(i);
CTRPrElt ltPr = lt.getRPr();
if(ltPr == null) ltPr = lt.addNewRPr();
CTRegularTextRun r = p.addNewR();
CTTextCharacterProperties rPr = r.addNewRPr();
rPr.setLang("en-US");
applyAttributes(ltPr, rPr);
r.setT(lt.getT());
}
}
ctShape.getTxBody().setPArray(new CTTextParagraph[]{p});
}