diff options
Diffstat (limited to 'src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFNumbering.java')
-rw-r--r-- | src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFNumbering.java | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFNumbering.java b/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFNumbering.java index 9e4fc7d08b..861b07409b 100644 --- a/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFNumbering.java +++ b/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFNumbering.java @@ -44,10 +44,11 @@ import org.openxmlformats.schemas.wordprocessingml.x2006.main.NumberingDocument; * */ public class XWPFNumbering extends POIXMLDocumentPart { - private CTNumbering ctNumbering; - protected List<XWPFAbstractNum> abstractNums; - protected List<XWPFNum> nums; - protected boolean isNew; + protected List<XWPFAbstractNum> abstractNums = new ArrayList<XWPFAbstractNum>(); + protected List<XWPFNum> nums = new ArrayList<XWPFNum>(); + + private CTNumbering ctNumbering; + boolean isNew; /** *create a new styles object with an existing document @@ -55,7 +56,6 @@ public class XWPFNumbering extends POIXMLDocumentPart { public XWPFNumbering(PackagePart part, PackageRelationship rel) throws IOException, OpenXML4JException{ super(part, rel); isNew = true; - onDocumentRead(); } /** @@ -72,8 +72,6 @@ public class XWPFNumbering extends POIXMLDocumentPart { */ @Override protected void onDocumentRead() throws IOException{ - abstractNums = new ArrayList<XWPFAbstractNum>(); - nums = new ArrayList<XWPFNum>(); NumberingDocument numberingDoc = null; InputStream is; is = getPackagePart().getInputStream(); @@ -100,7 +98,7 @@ public class XWPFNumbering extends POIXMLDocumentPart { protected void commit() throws IOException { XmlOptions xmlOptions = new XmlOptions(DEFAULT_XML_OPTIONS); xmlOptions.setSaveSyntheticDocumentElement(new QName(CTNumbering.type.getName().getNamespaceURI(), "numbering")); - Map map = new HashMap(); + Map<String,String> map = new HashMap<String,String>(); map.put("http://schemas.openxmlformats.org/markup-compatibility/2006", "ve"); map.put("urn:schemas-microsoft-com:office:office", "o"); map.put("http://schemas.openxmlformats.org/officeDocument/2006/relationships", "r"); |