You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by ni...@apache.org on 2010/05/25 19:13:52 UTC
svn commit: r948116 -
/poi/trunk/src/ooxml/java/org/apache/poi/xwpf/extractor/XWPFWordExtractor.java
Author: nick
Date: Tue May 25 17:13:52 2010
New Revision: 948116
URL: http://svn.apache.org/viewvc?rev=948116&view=rev
Log:
Get to a consistent indent
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=948116&r1=948115&r2=948116&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 Tue May 25 17:13:52 2010
@@ -76,75 +76,73 @@ public class XWPFWordExtractor extends P
XWPFHeaderFooterPolicy hfPolicy = document.getHeaderFooterPolicy();
// Start out with all headers
- extractHeaders(text, hfPolicy);
+ extractHeaders(text, hfPolicy);
// First up, all our paragraph based text
Iterator<XWPFParagraph> i = document.getParagraphsIterator();
while(i.hasNext()) {
- XWPFParagraph paragraph = i.next();
+ XWPFParagraph paragraph = i.next();
-
- try {
- CTSectPr ctSectPr = null;
- if (paragraph.getCTP().getPPr()!=null) {
- ctSectPr = paragraph.getCTP().getPPr().getSectPr();
- }
-
- XWPFHeaderFooterPolicy headerFooterPolicy = null;
-
- if (ctSectPr!=null) {
- headerFooterPolicy = new XWPFHeaderFooterPolicy(document, ctSectPr);
-
- extractHeaders(text, headerFooterPolicy);
- }
-
- XWPFParagraphDecorator decorator = new XWPFCommentsDecorator(
- new XWPFHyperlinkDecorator(paragraph, null, fetchHyperlinks));
- text.append(decorator.getText()).append('\n');
-
- if (ctSectPr!=null) {
- extractFooters(text, headerFooterPolicy);
- }
- } catch (IOException e) {
- throw new POIXMLException(e);
- } catch (XmlException e) {
- throw new POIXMLException(e);
- }
- }
+ try {
+ CTSectPr ctSectPr = null;
+ if (paragraph.getCTP().getPPr()!=null) {
+ ctSectPr = paragraph.getCTP().getPPr().getSectPr();
+ }
+
+ XWPFHeaderFooterPolicy headerFooterPolicy = null;
+
+ if (ctSectPr!=null) {
+ headerFooterPolicy = new XWPFHeaderFooterPolicy(document, ctSectPr);
+ extractHeaders(text, headerFooterPolicy);
+ }
+
+ XWPFParagraphDecorator decorator = new XWPFCommentsDecorator(
+ new XWPFHyperlinkDecorator(paragraph, null, fetchHyperlinks));
+ text.append(decorator.getText()).append('\n');
+
+ if (ctSectPr!=null) {
+ extractFooters(text, headerFooterPolicy);
+ }
+ } catch (IOException e) {
+ throw new POIXMLException(e);
+ } catch (XmlException e) {
+ throw new POIXMLException(e);
+ }
+ }
// Then our table based text
Iterator<XWPFTable> j = document.getTablesIterator();
while(j.hasNext()) {
- text.append(j.next().getText()).append('\n');
+ text.append(j.next().getText()).append('\n');
}
// Finish up with all the footers
- extractFooters(text, hfPolicy);
+ extractFooters(text, hfPolicy);
return text.toString();
}
- private void extractFooters(StringBuffer text, XWPFHeaderFooterPolicy hfPolicy) {
- if(hfPolicy.getFirstPageFooter() != null) {
- text.append( hfPolicy.getFirstPageFooter().getText() );
- }
- if(hfPolicy.getEvenPageFooter() != null) {
- text.append( hfPolicy.getEvenPageFooter().getText() );
- }
- if(hfPolicy.getDefaultFooter() != null) {
- text.append( hfPolicy.getDefaultFooter().getText() );
- }
- }
-
- private void extractHeaders(StringBuffer text, XWPFHeaderFooterPolicy hfPolicy) {
- if(hfPolicy.getFirstPageHeader() != null) {
- text.append( hfPolicy.getFirstPageHeader().getText() );
- }
- if(hfPolicy.getEvenPageHeader() != null) {
- text.append( hfPolicy.getEvenPageHeader().getText() );
- }
- if(hfPolicy.getDefaultHeader() != null) {
- text.append( hfPolicy.getDefaultHeader().getText() );
- }
- }
+ private void extractFooters(StringBuffer text, XWPFHeaderFooterPolicy hfPolicy) {
+ if(hfPolicy.getFirstPageFooter() != null) {
+ text.append( hfPolicy.getFirstPageFooter().getText() );
+ }
+ if(hfPolicy.getEvenPageFooter() != null) {
+ text.append( hfPolicy.getEvenPageFooter().getText() );
+ }
+ if(hfPolicy.getDefaultFooter() != null) {
+ text.append( hfPolicy.getDefaultFooter().getText() );
+ }
+ }
+
+ private void extractHeaders(StringBuffer text, XWPFHeaderFooterPolicy hfPolicy) {
+ if(hfPolicy.getFirstPageHeader() != null) {
+ text.append( hfPolicy.getFirstPageHeader().getText() );
+ }
+ if(hfPolicy.getEvenPageHeader() != null) {
+ text.append( hfPolicy.getEvenPageHeader().getText() );
+ }
+ if(hfPolicy.getDefaultHeader() != null) {
+ text.append( hfPolicy.getDefaultHeader().getText() );
+ }
+ }
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org