// Now set up a grid for the table, cells will fit into the grid
// Each cell width is 3120 in 1440ths of an inch, or 1/3rd of 6.5"
- BigInteger w = new BigInteger("3120");
+ BigInteger w = BigInteger.valueOf(3120);
CTTblGrid grid = ctTbl.addNewTblGrid();
for (int i = 0; i < 3; i++) {
CTTblGridCol gridCol = grid.addNewGridCol();
* Holds values for quick multiplication and division by 10
*/
private static final class TenPower {
- private static final BigInteger FIVE = new BigInteger("5");
+ private static final BigInteger FIVE = BigInteger.valueOf(5);
private static final TenPower[] _cache = new TenPower[350];
public final BigInteger _multiplicand;
cldata.addNewSizeWithCells();
cldata.addNewAnchor().setStringValue("1, 15, 0, 2, 3, 15, 3, 16");
cldata.addNewAutoFill().setStringValue("False");
- cldata.addNewRow().setBigIntegerValue(new BigInteger("0"));
- cldata.addNewColumn().setBigIntegerValue(new BigInteger("0"));
+ cldata.addNewRow().setBigIntegerValue(BigInteger.valueOf(0));
+ cldata.addNewColumn().setBigIntegerValue(BigInteger.valueOf(0));
_items.add(shape);
_qnames.add(QNAME_SHAPE);
return shape;
this.block = block;
CTSdtPr sdtPr = block.addNewSdtPr();
CTDecimalNumber id = sdtPr.addNewId();
- id.setVal(new BigInteger("4844945"));
+ id.setVal(BigInteger.valueOf(4844945));
sdtPr.addNewDocPartObj().addNewDocPartGallery().setVal("Table of contents");
CTSdtEndPr sdtEndPr = block.addNewSdtEndPr();
CTRPr rPr = sdtEndPr.addNewRPr();
rPr.addNewB().setVal(STOnOff.OFF);
rPr.addNewBCs().setVal(STOnOff.OFF);
rPr.addNewColor().setVal("auto");
- rPr.addNewSz().setVal(new BigInteger("24"));
- rPr.addNewSzCs().setVal(new BigInteger("24"));
+ rPr.addNewSz().setVal(BigInteger.valueOf(24));
+ rPr.addNewSzCs().setVal(BigInteger.valueOf(24));
CTSdtContentBlock content = block.addNewSdtContent();
CTP p = content.addNewP();
p.setRsidR("00EF7E24".getBytes(LocaleUtil.CHARSET_1252));
CTTabStop tab = tabs.addNewTab();
tab.setVal(STTabJc.RIGHT);
tab.setLeader(STTabTlc.DOT);
- tab.setPos(new BigInteger("8290"));
+ tab.setPos(BigInteger.valueOf(8290));
pPr.addNewRPr().addNewNoProof();
CTR run = p.addNewR();
run.addNewRPr().addNewNoProof();
@Override
public int getFontSize() {
CTRPr pr = getRunProperties(false);
- return (pr != null && pr.isSetSz()) ? pr.getSz().getVal().divide(new BigInteger("2")).intValue() : -1;
+ return (pr != null && pr.isSetSz()) ? pr.getSz().getVal().divide(BigInteger.valueOf(2)).intValue() : -1;
}
/**
*/
@Override
public void setFontSize(int size) {
- BigInteger bint = new BigInteger(Integer.toString(size));
+ BigInteger bint = BigInteger.valueOf(size);
CTRPr pr = getRunProperties(true);
CTHpsMeasure ctSize = pr.isSetSz() ? pr.getSz() : pr.addNewSz();
- ctSize.setVal(bint.multiply(new BigInteger("2")));
+ ctSize.setVal(bint.multiply(BigInteger.valueOf(2)));
}
/**
table.addNewTr().addNewTc().addNewP();
CTTblPr tblpro = table.addNewTblPr();
- tblpro.addNewTblW().setW(new BigInteger("0"));
+ tblpro.addNewTblW().setW(BigInteger.valueOf(0));
tblpro.getTblW().setType(STTblWidth.AUTO);
// layout
@Test
public void testSetGetFontSize() {
CTRPr rpr = ctRun.addNewRPr();
- rpr.addNewSz().setVal(new BigInteger("14"));
+ rpr.addNewSz().setVal(BigInteger.valueOf(14));
XWPFRun run = new XWPFRun(ctRun, irb);
assertEquals(7, run.getFontSize());
XWPFDocument doc = new XWPFDocument();
CTTbl ctTable = CTTbl.Factory.newInstance();
CTTblGrid cttblgrid = ctTable.addNewTblGrid();
- cttblgrid.addNewGridCol().setW(new BigInteger("123"));
- cttblgrid.addNewGridCol().setW(new BigInteger("321"));
+ cttblgrid.addNewGridCol().setW(BigInteger.valueOf(123));
+ cttblgrid.addNewGridCol().setW(BigInteger.valueOf(321));
XWPFTable xtab = new XWPFTable(ctTable, doc);
assertEquals(123, xtab.getCTTbl().getTblGrid().getGridColArray(0).getW().intValue());