Search in sources :

Example 1 with CTDecimalNumber

use of org.openxmlformats.schemas.wordprocessingml.x2006.main.CTDecimalNumber in project poi by apache.

the class XWPFTable method getRowBandSize.

public int getRowBandSize() {
    int size = 0;
    CTTblPr tblPr = getTrPr();
    if (tblPr.isSetTblStyleRowBandSize()) {
        CTDecimalNumber rowSize = tblPr.getTblStyleRowBandSize();
        size = rowSize.getVal().intValue();
    }
    return size;
}
Also used : CTDecimalNumber(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTDecimalNumber) CTTblPr(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTblPr)

Example 2 with CTDecimalNumber

use of org.openxmlformats.schemas.wordprocessingml.x2006.main.CTDecimalNumber in project poi by apache.

the class XWPFTable method setColBandSize.

public void setColBandSize(int size) {
    CTTblPr tblPr = getTrPr();
    CTDecimalNumber colSize = tblPr.isSetTblStyleColBandSize() ? tblPr.getTblStyleColBandSize() : tblPr.addNewTblStyleColBandSize();
    colSize.setVal(BigInteger.valueOf(size));
}
Also used : CTDecimalNumber(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTDecimalNumber) CTTblPr(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTblPr)

Example 3 with CTDecimalNumber

use of org.openxmlformats.schemas.wordprocessingml.x2006.main.CTDecimalNumber in project poi by apache.

the class XWPFTable method setRowBandSize.

public void setRowBandSize(int size) {
    CTTblPr tblPr = getTrPr();
    CTDecimalNumber rowSize = tblPr.isSetTblStyleRowBandSize() ? tblPr.getTblStyleRowBandSize() : tblPr.addNewTblStyleRowBandSize();
    rowSize.setVal(BigInteger.valueOf(size));
}
Also used : CTDecimalNumber(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTDecimalNumber) CTTblPr(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTblPr)

Example 4 with CTDecimalNumber

use of org.openxmlformats.schemas.wordprocessingml.x2006.main.CTDecimalNumber in project Gargoyle by callakrsos.

the class MSWord method spanCellsAcrossRow.

/**
	 * 테이블의 특정 로우의 컬럼에 해당하는 부분의 셀을 나눔. 나누기는 하나.. 컬럼의 셀수가 일치하지 않고 틀어짐.
	 *
	 * @param table
	 * @param rowNum
	 * @param colNum
	 * @param span
	 */
private static void spanCellsAcrossRow(XWPFTable table, int rowNum, int colNum, int span) {
    XWPFTableRow row = table.getRow(rowNum);
    XWPFTableCell cell = row.getCell(colNum);
    CTDecimalNumber grdSpan = cell.getCTTc().getTcPr().getGridSpan();
    if (grdSpan == null) {
        grdSpan = cell.getCTTc().getTcPr().addNewGridSpan();
    }
    grdSpan.setVal(BigInteger.valueOf((long) span));
/*
		 * row가 0인경우 바로 아래래 로우의 컬럼수도 일치하도록 셀을 추가한다. 추가하지않는경우 컬럼셀의 수가 불일치한 상태로
		 * 문서가 만들어진다.
		 */
// if (rowNum == 0)
// {
// addTableCell(DIRECTION._0, table, rowNum, span);
// } else
// {
// addTableCell(DIRECTION.UP_DOWN, table, rowNum, span);
// }
}
Also used : XWPFTableCell(org.apache.poi.xwpf.usermodel.XWPFTableCell) CTDecimalNumber(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTDecimalNumber) XWPFTableRow(org.apache.poi.xwpf.usermodel.XWPFTableRow)

Example 5 with CTDecimalNumber

use of org.openxmlformats.schemas.wordprocessingml.x2006.main.CTDecimalNumber in project tika by apache.

the class XWPFListManager method loadLevelTuples.

private ParagraphLevelCounter loadLevelTuples(CTDecimalNumber abNum) {
    //Unfortunately, we need to go this far into the underlying structure
    //to get the abstract num information for the edge case where
    //someone skips a level and the format is not context-free, e.g. "1.B.i".
    XWPFAbstractNum abstractNum = numbering.getAbstractNum(abNum.getVal());
    CTAbstractNum ctAbstractNum = abstractNum.getCTAbstractNum();
    LevelTuple[] levels = new LevelTuple[ctAbstractNum.sizeOfLvlArray()];
    for (int i = 0; i < levels.length; i++) {
        levels[i] = buildTuple(i, ctAbstractNum.getLvlArray(i));
    }
    return new ParagraphLevelCounter(levels);
}
Also used : XWPFAbstractNum(org.apache.poi.xwpf.usermodel.XWPFAbstractNum) CTAbstractNum(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTAbstractNum)

Aggregations

CTDecimalNumber (org.openxmlformats.schemas.wordprocessingml.x2006.main.CTDecimalNumber)7 CTTblPr (org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTblPr)4 XWPFTableCell (org.apache.poi.xwpf.usermodel.XWPFTableCell)2 XWPFTableRow (org.apache.poi.xwpf.usermodel.XWPFTableRow)2 XWPFAbstractNum (org.apache.poi.xwpf.usermodel.XWPFAbstractNum)1 XWPFNum (org.apache.poi.xwpf.usermodel.XWPFNum)1 CTAbstractNum (org.openxmlformats.schemas.wordprocessingml.x2006.main.CTAbstractNum)1 CTNum (org.openxmlformats.schemas.wordprocessingml.x2006.main.CTNum)1