aboutsummaryrefslogtreecommitdiffstats
path: root/src/ooxml
diff options
context:
space:
mode:
authorPJ Fanning <fanningpj@apache.org>2020-07-16 10:03:00 +0000
committerPJ Fanning <fanningpj@apache.org>2020-07-16 10:03:00 +0000
commita5cf0f0d3fff77668f5b62db7850f400ae970269 (patch)
tree8a4052c1a2712966102eefee2afb9012e621191a /src/ooxml
parent95702c9d7d6bc0bc4fb7bbced332806c09890a04 (diff)
downloadpoi-a5cf0f0d3fff77668f5b62db7850f400ae970269.tar.gz
poi-a5cf0f0d3fff77668f5b62db7850f400ae970269.zip
use BigInteger.valueOf
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1879937 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/ooxml')
-rw-r--r--src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFVMLDrawing.java4
-rw-r--r--src/ooxml/java/org/apache/poi/xwpf/usermodel/TOC.java8
-rw-r--r--src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFRun.java6
-rw-r--r--src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFTable.java2
-rw-r--r--src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFRun.java2
-rw-r--r--src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFTable.java4
6 files changed, 13 insertions, 13 deletions
diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFVMLDrawing.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFVMLDrawing.java
index 3c014ff78e..46f301bc40 100644
--- a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFVMLDrawing.java
+++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFVMLDrawing.java
@@ -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;
diff --git a/src/ooxml/java/org/apache/poi/xwpf/usermodel/TOC.java b/src/ooxml/java/org/apache/poi/xwpf/usermodel/TOC.java
index e7e9b8e985..82acbb2817 100644
--- a/src/ooxml/java/org/apache/poi/xwpf/usermodel/TOC.java
+++ b/src/ooxml/java/org/apache/poi/xwpf/usermodel/TOC.java
@@ -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();
diff --git a/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFRun.java b/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFRun.java
index 1d785750a0..c53d7699e2 100644
--- a/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFRun.java
+++ b/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFRun.java
@@ -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)));
}
/**
diff --git a/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFTable.java b/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFTable.java
index b0af94cec2..37713dd1a9 100644
--- a/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFTable.java
+++ b/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFTable.java
@@ -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
diff --git a/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFRun.java b/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFRun.java
index 846085b512..72013f8985 100644
--- a/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFRun.java
+++ b/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFRun.java
@@ -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());
diff --git a/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFTable.java b/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFTable.java
index 77ba00e0f2..a110d17019 100644
--- a/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFTable.java
+++ b/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFTable.java
@@ -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());