/** * {@inheritDoc} * * @see RoundTripHFPlaceholder12 */ @Override public boolean isHeaderOrFooter() { HSLFTextShape s = getParentShape(); if (s == null) { return false; } Placeholder ph = s.getPlaceholder(); if (ph == null) { return false; } switch (ph) { case DATETIME: case SLIDE_NUMBER: case FOOTER: case HEADER: return true; default: return false; } } }
@Override public FieldType getFieldType() { HSLFTextShape ts = getTextParagraph().getParentShape(); Placeholder ph = ts.getPlaceholder(); if (ph != null) { switch (ph) { case SLIDE_NUMBER: return FieldType.SLIDE_NUMBER; case DATETIME: return FieldType.DATE_TIME; default: break; } } if (ts.getSheet() instanceof MasterSheet) { TextShape<?,? extends TextParagraph<?,?,? extends TextRun>> ms = ts.getMetroShape(); if (ms == null || ms.getTextParagraphs().isEmpty()) { return null; } List<? extends TextRun> trList = ms.getTextParagraphs().get(0).getTextRuns(); if (trList.isEmpty()) { return null; } return trList.get(0).getFieldType(); } return null; }