/** * Constructs a TitleMaster * */ public HSLFTitleMaster(org.apache.poi.hslf.record.Slide record, int sheetNo) { super(record, sheetNo); for (List<HSLFTextParagraph> l : HSLFTextParagraph.findTextParagraphs(getPPDrawing(), this)) { if (!_paragraphs.contains(l)) { _paragraphs.add(l); } } }
/** * Constructs a SlideMaster from the MainMaster record, * */ public HSLFSlideMaster(MainMaster record, int sheetNo) { super(record, sheetNo); for (List<HSLFTextParagraph> l : HSLFTextParagraph.findTextParagraphs(getPPDrawing(), this)) { if (!_paragraphs.contains(l)) { _paragraphs.add(l); } } }
/** * For a given PPDrawing, grab all the TextRuns */ public static List<List<HSLFTextParagraph>> findTextParagraphs(PPDrawing ppdrawing, HSLFSheet sheet) { List<List<HSLFTextParagraph>> runsV = new ArrayList<>(); for (EscherTextboxWrapper wrapper : ppdrawing.getTextboxWrappers()) { List<HSLFTextParagraph> p = findTextParagraphs(wrapper, sheet); if (p != null) { runsV.add(p); } } return runsV; }
/** * Returns the type of the text, from the TextHeaderAtom. * Possible values can be seen from TextHeaderAtom * @see org.apache.poi.hslf.record.TextHeaderAtom */ public int getRunType() { getEscherTextboxWrapper(); if (_txtbox == null) { return -1; } List<HSLFTextParagraph> paras = HSLFTextParagraph.findTextParagraphs(_txtbox, getSheet()); return (paras.isEmpty()) ? -1 : paras.get(0).getRunType(); }
/** * Changes the type of the text. Values should be taken * from TextHeaderAtom. No checking is done to ensure you * set this to a valid value! * @see org.apache.poi.hslf.record.TextHeaderAtom */ public void setRunType(int type) { getEscherTextboxWrapper(); if (_txtbox == null) { return; } List<HSLFTextParagraph> paras = HSLFTextParagraph.findTextParagraphs(_txtbox, getSheet()); if (!paras.isEmpty()) { paras.get(0).setRunType(type); } }
_paragraphs.addAll(HSLFTextParagraph.findTextParagraphs(_atomSet.getSlideRecords())); if (_paragraphs.isEmpty()) { throw new HSLFException("No text records found for slide"); for (List<HSLFTextParagraph> l : HSLFTextParagraph.findTextParagraphs(getPPDrawing(), this)) { if (!_paragraphs.contains(l)) { _paragraphs.add(l);
/** * Constructs a Notes Sheet from the given Notes record. * Initialises TextRuns, to provide easier access to the text * * @param notes the Notes record to read from */ public HSLFNotes(org.apache.poi.hslf.record.Notes notes) { super(notes, notes.getNotesAtom().getSlideID()); // Now, build up TextRuns from pairs of TextHeaderAtom and // one of TextBytesAtom or TextCharsAtom, found inside // EscherTextboxWrapper's in the PPDrawing for (List<HSLFTextParagraph> l : HSLFTextParagraph.findTextParagraphs(getPPDrawing(), this)) { if (!_paragraphs.contains(l)) _paragraphs.add(l); } if (_paragraphs.isEmpty()) { logger.log(POILogger.WARN, "No text records found for notes sheet"); } }
@Override public List<HSLFTextParagraph> getTextParagraphs(){ if (!_paragraphs.isEmpty()) { return _paragraphs; } _txtbox = getEscherTextboxWrapper(); if (_txtbox == null) { _txtbox = new EscherTextboxWrapper(); createEmptyParagraph(); } else { List<HSLFTextParagraph> pList = HSLFTextParagraph.findTextParagraphs(_txtbox, getSheet()); if (pList == null) { // there are actually TextBoxRecords without extra data - see #54722 createEmptyParagraph(); } else { _paragraphs = pList; } if (_paragraphs.isEmpty()) { LOG.log(POILogger.WARN, "TextRecord didn't contained any text lines"); } } for (HSLFTextParagraph p : _paragraphs) { p.setParentShape(this); } return _paragraphs; }
List<List<HSLFTextParagraph>> rvl = findTextParagraphs(wrapper.getChildRecords()); switch (rvl.size()) { case 0: break; // nothing found