Return-Path: X-Original-To: apmail-poi-commits-archive@minotaur.apache.org Delivered-To: apmail-poi-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id CEF591838A for ; Thu, 13 Aug 2015 20:31:26 +0000 (UTC) Received: (qmail 93125 invoked by uid 500); 13 Aug 2015 20:31:26 -0000 Delivered-To: apmail-poi-commits-archive@poi.apache.org Received: (qmail 93085 invoked by uid 500); 13 Aug 2015 20:31:26 -0000 Mailing-List: contact commits-help@poi.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@poi.apache.org Delivered-To: mailing list commits@poi.apache.org Received: (qmail 93076 invoked by uid 99); 13 Aug 2015 20:31:26 -0000 Received: from eris.apache.org (HELO hades.apache.org) (140.211.11.105) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 13 Aug 2015 20:31:26 +0000 Received: from hades.apache.org (localhost [127.0.0.1]) by hades.apache.org (ASF Mail Server at hades.apache.org) with ESMTP id 42BA7AC08A7 for ; Thu, 13 Aug 2015 20:31:26 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1695775 - /poi/trunk/src/ooxml/java/org/apache/poi/xwpf/extractor/XWPFWordExtractor.java Date: Thu, 13 Aug 2015 20:31:26 -0000 To: commits@poi.apache.org From: nick@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20150813203126.42BA7AC08A7@hades.apache.org> Author: nick Date: Thu Aug 13 20:31:25 2015 New Revision: 1695775 URL: http://svn.apache.org/r1695775 Log: Remove catches which were previously incorrectly declared when not needed Modified: poi/trunk/src/ooxml/java/org/apache/poi/xwpf/extractor/XWPFWordExtractor.java Modified: poi/trunk/src/ooxml/java/org/apache/poi/xwpf/extractor/XWPFWordExtractor.java URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xwpf/extractor/XWPFWordExtractor.java?rev=1695775&r1=1695774&r2=1695775&view=diff ============================================================================== --- poi/trunk/src/ooxml/java/org/apache/poi/xwpf/extractor/XWPFWordExtractor.java (original) +++ poi/trunk/src/ooxml/java/org/apache/poi/xwpf/extractor/XWPFWordExtractor.java Thu Aug 13 20:31:25 2015 @@ -20,7 +20,6 @@ import java.io.IOException; import java.util.List; import org.apache.poi.POIXMLDocument; -import org.apache.poi.POIXMLException; import org.apache.poi.POIXMLTextExtractor; import org.apache.poi.openxml4j.exceptions.OpenXML4JException; import org.apache.poi.openxml4j.opc.OPCPackage; @@ -117,51 +116,44 @@ public class XWPFWordExtractor extends P } public void appendParagraphText(StringBuffer text, XWPFParagraph paragraph) { - try { - CTSectPr ctSectPr = null; - if (paragraph.getCTP().getPPr() != null) { - ctSectPr = paragraph.getCTP().getPPr().getSectPr(); - } - - XWPFHeaderFooterPolicy headerFooterPolicy = null; + CTSectPr ctSectPr = null; + if (paragraph.getCTP().getPPr() != null) { + ctSectPr = paragraph.getCTP().getPPr().getSectPr(); + } - if (ctSectPr != null) { - headerFooterPolicy = new XWPFHeaderFooterPolicy(document, ctSectPr); - extractHeaders(text, headerFooterPolicy); - } + XWPFHeaderFooterPolicy headerFooterPolicy = null; + if (ctSectPr != null) { + headerFooterPolicy = new XWPFHeaderFooterPolicy(document, ctSectPr); + extractHeaders(text, headerFooterPolicy); + } - for (IRunElement run : paragraph.getRuns()) { - text.append(run.toString()); - if (run instanceof XWPFHyperlinkRun && fetchHyperlinks) { - XWPFHyperlink link = ((XWPFHyperlinkRun) run).getHyperlink(document); - if (link != null) - text.append(" <" + link.getURL() + ">"); - } - } - // Add comments - XWPFCommentsDecorator decorator = new XWPFCommentsDecorator(paragraph, null); - String commentText = decorator.getCommentText(); - if (commentText.length() > 0) { - text.append(commentText).append('\n'); + for (IRunElement run : paragraph.getRuns()) { + text.append(run.toString()); + if (run instanceof XWPFHyperlinkRun && fetchHyperlinks) { + XWPFHyperlink link = ((XWPFHyperlinkRun) run).getHyperlink(document); + if (link != null) + text.append(" <" + link.getURL() + ">"); } + } - // Do endnotes and footnotes - String footnameText = paragraph.getFootnoteText(); - if (footnameText != null && footnameText.length() > 0) { - text.append(footnameText + '\n'); - } + // Add comments + XWPFCommentsDecorator decorator = new XWPFCommentsDecorator(paragraph, null); + String commentText = decorator.getCommentText(); + if (commentText.length() > 0) { + text.append(commentText).append('\n'); + } - if (ctSectPr != null) { - extractFooters(text, headerFooterPolicy); - } - } catch (IOException e) { - throw new POIXMLException(e); - } catch (XmlException e) { - throw new POIXMLException(e); + // Do endnotes and footnotes + String footnameText = paragraph.getFootnoteText(); + if (footnameText != null && footnameText.length() > 0) { + text.append(footnameText + '\n'); } + if (ctSectPr != null) { + extractFooters(text, headerFooterPolicy); + } } private void appendTableText(StringBuffer text, XWPFTable table) { --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org For additional commands, e-mail: commits-help@poi.apache.org