Search in sources :

Example 6 with CTDecimalNumber

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

the class XWPFListManager method getFormattedNumber.

public String getFormattedNumber(BigInteger numId, int iLvl) {
    if (numbering == null || iLvl < 0 || numId == null) {
        return "";
    }
    int currNumId = numId.intValue();
    XWPFNum xwpfNum = numbering.getNum(numId);
    if (xwpfNum == null) {
        return "";
    }
    CTNum ctNum = xwpfNum.getCTNum();
    CTDecimalNumber abNum = ctNum.getAbstractNumId();
    int currAbNumId = abNum.getVal().intValue();
    ParagraphLevelCounter lc = listLevelMap.get(currAbNumId);
    LevelTuple[] overrideTuples = overrideTupleMap.get(currNumId);
    if (lc == null) {
        lc = loadLevelTuples(abNum);
    }
    if (overrideTuples == null) {
        overrideTuples = loadOverrideTuples(ctNum, lc.getNumberOfLevels());
    }
    String formattedString = lc.incrementLevel(iLvl, overrideTuples);
    listLevelMap.put(currAbNumId, lc);
    overrideTupleMap.put(currNumId, overrideTuples);
    return formattedString;
}
Also used : CTNum(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTNum) CTDecimalNumber(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTDecimalNumber) XWPFNum(org.apache.poi.xwpf.usermodel.XWPFNum)

Example 7 with CTDecimalNumber

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

the class MSWord method mergeCellHorizon.

/**
	 * 수평셀 병합
	 *
	 * @param table
	 * @param rowNum
	 * @param colNum
	 * @param span
	 */
public void mergeCellHorizon(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));
}
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 8 with CTDecimalNumber

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

the class XWPFTable method getColBandSize.

public int getColBandSize() {
    int size = 0;
    CTTblPr tblPr = getTrPr();
    if (tblPr.isSetTblStyleColBandSize()) {
        CTDecimalNumber colSize = tblPr.getTblStyleColBandSize();
        size = colSize.getVal().intValue();
    }
    return size;
}
Also used : CTDecimalNumber(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTDecimalNumber) CTTblPr(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTblPr)

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