/** * Fetch the value of the given Character related TextProp. * Returns -1 if that TextProp isn't present. * If the TextProp isn't present, the value from the appropriate * Master Sheet will apply. */ private int getCharTextPropVal(String propName) { TextProp prop = null; if (characterStyle != null){ prop = characterStyle.findByName(propName); } if (prop == null){ Sheet sheet = parentRun.getSheet(); int txtype = parentRun.getRunType(); MasterSheet master = sheet.getMasterSheet(); if (master != null) prop = master.getStyleAttribute(txtype, getIndentLevel(), propName, true); } return prop == null ? -1 : prop.getValue(); } /**
private boolean getFlag(boolean isCharacter, int index) { TextPropCollection props; String propname; if (isCharacter){ props = characterStyle; propname = CharFlagsTextProp.NAME; } else { props = paragraphStyle; propname = ParagraphFlagsTextProp.NAME; } BitMaskTextProp prop = null; if (props != null){ prop = (BitMaskTextProp)props.findByName(propname); } if (prop == null){ Sheet sheet = parentRun.getSheet(); if(sheet != null){ int txtype = parentRun.getRunType(); MasterSheet master = sheet.getMasterSheet(); if (master != null){ prop = (BitMaskTextProp)master.getStyleAttribute(txtype, getIndentLevel(), propname, isCharacter); } } else { logger.log(POILogger.WARN, "MasterSheet is not available"); } } return prop == null ? false : prop.getSubValue(index); }
/** * Fetch the value of the given Paragraph related TextProp. * Returns -1 if that TextProp isn't present. * If the TextProp isn't present, the value from the appropriate * Master Sheet will apply. */ private int getParaTextPropVal(String propName) { TextProp prop = null; boolean hardAttribute = false; if (paragraphStyle != null){ prop = paragraphStyle.findByName(propName); BitMaskTextProp maskProp = (BitMaskTextProp)paragraphStyle.findByName(ParagraphFlagsTextProp.NAME); hardAttribute = maskProp != null && maskProp.getValue() == 0; } if (prop == null && !hardAttribute){ Sheet sheet = parentRun.getSheet(); int txtype = parentRun.getRunType(); MasterSheet master = sheet.getMasterSheet(); if (master != null) prop = master.getStyleAttribute(txtype, getIndentLevel(), propName, false); } return prop == null ? -1 : prop.getValue(); }
MasterSheet master = getSheet().getMasterSheet(); if(master != null){ TextShape masterShape = master.getPlaceholderByTextType(type);