From 402b02ca1fa09ac22c08ecb23598c206000cfabe Mon Sep 17 00:00:00 2001 From: PJ Fanning Date: Wed, 31 Aug 2022 10:09:13 +0000 Subject: [PATCH] tidy up code git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1903788 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/poi/xwpf/usermodel/XWPFTable.java | 54 +++++++++---------- .../poi/xwpf/usermodel/XWPFTableCell.java | 8 +-- 2 files changed, 31 insertions(+), 31 deletions(-) diff --git a/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFTable.java b/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFTable.java index f04c297a1c..33548e791d 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFTable.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFTable.java @@ -76,33 +76,33 @@ public class XWPFTable implements IBodyElement, ISDTContents { static { // populate enum maps xwpfBorderTypeMap = new EnumMap<>(XWPFBorderType.class); - xwpfBorderTypeMap.put(XWPFBorderType.NIL, STBorder.Enum.forInt(STBorder.INT_NIL)); - xwpfBorderTypeMap.put(XWPFBorderType.NONE, STBorder.Enum.forInt(STBorder.INT_NONE)); - xwpfBorderTypeMap.put(XWPFBorderType.SINGLE, STBorder.Enum.forInt(STBorder.INT_SINGLE)); - xwpfBorderTypeMap.put(XWPFBorderType.THICK, STBorder.Enum.forInt(STBorder.INT_THICK)); - xwpfBorderTypeMap.put(XWPFBorderType.DOUBLE, STBorder.Enum.forInt(STBorder.INT_DOUBLE)); - xwpfBorderTypeMap.put(XWPFBorderType.DOTTED, STBorder.Enum.forInt(STBorder.INT_DOTTED)); - xwpfBorderTypeMap.put(XWPFBorderType.DASHED, STBorder.Enum.forInt(STBorder.INT_DASHED)); - xwpfBorderTypeMap.put(XWPFBorderType.DOT_DASH, STBorder.Enum.forInt(STBorder.INT_DOT_DASH)); - xwpfBorderTypeMap.put(XWPFBorderType.DOT_DOT_DASH, STBorder.Enum.forInt(STBorder.INT_DOT_DOT_DASH)); - xwpfBorderTypeMap.put(XWPFBorderType.TRIPLE, STBorder.Enum.forInt(STBorder.INT_TRIPLE)); - xwpfBorderTypeMap.put(XWPFBorderType.THIN_THICK_SMALL_GAP, STBorder.Enum.forInt(STBorder.INT_THIN_THICK_SMALL_GAP)); - xwpfBorderTypeMap.put(XWPFBorderType.THICK_THIN_SMALL_GAP, STBorder.Enum.forInt(STBorder.INT_THICK_THIN_SMALL_GAP)); - xwpfBorderTypeMap.put(XWPFBorderType.THIN_THICK_THIN_SMALL_GAP, STBorder.Enum.forInt(STBorder.INT_THIN_THICK_THIN_SMALL_GAP)); - xwpfBorderTypeMap.put(XWPFBorderType.THIN_THICK_MEDIUM_GAP, STBorder.Enum.forInt(STBorder.INT_THIN_THICK_MEDIUM_GAP)); - xwpfBorderTypeMap.put(XWPFBorderType.THICK_THIN_MEDIUM_GAP, STBorder.Enum.forInt(STBorder.INT_THICK_THIN_MEDIUM_GAP)); - xwpfBorderTypeMap.put(XWPFBorderType.THIN_THICK_THIN_MEDIUM_GAP, STBorder.Enum.forInt(STBorder.INT_THIN_THICK_THIN_MEDIUM_GAP)); - xwpfBorderTypeMap.put(XWPFBorderType.THIN_THICK_LARGE_GAP, STBorder.Enum.forInt(STBorder.INT_THIN_THICK_LARGE_GAP)); - xwpfBorderTypeMap.put(XWPFBorderType.THICK_THIN_LARGE_GAP, STBorder.Enum.forInt(STBorder.INT_THICK_THIN_LARGE_GAP)); - xwpfBorderTypeMap.put(XWPFBorderType.THIN_THICK_THIN_LARGE_GAP, STBorder.Enum.forInt(STBorder.INT_THIN_THICK_THIN_LARGE_GAP)); - xwpfBorderTypeMap.put(XWPFBorderType.WAVE, STBorder.Enum.forInt(STBorder.INT_WAVE)); - xwpfBorderTypeMap.put(XWPFBorderType.DOUBLE_WAVE, STBorder.Enum.forInt(STBorder.INT_DOUBLE_WAVE)); - xwpfBorderTypeMap.put(XWPFBorderType.DASH_SMALL_GAP, STBorder.Enum.forInt(STBorder.INT_DASH_SMALL_GAP)); - xwpfBorderTypeMap.put(XWPFBorderType.DASH_DOT_STROKED, STBorder.Enum.forInt(STBorder.INT_DASH_DOT_STROKED)); - xwpfBorderTypeMap.put(XWPFBorderType.THREE_D_EMBOSS, STBorder.Enum.forInt(STBorder.INT_THREE_D_EMBOSS)); - xwpfBorderTypeMap.put(XWPFBorderType.THREE_D_ENGRAVE, STBorder.Enum.forInt(STBorder.INT_THREE_D_ENGRAVE)); - xwpfBorderTypeMap.put(XWPFBorderType.OUTSET, STBorder.Enum.forInt(STBorder.INT_OUTSET)); - xwpfBorderTypeMap.put(XWPFBorderType.INSET, STBorder.Enum.forInt(STBorder.INT_INSET)); + xwpfBorderTypeMap.put(XWPFBorderType.NIL, STBorder.NIL); + xwpfBorderTypeMap.put(XWPFBorderType.NONE, STBorder.NONE); + xwpfBorderTypeMap.put(XWPFBorderType.SINGLE, STBorder.SINGLE); + xwpfBorderTypeMap.put(XWPFBorderType.THICK, STBorder.THICK); + xwpfBorderTypeMap.put(XWPFBorderType.DOUBLE, STBorder.DOUBLE); + xwpfBorderTypeMap.put(XWPFBorderType.DOTTED, STBorder.DOTTED); + xwpfBorderTypeMap.put(XWPFBorderType.DASHED, STBorder.DASHED); + xwpfBorderTypeMap.put(XWPFBorderType.DOT_DASH, STBorder.DOT_DASH); + xwpfBorderTypeMap.put(XWPFBorderType.DOT_DOT_DASH, STBorder.DOT_DOT_DASH); + xwpfBorderTypeMap.put(XWPFBorderType.TRIPLE, STBorder.TRIPLE); + xwpfBorderTypeMap.put(XWPFBorderType.THIN_THICK_SMALL_GAP, STBorder.THIN_THICK_SMALL_GAP); + xwpfBorderTypeMap.put(XWPFBorderType.THICK_THIN_SMALL_GAP, STBorder.THICK_THIN_SMALL_GAP); + xwpfBorderTypeMap.put(XWPFBorderType.THIN_THICK_THIN_SMALL_GAP, STBorder.THIN_THICK_THIN_SMALL_GAP); + xwpfBorderTypeMap.put(XWPFBorderType.THIN_THICK_MEDIUM_GAP, STBorder.THIN_THICK_MEDIUM_GAP); + xwpfBorderTypeMap.put(XWPFBorderType.THICK_THIN_MEDIUM_GAP, STBorder.THICK_THIN_MEDIUM_GAP); + xwpfBorderTypeMap.put(XWPFBorderType.THIN_THICK_THIN_MEDIUM_GAP, STBorder.THIN_THICK_THIN_MEDIUM_GAP); + xwpfBorderTypeMap.put(XWPFBorderType.THIN_THICK_LARGE_GAP, STBorder.THIN_THICK_LARGE_GAP); + xwpfBorderTypeMap.put(XWPFBorderType.THICK_THIN_LARGE_GAP, STBorder.THICK_THIN_LARGE_GAP); + xwpfBorderTypeMap.put(XWPFBorderType.THIN_THICK_THIN_LARGE_GAP, STBorder.THIN_THICK_THIN_LARGE_GAP); + xwpfBorderTypeMap.put(XWPFBorderType.WAVE, STBorder.WAVE); + xwpfBorderTypeMap.put(XWPFBorderType.DOUBLE_WAVE, STBorder.DOUBLE_WAVE); + xwpfBorderTypeMap.put(XWPFBorderType.DASH_SMALL_GAP, STBorder.DASH_SMALL_GAP); + xwpfBorderTypeMap.put(XWPFBorderType.DASH_DOT_STROKED, STBorder.DASH_DOT_STROKED); + xwpfBorderTypeMap.put(XWPFBorderType.THREE_D_EMBOSS, STBorder.THREE_D_EMBOSS); + xwpfBorderTypeMap.put(XWPFBorderType.THREE_D_ENGRAVE, STBorder.THREE_D_ENGRAVE); + xwpfBorderTypeMap.put(XWPFBorderType.OUTSET, STBorder.OUTSET); + xwpfBorderTypeMap.put(XWPFBorderType.INSET, STBorder.INSET); stBorderTypeMap = new HashMap<>(); stBorderTypeMap.put(STBorder.INT_NIL, XWPFBorderType.NIL); diff --git a/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFTableCell.java b/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFTableCell.java index 47ccb465c7..f3044af3fd 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFTableCell.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFTableCell.java @@ -54,10 +54,10 @@ public class XWPFTableCell implements IBody, ICell { static { // populate enum maps alignMap = new EnumMap<>(XWPFVertAlign.class); - alignMap.put(XWPFVertAlign.TOP, STVerticalJc.Enum.forInt(STVerticalJc.INT_TOP)); - alignMap.put(XWPFVertAlign.CENTER, STVerticalJc.Enum.forInt(STVerticalJc.INT_CENTER)); - alignMap.put(XWPFVertAlign.BOTH, STVerticalJc.Enum.forInt(STVerticalJc.INT_BOTH)); - alignMap.put(XWPFVertAlign.BOTTOM, STVerticalJc.Enum.forInt(STVerticalJc.INT_BOTTOM)); + alignMap.put(XWPFVertAlign.TOP, STVerticalJc.TOP); + alignMap.put(XWPFVertAlign.CENTER, STVerticalJc.CENTER); + alignMap.put(XWPFVertAlign.BOTH, STVerticalJc.BOTH); + alignMap.put(XWPFVertAlign.BOTTOM, STVerticalJc.BOTTOM); stVertAlignTypeMap = new HashMap<>(); stVertAlignTypeMap.put(STVerticalJc.INT_TOP, XWPFVertAlign.TOP); -- 2.39.5