poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From max...@apache.org
Subject svn commit: r1064110 - in /poi/trunk/src/scratchpad/src/org/apache/poi/hwpf: model/ListTables.java usermodel/ListEntry.java
Date Thu, 27 Jan 2011 12:42:13 GMT
Author: maxcom
Date: Thu Jan 27 12:42:12 2011
New Revision: 1064110

URL: http://svn.apache.org/viewvc?rev=1064110&view=rev
Log:
hwpf: ignore incorrect ListFormatOverride reference that causes IndexOutOfBoundException

Modified:
    poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/ListTables.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/ListEntry.java

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/ListTables.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/ListTables.java?rev=1064110&r1=1064109&r2=1064110&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/ListTables.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/ListTables.java Thu Jan 27 12:42:12
2011
@@ -165,6 +165,10 @@ public final class ListTables
     return _overrideList.get(lfoIndex - 1);
   }
 
+  public int getOverrideCount() {
+    return _overrideList.size();
+  }
+
   public int getOverrideIndexFromListID(int lstid)
   {
     int returnVal = -1;

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/ListEntry.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/ListEntry.java?rev=1064110&r1=1064109&r2=1064110&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/ListEntry.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/ListEntry.java Thu Jan 27 12:42:12
2011
@@ -37,7 +37,7 @@ public final class ListEntry
   {
     super(papx, parent);
 
-    if(tables != null) {
+    if(tables != null && _props.getIlfo() < tables.getOverrideCount()) {
 	    ListFormatOverride override = tables.getOverride(_props.getIlfo());
 	    _overrideLevel = override.getOverrideLevel(_props.getIlvl());
 	    _level = tables.getLevel(override.getLsid(), _props.getIlvl());



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org


Mime
View raw message