/** * For isBold, isItalic etc */ private static boolean isCTOnOff(CTOnOff onoff) { if (!onoff.isSetVal()) { return true; } final STOnOff.Enum val = onoff.getVal(); return ( (STOnOff.TRUE == val) || (STOnOff.X_1 == val) || (STOnOff.ON == val) ); }
/** * This element specifies whether a consumer shall break Latin text which * exceeds the text extents of a line by breaking the word across two lines * (breaking on the character level) or by moving the word to the following * line (breaking on the word level). * * @return boolean */ @Override public boolean isWordWrapped() { CTOnOff wordWrap = getCTPPr().isSetWordWrap() ? getCTPPr() .getWordWrap() : null; if (wordWrap != null) { return (wordWrap.getVal() == STOnOff.ON || wordWrap.getVal() == STOnOff.TRUE || wordWrap.getVal() == STOnOff.X_1) ? true : false; } return false; }
boolean isUpdateFields() { return ctSettings.isSetUpdateFields() && ctSettings.getUpdateFields().getVal() == STOnOff.TRUE; }
if (ctfldChar.getFfData() != null) { for (CTFFCheckBox checkBox : ctfldChar.getFfData().getCheckBoxList()) { if (checkBox.getDefault() != null && checkBox.getDefault().getVal() == STOnOff.X_1) { text.append("|X|"); } else {
/** * Specifies that when rendering this document in a paginated * view, the contents of this paragraph are rendered on the start of a new * page in the document. * <p> * If this element is omitted on a given paragraph, * its value is determined by the setting previously set at any level of the * style hierarchy (i.e. that previous setting remains unchanged). If this * setting is never specified in the style hierarchy, then this property * shall not be applied. Since the paragraph is specified to start on a new * page, it begins page two even though it could have fit on page one. * </p> * * @return boolean - if page break is set */ public boolean isPageBreak() { final CTPPr ppr = getCTPPr(); final CTOnOff ctPageBreak = ppr.isSetPageBreakBefore() ? ppr.getPageBreakBefore() : null; if (ctPageBreak == null) { return false; } return isTruelike(ctPageBreak.getVal(), false); }
private boolean getRepeat() { boolean repeat = false; if (ctRow.isSetTrPr()) { CTTrPr trpr = getTrPr(); if (trpr.sizeOfTblHeaderArray() > 0) { CTOnOff rpt = trpr.getTblHeaderArray(0); repeat = (rpt.isSetVal() ? WMLHelper.convertSTOnOffToBoolean(rpt.getVal()) : true); } } return repeat; }
/** * Return true if the "can't split row" value is true. The logic for this * attribute is a little unusual: a TRUE value means DON'T allow rows to * split, FALSE means allow rows to split. * * @return true if rows can't be split, false otherwise. */ public boolean isCantSplitRow() { boolean isCant = false; if (ctRow.isSetTrPr()) { CTTrPr trpr = getTrPr(); if (trpr.sizeOfCantSplitArray() > 0) { CTOnOff onoff = trpr.getCantSplitArray(0); isCant = (onoff.isSetVal() ? WMLHelper.convertSTOnOffToBoolean(onoff.getVal()) : true); } } return isCant; }
/** * For isBold, isItalic etc */ public static boolean isCTOnOff( CTOnOff onoff ) { if ( onoff == null ) { return false; } if ( !onoff.isSetVal() ) return true; if ( onoff.getVal() == STOnOff.ON ) return true; if ( onoff.getVal() == STOnOff.TRUE ) return true; if ( onoff.getVal() == STOnOff.X_1 ) // sometimes bold, italic are with w="1". Ex : <w:i w:val="1" /> // see https://code.google.com/p/xdocreport/issues/detail?id=315 return true; return false; } }
/** * For isBold, isItalic etc */ private static boolean isCTOnOff(CTOnOff onoff) { if (!onoff.isSetVal()) { return true; } final STOnOff.Enum val = onoff.getVal(); return ( (STOnOff.TRUE == val) || (STOnOff.X_1 == val) || (STOnOff.ON == val) ); }
/** * This element specifies whether a consumer shall break Latin text which * exceeds the text extents of a line by breaking the word across two lines * (breaking on the character level) or by moving the word to the following * line (breaking on the word level). * * @return boolean */ public boolean isWordWrap() { CTOnOff wordWrap = getCTPPr().isSetWordWrap() ? getCTPPr() .getWordWrap() : null; if (wordWrap != null) { return (wordWrap.getVal() == STOnOff.ON || wordWrap.getVal() == STOnOff.TRUE || wordWrap.getVal() == STOnOff.X_1) ? true : false; } return false; }
/** * This element specifies whether a consumer shall break Latin text which * exceeds the text extents of a line by breaking the word across two lines * (breaking on the character level) or by moving the word to the following * line (breaking on the word level). * * @return boolean */ @Override public boolean isWordWrapped() { CTOnOff wordWrap = getCTPPr().isSetWordWrap() ? getCTPPr() .getWordWrap() : null; if (wordWrap != null) { return (wordWrap.getVal() == STOnOff.ON || wordWrap.getVal() == STOnOff.TRUE || wordWrap.getVal() == STOnOff.X_1) ? true : false; } return false; }
boolean isUpdateFields() { return ctSettings.isSetUpdateFields() && ctSettings.getUpdateFields().getVal() == STOnOff.TRUE; }
boolean isUpdateFields() { return ctSettings.isSetUpdateFields() && ctSettings.getUpdateFields().getVal() == STOnOff.TRUE; }
/** * Return true if the "can't split row" value is true. The logic for this * attribute is a little unusual: a TRUE value means DON'T allow rows to * split, FALSE means allow rows to split. * @return true if rows can't be split, false otherwise. */ public boolean isCantSplitRow() { boolean isCant = false; CTTrPr trpr = getTrPr(); if (trpr.sizeOfCantSplitArray() > 0) { CTOnOff onoff = trpr.getCantSplitList().get(0); isCant = onoff.getVal().equals(STOnOff.ON); } return isCant; }
/** * Return true if a table's header row should be repeated at the top of a * table split across pages. * @return true if table's header row should be repeated at the top of each * page of table, false otherwise. */ public boolean isRepeatHeader() { boolean repeat = false; CTTrPr trpr = getTrPr(); if (trpr.sizeOfTblHeaderArray() > 0) { CTOnOff rpt = trpr.getTblHeaderList().get(0); repeat = rpt.getVal().equals(STOnOff.ON); } return repeat; }
@Override protected void endVisitPargraph( XWPFParagraph paragraph, IITextContainer parentContainer, IITextContainer paragraphContainer ) throws Exception { // Page Break // Cannot use paragraph.isPageBreak() because it throw NPE because // pageBreak.getVal() can be null. CTPPr ppr = paragraph.getCTP().getPPr(); if ( ppr.isSetPageBreakBefore() ) { CTOnOff pageBreak = ppr.getPageBreakBefore(); if ( pageBreak != null && ( pageBreak.getVal() == null || pageBreak.getVal().intValue() == STOnOff.INT_TRUE ) ) { pdfDocument.newPage(); } } // Paragraph ExtendedParagraph pdfParagraph = (ExtendedParagraph) paragraphContainer; parentContainer.addElement( pdfParagraph.getContainer() ); }
private boolean getRepeat() { boolean repeat = false; if (ctRow.isSetTrPr()) { CTTrPr trpr = getTrPr(); if (trpr.sizeOfTblHeaderArray() > 0) { CTOnOff rpt = trpr.getTblHeaderArray(0); repeat = (rpt.isSetVal() ? WMLHelper.convertSTOnOffToBoolean(rpt.getVal()) : true); } } return repeat; }
/** * Return true if the "can't split row" value is true. The logic for this * attribute is a little unusual: a TRUE value means DON'T allow rows to * split, FALSE means allow rows to split. * * @return true if rows can't be split, false otherwise. */ public boolean isCantSplitRow() { boolean isCant = false; if (ctRow.isSetTrPr()) { CTTrPr trpr = getTrPr(); if (trpr.sizeOfCantSplitArray() > 0) { CTOnOff onoff = trpr.getCantSplitArray(0); isCant = (onoff.isSetVal() ? WMLHelper.convertSTOnOffToBoolean(onoff.getVal()) : true); } } return isCant; }