@Override public String getRawText(){ if (_r instanceof CTTextField) { return ((CTTextField)_r).getT(); } else if (_r instanceof CTTextLineBreak) { return "\n"; } return ((CTRegularTextRun)_r).getT(); }
public String getText() { if (isLineBreak()) { return "\n"; } else if (isField()) { return _tf.getT(); } else { return _rtr.getT(); } }
XSSFTextParagraph(CTTextParagraph p, CTShape ctShape){ _p = p; _shape = ctShape; _runs = new ArrayList<>(); for(XmlObject ch : _p.selectPath("*")){ if(ch instanceof CTRegularTextRun){ CTRegularTextRun r = (CTRegularTextRun)ch; _runs.add(new XSSFTextRun(r, this)); } else if (ch instanceof CTTextLineBreak){ CTTextLineBreak br = (CTTextLineBreak)ch; CTRegularTextRun r = CTRegularTextRun.Factory.newInstance(); r.setRPr(br.getRPr()); r.setT("\n"); _runs.add(new XSSFTextRun(r, this)); } else if (ch instanceof CTTextField){ CTTextField f = (CTTextField)ch; CTRegularTextRun r = CTRegularTextRun.Factory.newInstance(); r.setRPr(f.getRPr()); r.setT(f.getT()); _runs.add(new XSSFTextRun(r, this)); } } }
@Override public String getRawText(){ if (_r instanceof CTTextField) { return ((CTTextField)_r).getT(); } else if (_r instanceof CTTextLineBreak) { return "\n"; } return ((CTRegularTextRun)_r).getT(); }
public String getText() { if (isLineBreak()) { return "\n"; } else if (isField()) { return _tf.getT(); } else { return _rtr.getT(); } }
XSSFTextParagraph(CTTextParagraph p, CTShape ctShape){ _p = p; _shape = ctShape; _runs = new ArrayList<>(); for(XmlObject ch : _p.selectPath("*")){ if(ch instanceof CTRegularTextRun){ CTRegularTextRun r = (CTRegularTextRun)ch; _runs.add(new XSSFTextRun(r, this)); } else if (ch instanceof CTTextLineBreak){ CTTextLineBreak br = (CTTextLineBreak)ch; CTRegularTextRun r = CTRegularTextRun.Factory.newInstance(); r.setRPr(br.getRPr()); r.setT("\n"); _runs.add(new XSSFTextRun(r, this)); } else if (ch instanceof CTTextField){ CTTextField f = (CTTextField)ch; CTRegularTextRun r = CTRegularTextRun.Factory.newInstance(); r.setRPr(f.getRPr()); r.setT(f.getT()); _runs.add(new XSSFTextRun(r, this)); } } }
XSLFTextParagraph(CTTextParagraph p, XSLFTextShape shape){ _p = p; _runs = new ArrayList<XSLFTextRun>(); _shape = shape; for(XmlObject ch : _p.selectPath("*")){ if(ch instanceof CTRegularTextRun){ CTRegularTextRun r = (CTRegularTextRun)ch; _runs.add(new XSLFTextRun(r, this)); } else if (ch instanceof CTTextLineBreak){ CTTextLineBreak br = (CTTextLineBreak)ch; CTRegularTextRun r = CTRegularTextRun.Factory.newInstance(); r.setRPr(br.getRPr()); r.setT("\n"); _runs.add(new XSLFTextRun(r, this)); } else if (ch instanceof CTTextField){ CTTextField f = (CTTextField)ch; CTRegularTextRun r = CTRegularTextRun.Factory.newInstance(); r.setRPr(f.getRPr()); r.setT(f.getT()); _runs.add(new XSLFTextRun(r, this)); } } }