From 2dff049db92724cb78c20c649efecc00d7545e5e Mon Sep 17 00:00:00 2001 From: PJ Fanning Date: Tue, 27 Feb 2018 14:24:50 +0000 Subject: [PATCH] use Integer.toString to convert ints to strings git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1825457 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/poi/xwpf/usermodel/XWPFParagraph.java | 16 ++++++++-------- .../org/apache/poi/xwpf/usermodel/XWPFRun.java | 4 ++-- .../org/apache/poi/xwpf/usermodel/XWPFTable.java | 2 +- .../apache/poi/xwpf/usermodel/XWPFTableRow.java | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFParagraph.java b/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFParagraph.java index 2e7e8238d4..adbbfd1797 100644 --- a/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFParagraph.java +++ b/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFParagraph.java @@ -902,7 +902,7 @@ public class XWPFParagraph implements IBodyElement, IRunBody, ISDTContents, Para public void setSpacingAfter(int spaces) { CTSpacing spacing = getCTSpacing(true); if (spacing != null) { - BigInteger bi = new BigInteger("" + spaces); + BigInteger bi = new BigInteger(Integer.toString(spaces)); spacing.setAfter(bi); } @@ -939,7 +939,7 @@ public class XWPFParagraph implements IBodyElement, IRunBody, ISDTContents, Para */ public void setSpacingAfterLines(int spaces) { CTSpacing spacing = getCTSpacing(true); - BigInteger bi = new BigInteger("" + spaces); + BigInteger bi = new BigInteger(Integer.toString(spaces)); spacing.setAfterLines(bi); } @@ -967,7 +967,7 @@ public class XWPFParagraph implements IBodyElement, IRunBody, ISDTContents, Para */ public void setSpacingBefore(int spaces) { CTSpacing spacing = getCTSpacing(true); - BigInteger bi = new BigInteger("" + spaces); + BigInteger bi = new BigInteger(Integer.toString(spaces)); spacing.setBefore(bi); } @@ -998,7 +998,7 @@ public class XWPFParagraph implements IBodyElement, IRunBody, ISDTContents, Para */ public void setSpacingBeforeLines(int spaces) { CTSpacing spacing = getCTSpacing(true); - BigInteger bi = new BigInteger("" + spaces); + BigInteger bi = new BigInteger(Integer.toString(spaces)); spacing.setBeforeLines(bi); } @@ -1119,7 +1119,7 @@ public class XWPFParagraph implements IBodyElement, IRunBody, ISDTContents, Para */ public void setIndentationLeft(int indentation) { CTInd indent = getCTInd(true); - BigInteger bi = new BigInteger("" + indentation); + BigInteger bi = new BigInteger(Integer.toString(indentation)); indent.setLeft(bi); } @@ -1158,7 +1158,7 @@ public class XWPFParagraph implements IBodyElement, IRunBody, ISDTContents, Para */ public void setIndentationRight(int indentation) { CTInd indent = getCTInd(true); - BigInteger bi = new BigInteger("" + indentation); + BigInteger bi = new BigInteger(Integer.toString(indentation)); indent.setRight(bi); } @@ -1196,7 +1196,7 @@ public class XWPFParagraph implements IBodyElement, IRunBody, ISDTContents, Para public void setIndentationHanging(int indentation) { CTInd indent = getCTInd(true); - BigInteger bi = new BigInteger("" + indentation); + BigInteger bi = new BigInteger(Integer.toString(indentation)); indent.setHanging(bi); } @@ -1237,7 +1237,7 @@ public class XWPFParagraph implements IBodyElement, IRunBody, ISDTContents, Para */ public void setIndentationFirstLine(int indentation) { CTInd indent = getCTInd(true); - BigInteger bi = new BigInteger("" + indentation); + BigInteger bi = new BigInteger(Integer.toString(indentation)); indent.setFirstLine(bi); } 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 c6dd9bb508..abd7b6eea5 100644 --- a/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFRun.java +++ b/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFRun.java @@ -807,7 +807,7 @@ public class XWPFRun implements ISDTContents, IRunElement, CharacterRun { */ @Override public void setFontSize(int size) { - BigInteger bint = new BigInteger("" + size); + BigInteger bint = new BigInteger(Integer.toString(size)); CTRPr pr = run.isSetRPr() ? run.getRPr() : run.addNewRPr(); CTHpsMeasure ctSize = pr.isSetSz() ? pr.getSz() : pr.addNewSz(); ctSize.setVal(bint.multiply(new BigInteger("2"))); @@ -851,7 +851,7 @@ public class XWPFRun implements ISDTContents, IRunElement, CharacterRun { * values will lower it. */ public void setTextPosition(int val) { - BigInteger bint = new BigInteger("" + val); + BigInteger bint = new BigInteger(Integer.toString(val)); CTRPr pr = run.isSetRPr() ? run.getRPr() : run.addNewRPr(); CTSignedHpsMeasure position = pr.isSetPosition() ? pr.getPosition() : pr.addNewPosition(); position.setVal(bint); 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 7ff279fad5..6b615139ab 100644 --- a/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFTable.java +++ b/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFTable.java @@ -278,7 +278,7 @@ public class XWPFTable implements IBodyElement, ISDTContents { public void setWidth(int width) { CTTblPr tblPr = getTblPr(); CTTblWidth tblWidth = tblPr.isSetTblW() ? tblPr.getTblW() : tblPr.addNewTblW(); - tblWidth.setW(new BigInteger("" + width)); + tblWidth.setW(new BigInteger(Integer.toString(width))); } /** diff --git a/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFTableRow.java b/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFTableRow.java index 39d2ff71ce..c3a6755c3b 100644 --- a/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFTableRow.java +++ b/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFTableRow.java @@ -115,7 +115,7 @@ public class XWPFTableRow { public void setHeight(int height) { CTTrPr properties = getTrPr(); CTHeight h = properties.sizeOfTrHeightArray() == 0 ? properties.addNewTrHeight() : properties.getTrHeightArray(0); - h.setVal(new BigInteger("" + height)); + h.setVal(new BigInteger(Integer.toString(height))); } private CTTrPr getTrPr() {