Fix work bug #42799

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@600910 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Nick Burch 2007-12-04 12:33:24 +00:00
parent 92cb3654cb
commit 6ee1aa407f

View File

@ -19,6 +19,8 @@
package org.apache.poi.hwpf.model; package org.apache.poi.hwpf.model;
import org.apache.poi.util.LittleEndian; import org.apache.poi.util.LittleEndian;
import org.apache.poi.util.POILogFactory;
import org.apache.poi.util.POILogger;
import org.apache.poi.hwpf.model.io.*; import org.apache.poi.hwpf.model.io.*;
@ -37,6 +39,7 @@ public class ListTables
{ {
private static final int LIST_DATA_SIZE = 28; private static final int LIST_DATA_SIZE = 28;
private static final int LIST_FORMAT_OVERRIDE_SIZE = 16; private static final int LIST_FORMAT_OVERRIDE_SIZE = 16;
private static POILogger log = POILogFactory.getLogger(ListTables.class);
HashMap _listMap = new HashMap(); HashMap _listMap = new HashMap();
ArrayList _overrideList = new ArrayList(); ArrayList _overrideList = new ArrayList();
@ -189,8 +192,13 @@ public class ListTables
public ListLevel getLevel(int listID, int level) public ListLevel getLevel(int listID, int level)
{ {
ListData lst = (ListData)_listMap.get(new Integer(listID)); ListData lst = (ListData)_listMap.get(new Integer(listID));
ListLevel lvl = lst.getLevels()[level]; if(level < lst.numLevels()) {
return lvl; ListLevel lvl = lst.getLevels()[level];
return lvl;
} else {
log.log(POILogger.WARN, "Requested level " + level + " which was greater than the maximum defined (" + lst.numLevels() + ")");
return null;
}
} }
public ListData getListData(int listID) public ListData getListData(int listID)