diff options
Diffstat (limited to 'poi-scratchpad')
-rw-r--r-- | poi-scratchpad/src/main/java/org/apache/poi/hwpf/converter/AbstractWordUtils.java | 2 | ||||
-rw-r--r-- | poi-scratchpad/src/main/java/org/apache/poi/hwpf/usermodel/HWPFList.java | 21 |
2 files changed, 20 insertions, 3 deletions
diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/converter/AbstractWordUtils.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/converter/AbstractWordUtils.java index 9aaa892017..048a288d61 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/converter/AbstractWordUtils.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/converter/AbstractWordUtils.java @@ -228,7 +228,7 @@ public class AbstractWordUtils final String key = lsid + "#" + ( (int) element ); int num; - if ( !list.isStartAtOverriden( element ) + if ( !list.isStartAtOverridden( element ) && numberingState.levels.containsKey( key ) ) { num = numberingState.levels.get( key ); diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/usermodel/HWPFList.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/usermodel/HWPFList.java index 8a2d6d1ba4..0ba89ec9fa 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/usermodel/HWPFList.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/usermodel/HWPFList.java @@ -29,6 +29,7 @@ import org.apache.poi.hwpf.model.ListLevel; import org.apache.poi.hwpf.model.StyleSheet; import org.apache.poi.hwpf.sprm.CharacterSprmCompressor; import org.apache.poi.hwpf.sprm.ParagraphSprmCompressor; +import org.apache.poi.util.Removal; /** * This class is used to create a list in a Word document. It is used in @@ -157,7 +158,7 @@ public final class HWPFList public int getStartAt( char level ) { - if ( isStartAtOverriden( level ) ) + if ( isStartAtOverridden( level ) ) { return _lfoData.getRgLfoLvl()[level].getIStartAt(); } @@ -178,7 +179,23 @@ public final class HWPFList return _ignoreLogicalLeftIdentation; } - public boolean isStartAtOverriden( char level ) + /** + * @since POI 5.2.4 + */ + public boolean isStartAtOverridden(char level ) + { + ListFormatOverrideLevel lfolvl = _lfoData.getRgLfoLvl().length > level ? _lfoData + .getRgLfoLvl()[level] : null; + + return lfolvl != null && lfolvl.getIStartAt() != 0 + && !lfolvl.isFormatting(); + } + + /** + * @deprecated use {@link #isStartAtOverridden(char)} + */ + @Removal(version = "POI 6.0.0") + public boolean isStartAtOverriden(char level ) { ListFormatOverrideLevel lfolvl = _lfoData.getRgLfoLvl().length > level ? _lfoData .getRgLfoLvl()[level] : null; |