diff options
author | Sergey Vladimirov <sergey@apache.org> | 2012-09-23 13:34:46 +0000 |
---|---|---|
committer | Sergey Vladimirov <sergey@apache.org> | 2012-09-23 13:34:46 +0000 |
commit | 5ee2ce9546b205bfb52026a2c9a1eab3dbd8669d (patch) | |
tree | cc4e1fdecf3fdc542e36fc6690362208ebc5e134 /src/scratchpad | |
parent | 725269f178006fae9f017d9e2fa4106d805b1181 (diff) | |
download | poi-5ee2ce9546b205bfb52026a2c9a1eab3dbd8669d.tar.gz poi-5ee2ce9546b205bfb52026a2c9a1eab3dbd8669d.zip |
add safe path for documents with missing list information
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1389056 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/scratchpad')
-rw-r--r-- | src/scratchpad/src/org/apache/poi/hwpf/converter/AbstractWordConverter.java | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/src/scratchpad/src/org/apache/poi/hwpf/converter/AbstractWordConverter.java b/src/scratchpad/src/org/apache/poi/hwpf/converter/AbstractWordConverter.java index a27eec046a..819e681912 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/converter/AbstractWordConverter.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/converter/AbstractWordConverter.java @@ -167,11 +167,12 @@ public abstract class AbstractWordConverter } structures.add( structure ); } - private final Set<Bookmark> bookmarkStack = new LinkedHashSet<Bookmark>(); private FontReplacer fontReplacer = new DefaultFontReplacer(); + private POILogger log = POILogFactory.getLogger( getClass() ); + private NumberingState numberingState = new NumberingState(); private PicturesManager picturesManager; @@ -1053,17 +1054,31 @@ public abstract class AbstractWordConverter processPageBreak( wordDocument, flow ); } + boolean processed = false; if ( paragraph.isInList() ) { - HWPFList hwpfList = paragraph.getList(); + try + { + HWPFList hwpfList = paragraph.getList(); - String label = AbstractWordUtils.getBulletText( numberingState, - hwpfList, (char) paragraph.getIlvl() ); + String label = AbstractWordUtils.getBulletText( + numberingState, hwpfList, + (char) paragraph.getIlvl() ); - processParagraph( wordDocument, flow, currentTableLevel, - paragraph, label ); + processParagraph( wordDocument, flow, currentTableLevel, + paragraph, label ); + processed = true; + } + catch ( Exception exc ) + { + log.log( + POILogger.WARN, + "Can't process paragraph as list entry, will be processed without list information", + exc ); + } } - else + + if ( processed == false ) { processParagraph( wordDocument, flow, currentTableLevel, paragraph, AbstractWordUtils.EMPTY ); |