public static Placeholder lookupNativeSlideMaster(int nativeId) { return lookupNative(nativeId, 1); }
public static Placeholder lookupOoxml(int ooxmlId) { for (Placeholder ph : values()) { if (ph.ooxmlId == ooxmlId) { return ph; } } return null; } }
public Placeholder getPlaceholder() { updatePlaceholderAtom(false); final int phId; if (oePlaceholderAtom != null) { phId = oePlaceholderAtom.getPlaceholderId(); } else if (roundTripHFPlaceholder12 != null) { phId = roundTripHFPlaceholder12.getPlaceholderId(); } else { return null; } switch (source) { case slide: return Placeholder.lookupNativeSlide(phId); default: case master: return Placeholder.lookupNativeSlideMaster(phId); case notes: return Placeholder.lookupNativeNotes(phId); case notesMaster: return Placeholder.lookupNativeNotesMaster(phId); } }
@Override public Placeholder getPlaceholder() { final CTPlaceholder ph = getCTPlaceholder(false); if (ph == null || !(ph.isSetType() || ph.isSetIdx())) { return null; } return Placeholder.lookupOoxml(ph.getType().intValue()); }
private byte getPlaceholderId(final Placeholder placeholder) { /* * Extract from MSDN: * * There is a special case when the placeholder does not have a position in the layout. * This occurs when the user has moved the placeholder from its original position. * In this case the placeholder ID is -1. */ final byte phId; switch (source) { default: case slide: phId = (byte)placeholder.nativeSlideId; break; case master: phId = (byte)placeholder.nativeSlideMasterId; break; case notes: phId = (byte)placeholder.nativeNotesId; break; case notesMaster: phId = (byte)placeholder.nativeNotesMasterId; break; } if (phId == -2) { throw new HSLFException("Placeholder "+placeholder.name()+" not supported for this sheet type ("+shape.getSheet().getClass()+")"); } return phId; }
@Override public boolean isVisible() { final CTPlaceholder ph = getCTPlaceholder(false); if (ph == null || !ph.isSetType()) { return true; } final CTHeaderFooter hf = getHeaderFooter(false); if (hf == null) { return false; } final Placeholder pl = Placeholder.lookupOoxml(ph.getType().intValue()); if (pl == null) { return true; } switch (pl) { case DATETIME: return !hf.isSetDt() || hf.getDt(); case FOOTER: return !hf.isSetFtr() || hf.getFtr(); case HEADER: return !hf.isSetHdr() || hf.getHdr(); case SLIDE_NUMBER: return !hf.isSetSldNum() || hf.getSldNum(); default: return true; } }
public static Placeholder lookupNativeNotes(int nativeId) { return lookupNative(nativeId, 2); }
@Override public Placeholder getPlaceholder() { final CTPlaceholder ph = getCTPlaceholder(false); if (ph == null || !(ph.isSetType() || ph.isSetIdx())) { return null; } return Placeholder.lookupOoxml(ph.getType().intValue()); }
private static Placeholder lookupNative(int nativeId, int type) { for (Placeholder ph : values()) { if ( type == 0 && ph.nativeSlideId == nativeId || type == 1 && ph.nativeSlideMasterId == nativeId || type == 2 && ph.nativeNotesId == nativeId || type == 3 && ph.nativeNotesMasterId == nativeId ) { return ph; } } return null; }
public static Placeholder lookupNativeSlide(int nativeId) { return lookupNative(nativeId, 0); }
@Override public boolean isVisible() { final CTPlaceholder ph = getCTPlaceholder(false); if (ph == null || !ph.isSetType()) { return true; } final CTHeaderFooter hf = getHeaderFooter(false); if (hf == null) { return false; } final Placeholder pl = Placeholder.lookupOoxml(ph.getType().intValue()); if (pl == null) { return true; } switch (pl) { case DATETIME: return !hf.isSetDt() || hf.getDt(); case FOOTER: return !hf.isSetFtr() || hf.getFtr(); case HEADER: return !hf.isSetHdr() || hf.getHdr(); case SLIDE_NUMBER: return !hf.isSetSldNum() || hf.getSldNum(); default: return true; } }
private static Placeholder lookupNative(int nativeId, int type) { for (Placeholder ph : values()) { if ( type == 0 && ph.nativeSlideId == nativeId || type == 1 && ph.nativeSlideMasterId == nativeId || type == 2 && ph.nativeNotesId == nativeId || type == 3 && ph.nativeNotesMasterId == nativeId ) { return ph; } } return null; }
public static Placeholder lookupNativeNotesMaster(int nativeId) { return lookupNative(nativeId, 3); }
public static Placeholder lookupOoxml(int ooxmlId) { for (Placeholder ph : values()) { if (ph.ooxmlId == ooxmlId) { return ph; } } return null; } }
public static Placeholder lookupNativeSlide(int nativeId) { return lookupNative(nativeId, 0); }
public static Placeholder lookupNativeSlideMaster(int nativeId) { return lookupNative(nativeId, 1); }
public static Placeholder lookupNativeNotes(int nativeId) { return lookupNative(nativeId, 2); }
public static Placeholder lookupNativeNotesMaster(int nativeId) { return lookupNative(nativeId, 3); }