/** * For a given PPDrawing, grab all the TextRuns */ public static TextRun[] findTextRuns(PPDrawing ppdrawing) { final List<TextRun> runsV = new ArrayList<TextRun>(); EscherTextboxWrapper[] wrappers = ppdrawing.getTextboxWrappers(); for (int i = 0; i < wrappers.length; i++) { int s1 = runsV.size(); // propagate parents to parent-aware records RecordContainer.handleParentAwareRecords(wrappers[i]); findTextRuns(wrappers[i].getChildRecords(), runsV); int s2 = runsV.size(); if (s2 != s1){ TextRun t = runsV.get(runsV.size()-1); t.setShapeId(wrappers[i].getShapeId()); } } return runsV.toArray(new TextRun[runsV.size()]); }