use BigInteger.valueOf

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1879937 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
PJ Fanning 2020-07-16 10:03:00 +00:00
parent 95702c9d7d
commit a5cf0f0d3f
8 changed files with 15 additions and 15 deletions

View File

@ -66,7 +66,7 @@ public class HeaderFooterTable {
// 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();

View File

@ -156,7 +156,7 @@ final class MutableFPNumber {
* 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;

View File

@ -252,8 +252,8 @@ public final class XSSFVMLDrawing extends POIXMLDocumentPart {
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;

View File

@ -52,7 +52,7 @@ public class TOC {
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();
@ -64,8 +64,8 @@ public class TOC {
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));
@ -90,7 +90,7 @@ public class TOC {
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();

View File

@ -870,7 +870,7 @@ public class XWPFRun implements ISDTContents, IRunElement, CharacterRun {
@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;
}
/**
@ -887,10 +887,10 @@ public class XWPFRun implements ISDTContents, IRunElement, CharacterRun {
*/
@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)));
}
/**

View File

@ -190,7 +190,7 @@ public class XWPFTable implements IBodyElement, ISDTContents {
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

View File

@ -179,7 +179,7 @@ public class TestXWPFRun {
@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());

View File

@ -73,8 +73,8 @@ public class TestXWPFTable {
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());