poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From talli...@apache.org
Subject svn commit: r1682473 [1/8] - in /poi/trunk/src/ooxml: java/org/apache/poi/util/ java/org/apache/poi/xwpf/ java/org/apache/poi/xwpf/extractor/ java/org/apache/poi/xwpf/model/ java/org/apache/poi/xwpf/usermodel/ testcases/org/apache/poi/xwpf/ testcases/o...
Date Fri, 29 May 2015 14:01:33 GMT
Author: tallison
Date: Fri May 29 14:01:31 2015
New Revision: 1682473

URL: http://svn.apache.org/r1682473
Log:
POI-57975: clean up white spaces and other style issues in XWPF

Modified:
    poi/trunk/src/ooxml/java/org/apache/poi/util/OOXMLLite.java
    poi/trunk/src/ooxml/java/org/apache/poi/xwpf/extractor/XWPFWordExtractor.java
    poi/trunk/src/ooxml/java/org/apache/poi/xwpf/model/XMLParagraph.java
    poi/trunk/src/ooxml/java/org/apache/poi/xwpf/model/XWPFCommentsDecorator.java
    poi/trunk/src/ooxml/java/org/apache/poi/xwpf/model/XWPFHeaderFooterPolicy.java
    poi/trunk/src/ooxml/java/org/apache/poi/xwpf/model/XWPFHyperlinkDecorator.java
    poi/trunk/src/ooxml/java/org/apache/poi/xwpf/model/XWPFParagraphDecorator.java
    poi/trunk/src/ooxml/java/org/apache/poi/xwpf/package.html
    poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/AbstractXWPFSDT.java
    poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/BodyElementType.java
    poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/Borders.java
    poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/BreakClear.java
    poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/BreakType.java
    poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/Document.java
    poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/IBody.java
    poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/IBodyElement.java
    poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/ICell.java
    poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/IRunBody.java
    poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/IRunElement.java
    poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/ISDTContent.java
    poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/ISDTContents.java
    poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/LineSpacingRule.java
    poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/ParagraphAlignment.java
    poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/PositionInParagraph.java
    poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/TOC.java
    poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/TextAlignment.java
    poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/TextSegement.java
    poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/UnderlinePatterns.java
    poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/VerticalAlign.java
    poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFAbstractNum.java
    poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFComment.java
    poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFDefaultParagraphStyle.java
    poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFDefaultRunStyle.java
    poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFDocument.java
    poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFFactory.java
    poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFFooter.java
    poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFFootnote.java
    poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFFootnotes.java
    poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFHeader.java
    poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFHeaderFooter.java
    poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFHyperlink.java
    poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFHyperlinkRun.java
    poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFLatentStyles.java
    poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFNum.java
    poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFNumbering.java
    poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFParagraph.java
    poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFPicture.java
    poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFPictureData.java
    poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFRelation.java
    poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFRun.java
    poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFSDT.java
    poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFSDTCell.java
    poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFSDTContent.java
    poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFSDTContentCell.java
    poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFSettings.java
    poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFStyle.java
    poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFStyles.java
    poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFTable.java
    poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFTableCell.java
    poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFTableRow.java
    poi/trunk/src/ooxml/testcases/org/apache/poi/xwpf/AllXWPFTests.java
    poi/trunk/src/ooxml/testcases/org/apache/poi/xwpf/TestAllExtendedProperties.java
    poi/trunk/src/ooxml/testcases/org/apache/poi/xwpf/TestPackageCorePropertiesGetKeywords.java
    poi/trunk/src/ooxml/testcases/org/apache/poi/xwpf/TestXWPFBugs.java
    poi/trunk/src/ooxml/testcases/org/apache/poi/xwpf/extractor/TestExternalEntities.java
    poi/trunk/src/ooxml/testcases/org/apache/poi/xwpf/extractor/TestXWPFWordExtractor.java
    poi/trunk/src/ooxml/testcases/org/apache/poi/xwpf/model/TestXWPFDecorators.java
    poi/trunk/src/ooxml/testcases/org/apache/poi/xwpf/model/TestXWPFHeaderFooterPolicy.java
    poi/trunk/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestChangeTracking.java
    poi/trunk/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFBugs.java
    poi/trunk/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFDocument.java
    poi/trunk/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFFootnotes.java
    poi/trunk/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFHeader.java
    poi/trunk/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFHeadings.java
    poi/trunk/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFNumbering.java
    poi/trunk/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFParagraph.java
    poi/trunk/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFPictureData.java
    poi/trunk/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFRun.java
    poi/trunk/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFSDT.java
    poi/trunk/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFSmartTag.java
    poi/trunk/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFStyles.java
    poi/trunk/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFTable.java
    poi/trunk/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFTableCell.java
    poi/trunk/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFTableRow.java

Modified: poi/trunk/src/ooxml/java/org/apache/poi/util/OOXMLLite.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/util/OOXMLLite.java?rev=1682473&r1=1682472&r2=1682473&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/util/OOXMLLite.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/util/OOXMLLite.java Fri May 29 14:01:31 2015
@@ -32,14 +32,12 @@ import java.util.Map;
 import java.util.Vector;
 import java.util.jar.JarEntry;
 import java.util.jar.JarFile;
-import java.util.regex.Pattern;
-
-import junit.framework.TestCase;
-
-import org.junit.Test;
-import org.junit.internal.TextListener;
-import org.junit.runner.JUnitCore;
-import org.junit.runner.Result;
+import java.util.regex.Pattern;
+
+import junit.framework.TestCase;
+import org.junit.Test;
+import org.junit.internal.TextListener;
+import org.junit.runner.JUnitCore;import org.junit.runner.Result;
 
 /**
  * Build a 'lite' version of the ooxml-schemas.jar

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=1682473&r1=1682472&r2=1682473&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 Fri May 29 14:01:31 2015
@@ -46,46 +46,47 @@ import org.openxmlformats.schemas.wordpr
  * Helper class to extract text from an OOXML Word file
  */
 public class XWPFWordExtractor extends POIXMLTextExtractor {
-   public static final XWPFRelation[] SUPPORTED_TYPES = new XWPFRelation[] {
-      XWPFRelation.DOCUMENT, XWPFRelation.TEMPLATE,
-      XWPFRelation.MACRO_DOCUMENT, 
-      XWPFRelation.MACRO_TEMPLATE_DOCUMENT
-   };
-   
-	private XWPFDocument document;
-	private boolean fetchHyperlinks = false;
-	
-	public XWPFWordExtractor(OPCPackage container) throws XmlException, OpenXML4JException, IOException {
-		this(new XWPFDocument(container));
-	}
-	public XWPFWordExtractor(XWPFDocument document) {
-		super(document);
-		this.document = document;
-	}
-
-	/**
-	 * Should we also fetch the hyperlinks, when fetching 
-	 *  the text content? Default is to only output the
-	 *  hyperlink label, and not the contents
-	 */
-	public void setFetchHyperlinks(boolean fetch) {
-		fetchHyperlinks = fetch;
-	}
-	
-	public static void main(String[] args) throws Exception {
-		if(args.length < 1) {
-			System.err.println("Use:");
-			System.err.println("  XWPFWordExtractor <filename.docx>");
-			System.exit(1);
-		}
-		POIXMLTextExtractor extractor = 
-			new XWPFWordExtractor(POIXMLDocument.openPackage(
-					args[0]
-			));
-		System.out.println(extractor.getText());
-		extractor.close();
-	}
-	
+    public static final XWPFRelation[] SUPPORTED_TYPES = new XWPFRelation[]{
+            XWPFRelation.DOCUMENT, XWPFRelation.TEMPLATE,
+            XWPFRelation.MACRO_DOCUMENT,
+            XWPFRelation.MACRO_TEMPLATE_DOCUMENT
+    };
+
+    private XWPFDocument document;
+    private boolean fetchHyperlinks = false;
+
+    public XWPFWordExtractor(OPCPackage container) throws XmlException, OpenXML4JException, IOException {
+        this(new XWPFDocument(container));
+    }
+
+    public XWPFWordExtractor(XWPFDocument document) {
+        super(document);
+        this.document = document;
+    }
+
+    public static void main(String[] args) throws Exception {
+        if (args.length < 1) {
+            System.err.println("Use:");
+            System.err.println("  XWPFWordExtractor <filename.docx>");
+            System.exit(1);
+        }
+        POIXMLTextExtractor extractor =
+                new XWPFWordExtractor(POIXMLDocument.openPackage(
+                        args[0]
+                ));
+        System.out.println(extractor.getText());
+        extractor.close();
+    }
+
+    /**
+     * Should we also fetch the hyperlinks, when fetching
+     * the text content? Default is to only output the
+     * hyperlink label, and not the contents
+     */
+    public void setFetchHyperlinks(boolean fetch) {
+        fetchHyperlinks = fetch;
+    }
+
     public String getText() {
         StringBuffer text = new StringBuffer();
         XWPFHeaderFooterPolicy hfPolicy = document.getHeaderFooterPolicy();
@@ -94,9 +95,9 @@ public class XWPFWordExtractor extends P
         extractHeaders(text, hfPolicy);
 
         // Process all body elements
-        for (IBodyElement e : document.getBodyElements()){
-        	appendBodyElementText(text, e);
-        	text.append('\n');
+        for (IBodyElement e : document.getBodyElements()) {
+            appendBodyElementText(text, e);
+            text.append('\n');
         }
 
         // Finish up with all the footers
@@ -105,108 +106,108 @@ public class XWPFWordExtractor extends P
         return text.toString();
     }
 
-   public void appendBodyElementText(StringBuffer text, IBodyElement e){
-      if (e instanceof XWPFParagraph){
-          appendParagraphText(text, (XWPFParagraph)e);
-      } else if (e instanceof XWPFTable){
-          appendTableText(text, (XWPFTable)e);
-      } else if (e instanceof XWPFSDT){
-          text.append(((XWPFSDT)e).getContent().getText());
-      }
-   }
-   
-   public void appendParagraphText(StringBuffer text, XWPFParagraph paragraph){
-      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);
-          }
-
-
-          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');
-          }
-
-          // Do endnotes and footnotes
-          String footnameText = paragraph.getFootnoteText();
-          if(footnameText != null && footnameText.length() > 0) {
-              text.append(footnameText + '\n');
-          }
-
-          if (ctSectPr!=null) {
-              extractFooters(text, headerFooterPolicy);
-          }
-      } catch (IOException e) {
-          throw new POIXMLException(e);
-      } catch (XmlException e) {
-          throw new POIXMLException(e);
-      }
-     
-   }
-
-   private void appendTableText(StringBuffer text, XWPFTable table) {
-      //this works recursively to pull embedded tables from tables
-      for (XWPFTableRow row : table.getRows()) {
-          List<ICell> cells = row.getTableICells();
-          for (int i = 0; i < cells.size(); i++) {
-              ICell cell = cells.get(i);
-              if (cell instanceof XWPFTableCell) {
-                  text.append(((XWPFTableCell)cell).getTextRecursively());
-              } else if (cell instanceof XWPFSDTCell) {
-                  text.append(((XWPFSDTCell)cell).getContent().getText());
-              }
-              if (i < cells.size()-1) {
-                  text.append("\t");
-              }
-          }
-          text.append('\n');
-      }
-   }
-   
-	private void extractFooters(StringBuffer text, XWPFHeaderFooterPolicy hfPolicy) {
-		if (hfPolicy == null) return;
-		
-		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 == null) return;
-		
-		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() );
-		}
-	}
+    public void appendBodyElementText(StringBuffer text, IBodyElement e) {
+        if (e instanceof XWPFParagraph) {
+            appendParagraphText(text, (XWPFParagraph) e);
+        } else if (e instanceof XWPFTable) {
+            appendTableText(text, (XWPFTable) e);
+        } else if (e instanceof XWPFSDT) {
+            text.append(((XWPFSDT) e).getContent().getText());
+        }
+    }
+
+    public void appendParagraphText(StringBuffer text, XWPFParagraph paragraph) {
+        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);
+            }
+
+
+            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');
+            }
+
+            // Do endnotes and footnotes
+            String footnameText = paragraph.getFootnoteText();
+            if (footnameText != null && footnameText.length() > 0) {
+                text.append(footnameText + '\n');
+            }
+
+            if (ctSectPr != null) {
+                extractFooters(text, headerFooterPolicy);
+            }
+        } catch (IOException e) {
+            throw new POIXMLException(e);
+        } catch (XmlException e) {
+            throw new POIXMLException(e);
+        }
+
+    }
+
+    private void appendTableText(StringBuffer text, XWPFTable table) {
+        //this works recursively to pull embedded tables from tables
+        for (XWPFTableRow row : table.getRows()) {
+            List<ICell> cells = row.getTableICells();
+            for (int i = 0; i < cells.size(); i++) {
+                ICell cell = cells.get(i);
+                if (cell instanceof XWPFTableCell) {
+                    text.append(((XWPFTableCell) cell).getTextRecursively());
+                } else if (cell instanceof XWPFSDTCell) {
+                    text.append(((XWPFSDTCell) cell).getContent().getText());
+                }
+                if (i < cells.size() - 1) {
+                    text.append("\t");
+                }
+            }
+            text.append('\n');
+        }
+    }
+
+    private void extractFooters(StringBuffer text, XWPFHeaderFooterPolicy hfPolicy) {
+        if (hfPolicy == null) return;
+
+        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 == null) return;
+
+        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());
+        }
+    }
 }

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xwpf/model/XMLParagraph.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xwpf/model/XMLParagraph.java?rev=1682473&r1=1682472&r2=1682473&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xwpf/model/XMLParagraph.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xwpf/model/XMLParagraph.java Fri May 29 14:01:31 2015
@@ -22,16 +22,15 @@ import org.openxmlformats.schemas.wordpr
  * Base class for XWPF paragraphs
  *
  * @author Yury Batrakov (batrakov at gmail.com)
- * 
  */
 public class XMLParagraph {
-	protected CTP paragraph;
-	
-	public XMLParagraph(CTP paragraph) {
-		this.paragraph = paragraph;
-	}
+    protected CTP paragraph;
 
-	public CTP getCTP() {
-		return paragraph;
-	}
+    public XMLParagraph(CTP paragraph) {
+        this.paragraph = paragraph;
+    }
+
+    public CTP getCTP() {
+        return paragraph;
+    }
 }
\ No newline at end of file

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xwpf/model/XWPFCommentsDecorator.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xwpf/model/XWPFCommentsDecorator.java?rev=1682473&r1=1682472&r2=1682473&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xwpf/model/XWPFCommentsDecorator.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xwpf/model/XWPFCommentsDecorator.java Fri May 29 14:01:31 2015
@@ -21,38 +21,36 @@ import org.apache.poi.xwpf.usermodel.XWP
 import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTMarkupRange;
 
 /**
- * Decorator class for XWPFParagraph allowing to add comments 
+ * Decorator class for XWPFParagraph allowing to add comments
  * found in paragraph to its text
  *
  * @author Yury Batrakov (batrakov at gmail.com)
- * 
  */
 public class XWPFCommentsDecorator extends XWPFParagraphDecorator {
-	private StringBuffer commentText;
-	
-	public XWPFCommentsDecorator(XWPFParagraphDecorator nextDecorator) {
-		this(nextDecorator.paragraph, nextDecorator);
-	}
-
-	@SuppressWarnings("deprecation")
-	public XWPFCommentsDecorator(XWPFParagraph paragraph, XWPFParagraphDecorator nextDecorator) {
-		super(paragraph, nextDecorator);
-
-		XWPFComment comment;
-		commentText = new StringBuffer();
-
-		for(CTMarkupRange anchor : paragraph.getCTP().getCommentRangeStartArray())
-		{
-			if((comment = paragraph.getDocument().getCommentByID(anchor.getId().toString())) != null)
-				commentText.append("\tComment by " + comment.getAuthor()+": "+comment.getText());
-		}
-	}
-
-	public String getCommentText() {
-	   return commentText.toString();
-	}
-	
-	public String getText() {
-		return super.getText() + commentText;
-	}
+    private StringBuffer commentText;
+
+    public XWPFCommentsDecorator(XWPFParagraphDecorator nextDecorator) {
+        this(nextDecorator.paragraph, nextDecorator);
+    }
+
+    @SuppressWarnings("deprecation")
+    public XWPFCommentsDecorator(XWPFParagraph paragraph, XWPFParagraphDecorator nextDecorator) {
+        super(paragraph, nextDecorator);
+
+        XWPFComment comment;
+        commentText = new StringBuffer();
+
+        for (CTMarkupRange anchor : paragraph.getCTP().getCommentRangeStartArray()) {
+            if ((comment = paragraph.getDocument().getCommentByID(anchor.getId().toString())) != null)
+                commentText.append("\tComment by " + comment.getAuthor() + ": " + comment.getText());
+        }
+    }
+
+    public String getCommentText() {
+        return commentText.toString();
+    }
+
+    public String getText() {
+        return super.getText() + commentText;
+    }
 }

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xwpf/model/XWPFHeaderFooterPolicy.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xwpf/model/XWPFHeaderFooterPolicy.java?rev=1682473&r1=1682472&r2=1682473&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xwpf/model/XWPFHeaderFooterPolicy.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xwpf/model/XWPFHeaderFooterPolicy.java Fri May 29 14:01:31 2015
@@ -45,7 +45,6 @@ import org.openxmlformats.schemas.wordpr
 import org.openxmlformats.schemas.wordprocessingml.x2006.main.HdrDocument;
 import org.openxmlformats.schemas.wordprocessingml.x2006.main.STHdrFtr;
 import org.openxmlformats.schemas.wordprocessingml.x2006.main.STHdrFtr.Enum;
-
 import schemasMicrosoftComOfficeOffice.CTLock;
 import schemasMicrosoftComOfficeOffice.STConnectType;
 import schemasMicrosoftComVml.CTFormulas;
@@ -61,10 +60,10 @@ import schemasMicrosoftComVml.STTrueFals
 
 /**
  * A .docx file can have no headers/footers, the same header/footer
- *  on each page, odd/even page footers, and optionally also 
- *  a different header/footer on the first page.
+ * on each page, odd/even page footers, and optionally also
+ * a different header/footer on the first page.
  * This class handles sorting out what there is, and giving you
- *  the right headers and footers for the document.
+ * the right headers and footers for the document.
  */
 public class XWPFHeaderFooterPolicy {
     public static final Enum DEFAULT = STHdrFtr.DEFAULT;
@@ -84,8 +83,8 @@ public class XWPFHeaderFooterPolicy {
 
     /**
      * Figures out the policy for the given document,
-     *  and creates any header and footer objects
-     *  as required.
+     * and creates any header and footer objects
+     * as required.
      */
     public XWPFHeaderFooterPolicy(XWPFDocument doc) throws IOException, XmlException {
         this(doc, doc.getDocument().getBody().getSectPr());
@@ -93,8 +92,8 @@ public class XWPFHeaderFooterPolicy {
 
     /**
      * Figures out the policy for the given document,
-     *  and creates any header and footer objects
-     *  as required.
+     * and creates any header and footer objects
+     * as required.
      */
     public XWPFHeaderFooterPolicy(XWPFDocument doc, CTSectPr sectPr) throws IOException, XmlException {
         // Grab what headers and footers have been defined
@@ -102,7 +101,7 @@ public class XWPFHeaderFooterPolicy {
         //  doesn't seem that .docx properly supports that
         //  feature of the file format yet
         this.doc = doc;
-        for(int i=0; i<sectPr.sizeOfHeaderReferenceArray(); i++) {
+        for (int i = 0; i < sectPr.sizeOfHeaderReferenceArray(); i++) {
             // Get the header
             CTHdrFtrRef ref = sectPr.getHeaderReferenceArray(i);
             POIXMLDocumentPart relatedPart = doc.getRelationById(ref.getId());
@@ -114,13 +113,12 @@ public class XWPFHeaderFooterPolicy {
             Enum type = ref.getType();
             assignHeader(hdr, type);
         }
-        for(int i=0; i<sectPr.sizeOfFooterReferenceArray(); i++) {
+        for (int i = 0; i < sectPr.sizeOfFooterReferenceArray(); i++) {
             // Get the footer
             CTHdrFtrRef ref = sectPr.getFooterReferenceArray(i);
             POIXMLDocumentPart relatedPart = doc.getRelationById(ref.getId());
             XWPFFooter ftr = null;
-            if (relatedPart != null && relatedPart instanceof XWPFFooter)
-            {
+            if (relatedPart != null && relatedPart instanceof XWPFFooter) {
                 ftr = (XWPFFooter) relatedPart;
             }
             // Assign it
@@ -130,9 +128,9 @@ public class XWPFHeaderFooterPolicy {
     }
 
     private void assignFooter(XWPFFooter ftr, Enum type) {
-        if(type == STHdrFtr.FIRST) {
+        if (type == STHdrFtr.FIRST) {
             firstPageFooter = ftr;
-        } else if(type == STHdrFtr.EVEN) {
+        } else if (type == STHdrFtr.EVEN) {
             evenPageFooter = ftr;
         } else {
             defaultFooter = ftr;
@@ -140,9 +138,9 @@ public class XWPFHeaderFooterPolicy {
     }
 
     private void assignHeader(XWPFHeader hdr, Enum type) {
-        if(type == STHdrFtr.FIRST) {
+        if (type == STHdrFtr.FIRST) {
             firstPageHeader = hdr;
-        } else if(type == STHdrFtr.EVEN) {
+        } else if (type == STHdrFtr.EVEN) {
             evenPageHeader = hdr;
         } else {
             defaultHeader = hdr;
@@ -159,15 +157,15 @@ public class XWPFHeaderFooterPolicy {
 
     /**
      * Creates a new header of the specified type, to which the
-     *  supplied (and previously unattached!) paragraphs are
-     *  added to.
+     * supplied (and previously unattached!) paragraphs are
+     * added to.
      */
     public XWPFHeader createHeader(Enum type, XWPFParagraph[] pars) throws IOException {
         XWPFRelation relation = XWPFRelation.HEADER;
         String pStyle = "Header";
         int i = getRelationIndex(relation);
         HdrDocument hdrDoc = HdrDocument.Factory.newInstance();
-        XWPFHeader wrapper = (XWPFHeader)doc.createRelationship(relation, XWPFFactory.getInstance(), i);
+        XWPFHeader wrapper = (XWPFHeader) doc.createRelationship(relation, XWPFFactory.getInstance(), i);
 
         CTHdrFtr hdr = buildHdr(type, pStyle, wrapper, pars);
         wrapper.setHeaderFooter(hdr);
@@ -193,15 +191,15 @@ public class XWPFHeaderFooterPolicy {
 
     /**
      * Creates a new footer of the specified type, to which the
-     *  supplied (and previously unattached!) paragraphs are
-     *  added to.
+     * supplied (and previously unattached!) paragraphs are
+     * added to.
      */
     public XWPFFooter createFooter(Enum type, XWPFParagraph[] pars) throws IOException {
         XWPFRelation relation = XWPFRelation.FOOTER;
         String pStyle = "Footer";
         int i = getRelationIndex(relation);
         FtrDocument ftrDoc = FtrDocument.Factory.newInstance();
-        XWPFFooter wrapper = (XWPFFooter)doc.createRelationship(relation, XWPFFactory.getInstance(), i);
+        XWPFFooter wrapper = (XWPFFooter) doc.createRelationship(relation, XWPFFactory.getInstance(), i);
 
         CTHdrFtr ftr = buildFtr(type, pStyle, wrapper, pars);
         wrapper.setHeaderFooter(ftr);
@@ -220,10 +218,10 @@ public class XWPFHeaderFooterPolicy {
     private int getRelationIndex(XWPFRelation relation) {
         List<POIXMLDocumentPart> relations = doc.getRelations();
         int i = 1;
-        for (Iterator<POIXMLDocumentPart> it = relations.iterator(); it.hasNext() ; ) {
+        for (Iterator<POIXMLDocumentPart> it = relations.iterator(); it.hasNext(); ) {
             POIXMLDocumentPart item = it.next();
             if (item.getPackageRelationship().getRelationshipType().equals(relation.getRelation())) {
-                i++;	
+                i++;
             }
         }
         return i;
@@ -231,14 +229,14 @@ public class XWPFHeaderFooterPolicy {
 
     private CTHdrFtr buildFtr(Enum type, String pStyle, XWPFHeaderFooter wrapper, XWPFParagraph[] pars) {
         //CTHdrFtr ftr = buildHdrFtr(pStyle, pars);				// MB 24 May 2010
-        CTHdrFtr ftr = buildHdrFtr(pStyle, pars, wrapper);		// MB 24 May 2010
+        CTHdrFtr ftr = buildHdrFtr(pStyle, pars, wrapper);        // MB 24 May 2010
         setFooterReference(type, wrapper);
         return ftr;
     }
 
     private CTHdrFtr buildHdr(Enum type, String pStyle, XWPFHeaderFooter wrapper, XWPFParagraph[] pars) {
         //CTHdrFtr hdr = buildHdrFtr(pStyle, pars);				// MB 24 May 2010
-        CTHdrFtr hdr = buildHdrFtr(pStyle, pars, wrapper);		// MB 24 May 2010
+        CTHdrFtr hdr = buildHdrFtr(pStyle, pars, wrapper);        // MB 24 May 2010
         setHeaderReference(type, wrapper);
         return hdr;
     }
@@ -246,13 +244,12 @@ public class XWPFHeaderFooterPolicy {
     private CTHdrFtr buildHdrFtr(String pStyle, XWPFParagraph[] paragraphs) {
         CTHdrFtr ftr = CTHdrFtr.Factory.newInstance();
         if (paragraphs != null) {
-            for (int i = 0 ; i < paragraphs.length ; i++) {
+            for (int i = 0; i < paragraphs.length; i++) {
                 CTP p = ftr.addNewP();
                 //ftr.setPArray(0, paragraphs[i].getCTP());		// MB 23 May 2010
-                ftr.setPArray(i, paragraphs[i].getCTP());   	// MB 23 May 2010
+                ftr.setPArray(i, paragraphs[i].getCTP());    // MB 23 May 2010
             }
-        }
-        else {
+        } else {
             CTP p = ftr.addNewP();
             byte[] rsidr = doc.getDocument().getBody().getPArray(0).getRsidR();
             byte[] rsidrdefault = doc.getDocument().getBody().getPArray(0).getRsidRDefault();
@@ -270,21 +267,20 @@ public class XWPFHeaderFooterPolicy {
      * and createFooter(int, XWPFParagraph[]) methods or the getXXXXXHeader/Footer methods where
      * headers or footers had been added to a document since it had been created/opened, returned
      * an object that contained no XWPFParagraph objects even if the header/footer itself did contain
-     * text. The reason was that this line of code; CTHdrFtr ftr = CTHdrFtr.Factory.newInstance(); 
+     * text. The reason was that this line of code; CTHdrFtr ftr = CTHdrFtr.Factory.newInstance();
      * created a brand new instance of the CTHDRFtr class which was then populated with data when
      * it should have recovered the CTHdrFtr object encapsulated within the XWPFHeaderFooter object
-     * that had previoulsy been instantiated in the createHeader(int, XWPFParagraph[]) or 
+     * that had previoulsy been instantiated in the createHeader(int, XWPFParagraph[]) or
      * createFooter(int, XWPFParagraph[]) methods.
      */
     private CTHdrFtr buildHdrFtr(String pStyle, XWPFParagraph[] paragraphs, XWPFHeaderFooter wrapper) {
         CTHdrFtr ftr = wrapper._getHdrFtr();
         if (paragraphs != null) {
-            for (int i = 0 ; i < paragraphs.length ; i++) {
+            for (int i = 0; i < paragraphs.length; i++) {
                 CTP p = ftr.addNewP();
                 ftr.setPArray(i, paragraphs[i].getCTP());
             }
-        }
-        else {
+        } else {
             CTP p = ftr.addNewP();
             byte[] rsidr = doc.getDocument().getBody().getPArray(0).getRsidR();
             byte[] rsidrdefault = doc.getDocument().getBody().getPArray(0).getRsidRDefault();
@@ -330,60 +326,70 @@ public class XWPFHeaderFooterPolicy {
     public XWPFHeader getFirstPageHeader() {
         return firstPageHeader;
     }
+
     public XWPFFooter getFirstPageFooter() {
         return firstPageFooter;
     }
+
     /**
      * Returns the odd page header. This is
-     *  also the same as the default one...
+     * also the same as the default one...
      */
     public XWPFHeader getOddPageHeader() {
         return defaultHeader;
     }
+
     /**
      * Returns the odd page footer. This is
-     *  also the same as the default one...
+     * also the same as the default one...
      */
     public XWPFFooter getOddPageFooter() {
         return defaultFooter;
     }
+
     public XWPFHeader getEvenPageHeader() {
         return evenPageHeader;
     }
+
     public XWPFFooter getEvenPageFooter() {
         return evenPageFooter;
     }
+
     public XWPFHeader getDefaultHeader() {
         return defaultHeader;
     }
+
     public XWPFFooter getDefaultFooter() {
         return defaultFooter;
     }
 
     /**
      * Get the header that applies to the given
-     *  (1 based) page.
+     * (1 based) page.
+     *
      * @param pageNumber The one based page number
      */
     public XWPFHeader getHeader(int pageNumber) {
-        if(pageNumber == 1 && firstPageHeader != null) {
+        if (pageNumber == 1 && firstPageHeader != null) {
             return firstPageHeader;
         }
-        if(pageNumber % 2 == 0 && evenPageHeader != null) {
+        if (pageNumber % 2 == 0 && evenPageHeader != null) {
             return evenPageHeader;
         }
         return defaultHeader;
     }
+
     /**
      * Get the footer that applies to the given
-     *  (1 based) page.
+     * (1 based) page.
+     *
      * @param pageNumber The one based page number
      */
     public XWPFFooter getFooter(int pageNumber) {
-        if(pageNumber == 1 && firstPageFooter != null) {
+        if (pageNumber == 1 && firstPageFooter != null) {
             return firstPageFooter;
         }
-        if(pageNumber % 2 == 0 && evenPageFooter != null) {
+        if (pageNumber % 2 == 0 && evenPageFooter != null) {
             return evenPageFooter;
         }
         return defaultFooter;
@@ -459,7 +465,7 @@ public class XWPFHeaderFooterPolicy {
         lock.setExt(STExt.EDIT);
         CTShape shape = group.addNewShape();
         shape.setId("PowerPlusWaterMarkObject" + idx);
-        shape.setSpid("_x0000_s102" + (4+idx));
+        shape.setSpid("_x0000_s102" + (4 + idx));
         shape.setType("#_x0000_t136");
         shape.setStyle("position:absolute;margin-left:0;margin-top:0;width:415pt;height:207.5pt;z-index:-251654144;mso-wrap-edited:f;mso-position-horizontal:center;mso-position-horizontal-relative:margin;mso-position-vertical:center;mso-position-vertical-relative:margin");
         shape.setWrapcoords("616 5068 390 16297 39 16921 -39 17155 7265 17545 7186 17467 -39 17467 18904 17467 10507 17467 8710 17545 18904 17077 18787 16843 18358 16297 18279 12554 19178 12476 20701 11774 20779 11228 21131 10059 21248 8811 21248 7563 20975 6316 20935 5380 19490 5146 14022 5068 2616 5068");

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xwpf/model/XWPFHyperlinkDecorator.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xwpf/model/XWPFHyperlinkDecorator.java?rev=1682473&r1=1682472&r2=1682473&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xwpf/model/XWPFHyperlinkDecorator.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xwpf/model/XWPFHyperlinkDecorator.java Fri May 29 14:01:31 2015
@@ -23,50 +23,49 @@ import org.openxmlformats.schemas.wordpr
 import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTText;
 
 /**
- * Decorator class for XWPFParagraph allowing to add hyperlinks 
- *  found in paragraph to its text.
- *  
+ * Decorator class for XWPFParagraph allowing to add hyperlinks
+ * found in paragraph to its text.
+ * <p/>
  * Note - adds the hyperlink at the end, not in the right place...
- *  
+ *
  * @deprecated Use {@link XWPFHyperlinkRun} instead
  */
 @Deprecated
 public class XWPFHyperlinkDecorator extends XWPFParagraphDecorator {
-	private StringBuffer hyperlinkText;
-	
-	/**
-	 * @param nextDecorator The next decorator to use
-	 * @param outputHyperlinkUrls Should we output the links too, or just the link text?
-	 */
-	public XWPFHyperlinkDecorator(XWPFParagraphDecorator nextDecorator, boolean outputHyperlinkUrls) {
-		this(nextDecorator.paragraph, nextDecorator, outputHyperlinkUrls);
-	}
-	
-	/**
-	 * @param prgrph The paragraph of text to work on
-	 * @param outputHyperlinkUrls Should we output the links too, or just the link text?
-	 */
-	public XWPFHyperlinkDecorator(XWPFParagraph prgrph, XWPFParagraphDecorator nextDecorator, boolean outputHyperlinkUrls) {
-		super(prgrph, nextDecorator);
-		
-		hyperlinkText = new StringBuffer();
-		
-		// loop over hyperlink anchors
-		for(CTHyperlink link : paragraph.getCTP().getHyperlinkArray()){
-			for (CTR r : link.getRArray()) {
-				// Loop over text runs
-				for (CTText text : r.getTArray()){
-					hyperlinkText.append(text.getStringValue());
-				}
-			}
-			if(outputHyperlinkUrls && paragraph.getDocument().getHyperlinkByID(link.getId()) != null) {
-				hyperlinkText.append(" <"+paragraph.getDocument().getHyperlinkByID(link.getId()).getURL()+">");
-			}
-		}
-	}
-	
-	public String getText()
-	{
-		return super.getText() + hyperlinkText;
-	}
+    private StringBuffer hyperlinkText;
+
+    /**
+     * @param nextDecorator       The next decorator to use
+     * @param outputHyperlinkUrls Should we output the links too, or just the link text?
+     */
+    public XWPFHyperlinkDecorator(XWPFParagraphDecorator nextDecorator, boolean outputHyperlinkUrls) {
+        this(nextDecorator.paragraph, nextDecorator, outputHyperlinkUrls);
+    }
+
+    /**
+     * @param prgrph              The paragraph of text to work on
+     * @param outputHyperlinkUrls Should we output the links too, or just the link text?
+     */
+    public XWPFHyperlinkDecorator(XWPFParagraph prgrph, XWPFParagraphDecorator nextDecorator, boolean outputHyperlinkUrls) {
+        super(prgrph, nextDecorator);
+
+        hyperlinkText = new StringBuffer();
+
+        // loop over hyperlink anchors
+        for (CTHyperlink link : paragraph.getCTP().getHyperlinkArray()) {
+            for (CTR r : link.getRArray()) {
+                // Loop over text runs
+                for (CTText text : r.getTArray()) {
+                    hyperlinkText.append(text.getStringValue());
+                }
+            }
+            if (outputHyperlinkUrls && paragraph.getDocument().getHyperlinkByID(link.getId()) != null) {
+                hyperlinkText.append(" <" + paragraph.getDocument().getHyperlinkByID(link.getId()).getURL() + ">");
+            }
+        }
+    }
+
+    public String getText() {
+        return super.getText() + hyperlinkText;
+    }
 }

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xwpf/model/XWPFParagraphDecorator.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xwpf/model/XWPFParagraphDecorator.java?rev=1682473&r1=1682472&r2=1682473&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xwpf/model/XWPFParagraphDecorator.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xwpf/model/XWPFParagraphDecorator.java Fri May 29 14:01:31 2015
@@ -22,22 +22,22 @@ import org.apache.poi.xwpf.usermodel.XWP
  * Base decorator class for XWPFParagraph
  */
 public abstract class XWPFParagraphDecorator {
-	protected XWPFParagraph paragraph;
-	protected XWPFParagraphDecorator nextDecorator;
-	
-	public XWPFParagraphDecorator(XWPFParagraph paragraph) {
-		this(paragraph, null);
-	}
-	
-	public XWPFParagraphDecorator(XWPFParagraph paragraph, XWPFParagraphDecorator nextDecorator) {
-		this.paragraph = paragraph;
-		this.nextDecorator = nextDecorator;
-	}
-	
-	public String getText() {
-		if(nextDecorator != null) {
-			return nextDecorator.getText();
-		}
-		return paragraph.getText();
-	}
+    protected XWPFParagraph paragraph;
+    protected XWPFParagraphDecorator nextDecorator;
+
+    public XWPFParagraphDecorator(XWPFParagraph paragraph) {
+        this(paragraph, null);
+    }
+
+    public XWPFParagraphDecorator(XWPFParagraph paragraph, XWPFParagraphDecorator nextDecorator) {
+        this.paragraph = paragraph;
+        this.nextDecorator = nextDecorator;
+    }
+
+    public String getText() {
+        if (nextDecorator != null) {
+            return nextDecorator.getText();
+        }
+        return paragraph.getText();
+    }
 }

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xwpf/package.html
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xwpf/package.html?rev=1682473&r1=1682472&r2=1682473&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xwpf/package.html (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xwpf/package.html Fri May 29 14:01:31 2015
@@ -19,9 +19,9 @@
 -->
 <html>
 <body>
-    <p>This package contains classes for handling Microsoft .docx
-       Word Processing files, known in POI as XWPF (XML Word Processing
-       Format).
-    </p>
+<p>This package contains classes for handling Microsoft .docx
+    Word Processing files, known in POI as XWPF (XML Word Processing
+    Format).
+</p>
 </body>
 </html>

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/AbstractXWPFSDT.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/AbstractXWPFSDT.java?rev=1682473&r1=1682472&r2=1682473&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/AbstractXWPFSDT.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/AbstractXWPFSDT.java Fri May 29 14:01:31 2015
@@ -13,102 +13,92 @@
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
-==================================================================== */
-package org.apache.poi.xwpf.usermodel;
-
-import java.util.List;
-
-import org.apache.poi.POIXMLDocumentPart;
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTSdtPr;
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTString;
-
-/**
- * Experimental abstract class that is a base for XWPFSDT and XWPFSDTCell
- *  
- * WARNING - APIs expected to change rapidly.
- * 
- * These classes have so far been built only for read-only processing.
- * 
- */
-public abstract class AbstractXWPFSDT implements ISDTContents {
-   private final String title;
-   private final String tag;
-   private final IBody part;
-
-   @SuppressWarnings("deprecation")
-   public AbstractXWPFSDT(CTSdtPr pr, IBody part){
-       
-       CTString[] aliases = pr.getAliasArray();
-       if (aliases != null && aliases.length > 0){
-          title = aliases[0].getVal();
-       } else {
-          title = "";
-       }
-       CTString[] tags = pr.getTagArray();
-       if (tags != null && tags.length > 0){
-          tag = tags[0].getVal();
-       } else {
-          tag = "";
-       }
-       this.part = part;
-       
-   }
-
-   /**
-    * 
-    * @return first SDT Title
-    */
-   public String getTitle(){
-      return title;
-   }
-   
-   /**
-    * 
-    * @return first SDT Tag
-    */
-   public String getTag(){
-      return tag;
-   }
-   
-   /**
-    * 
-    * @return the content object
-    */
-   public abstract ISDTContent getContent();
-
-   /**
-    * 
-    * @return null
-    */
-   public IBody getBody() {
-      return null;
-   }
-
-   /**
-    * 
-    * @return document part
-    */
-   public POIXMLDocumentPart getPart() {
-      return part.getPart();
-   }
-
-   /**
-    * 
-    * @return partType
-    */
-   public BodyType getPartType() {
-      return BodyType.CONTENTCONTROL;
-   }
-
-   /**
-    * 
-    * @return element type
-    */
-   public BodyElementType getElementType() {
-      return BodyElementType.CONTENTCONTROL;
-   }
-
-   public XWPFDocument getDocument() {
-      return part.getXWPFDocument();
-   }
-}
+==================================================================== */
+package org.apache.poi.xwpf.usermodel;
+
+import org.apache.poi.POIXMLDocumentPart;
+import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTSdtPr;
+import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTString;
+
+/**
+ * Experimental abstract class that is a base for XWPFSDT and XWPFSDTCell
+ * <p/>
+ * WARNING - APIs expected to change rapidly.
+ * <p/>
+ * These classes have so far been built only for read-only processing.
+ */
+public abstract class AbstractXWPFSDT implements ISDTContents {
+    private final String title;
+    private final String tag;
+    private final IBody part;
+
+    @SuppressWarnings("deprecation")
+    public AbstractXWPFSDT(CTSdtPr pr, IBody part) {
+
+        CTString[] aliases = pr.getAliasArray();
+        if (aliases != null && aliases.length > 0) {
+            title = aliases[0].getVal();
+        } else {
+            title = "";
+        }
+        CTString[] tags = pr.getTagArray();
+        if (tags != null && tags.length > 0) {
+            tag = tags[0].getVal();
+        } else {
+            tag = "";
+        }
+        this.part = part;
+
+    }
+
+    /**
+     * @return first SDT Title
+     */
+    public String getTitle() {
+        return title;
+    }
+
+    /**
+     * @return first SDT Tag
+     */
+    public String getTag() {
+        return tag;
+    }
+
+    /**
+     * @return the content object
+     */
+    public abstract ISDTContent getContent();
+
+    /**
+     * @return null
+     */
+    public IBody getBody() {
+        return null;
+    }
+
+    /**
+     * @return document part
+     */
+    public POIXMLDocumentPart getPart() {
+        return part.getPart();
+    }
+
+    /**
+     * @return partType
+     */
+    public BodyType getPartType() {
+        return BodyType.CONTENTCONTROL;
+    }
+
+    /**
+     * @return element type
+     */
+    public BodyElementType getElementType() {
+        return BodyElementType.CONTENTCONTROL;
+    }
+
+    public XWPFDocument getDocument() {
+        return part.getXWPFDocument();
+    }
+}

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/BodyElementType.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/BodyElementType.java?rev=1682473&r1=1682472&r2=1682473&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/BodyElementType.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/BodyElementType.java Fri May 29 14:01:31 2015
@@ -21,15 +21,14 @@ package org.apache.poi.xwpf.usermodel;
  * <p>
  * 9 Jan 2010
  * </p>
- * <p>
- * // TODO insert Javadoc here!
- * </p>
- * @author epp
- *
- */
-public enum BodyElementType {
-   CONTENTCONTROL,
-   PARAGRAPH,
-	TABLE,
-	
-}
+ * <p>
+ * // TODO insert Javadoc here!
+ * </p>
+ *
+ * @author epp
+ */
+public enum BodyElementType {
+    CONTENTCONTROL,
+    PARAGRAPH,
+    TABLE,
+}

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/Borders.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/Borders.java?rev=1682473&r1=1682472&r2=1682473&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/Borders.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/Borders.java Fri May 29 14:01:31 2015
@@ -29,14 +29,15 @@ import java.util.Map;
  * </li>
  * <li> Art borders: which specify a repeated image to be used
  * when drawing a border around the specified object. Line borders may be
- * specified on any object which allows a border, however, art borders may only
- * be used as a border at the page level - the borders under the pgBorders
- * element
- *</li>
- * </ul>
- * @author Gisella Bronzetti
- */
-public enum Borders {
+ * specified on any object which allows a border, however, art borders may only
+ * be used as a border at the page level - the borders under the pgBorders
+ * element
+ * </li>
+ * </ul>
+ *
+ * @author Gisella Bronzetti
+ */
+public enum Borders {
 
     NIL(1),
 
@@ -596,31 +597,32 @@ public enum Borders {
     ZANY_TRIANGLES(189),
 
     ZIG_ZAG(190),
-
-    ZIG_ZAG_STITCH(191);
-
-    private final int value;
-
-    private Borders(int val) {
-        value = val;
-    }
-
-    public int getValue() {
-        return value;
-    }
-
-    private static Map<Integer, Borders> imap = new HashMap<Integer, Borders>();
-    static {
-        for (Borders p : values()) {
-            imap.put(Integer.valueOf(p.getValue()), p);
-        }
-    }
-
-    public static Borders valueOf(int type) {
-        Borders pBorder = imap.get(Integer.valueOf(type));
-        if (pBorder == null) {
-            throw new IllegalArgumentException("Unknown paragraph border: " + type);
-        }
-        return pBorder;
-    }
-}
+
+    ZIG_ZAG_STITCH(191);
+
+    private static Map<Integer, Borders> imap = new HashMap<Integer, Borders>();
+
+    static {
+        for (Borders p : values()) {
+            imap.put(Integer.valueOf(p.getValue()), p);
+        }
+    }
+
+    private final int value;
+
+    private Borders(int val) {
+        value = val;
+    }
+
+    public static Borders valueOf(int type) {
+        Borders pBorder = imap.get(Integer.valueOf(type));
+        if (pBorder == null) {
+            throw new IllegalArgumentException("Unknown paragraph border: " + type);
+        }
+        return pBorder;
+    }
+
+    public int getValue() {
+        return value;
+    }
+}

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/BreakClear.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/BreakClear.java?rev=1682473&r1=1682472&r2=1682473&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/BreakClear.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/BreakClear.java Fri May 29 14:01:31 2015
@@ -20,23 +20,23 @@ import java.util.HashMap;
 import java.util.Map;
 
 /**
- * Specifies the set of possible restart locations which may be used as to
- * determine the next available line when a break's type attribute has a value
- * of textWrapping.
- * 
- * @author Gisella Bronzetti
- */
-public enum BreakClear {
+ * Specifies the set of possible restart locations which may be used as to
+ * determine the next available line when a break's type attribute has a value
+ * of textWrapping.
+ *
+ * @author Gisella Bronzetti
+ */
+public enum BreakClear {
 
     /**
      * Specifies that the text wrapping break shall advance the text to the next
-     * line in the WordprocessingML document, regardless of its position left to
-     * right or the presence of any floating objects which intersect with the
-     * line,
-     * 
-     * This is the setting for a typical line break in a document.
-     */
-
+     * line in the WordprocessingML document, regardless of its position left to
+     * right or the presence of any floating objects which intersect with the
+     * line,
+     * <p/>
+     * This is the setting for a typical line break in a document.
+     */
+
     NONE(1),
 
     /**
@@ -80,31 +80,32 @@ public enum BreakClear {
      * Specifies that the text wrapping break shall advance the text to the next
      * line in the WordprocessingML document which spans the full width of the
      * line.
-     */
-    ALL(4);
-
-    private final int value;
-
-    private BreakClear(int val) {
-       value = val;
-    }
-
-    public int getValue() {
-       return value;
-    }
-
-    private static Map<Integer, BreakClear> imap = new HashMap<Integer, BreakClear>();
-    static {
-       for (BreakClear p : values()) {
-          imap.put(new Integer(p.getValue()), p);
-       }
-    }
-
-    public static BreakClear valueOf(int type) {
-       BreakClear bType = imap.get(new Integer(type));
-       if (bType == null)
-          throw new IllegalArgumentException("Unknown break clear type: "
-                + type);
-       return bType;
-    }
-}
+     */
+    ALL(4);
+
+    private static Map<Integer, BreakClear> imap = new HashMap<Integer, BreakClear>();
+
+    static {
+        for (BreakClear p : values()) {
+            imap.put(new Integer(p.getValue()), p);
+        }
+    }
+
+    private final int value;
+
+    private BreakClear(int val) {
+        value = val;
+    }
+
+    public static BreakClear valueOf(int type) {
+        BreakClear bType = imap.get(new Integer(type));
+        if (bType == null)
+            throw new IllegalArgumentException("Unknown break clear type: "
+                    + type);
+        return bType;
+    }
+
+    public int getValue() {
+        return value;
+    }
+}

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/BreakType.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/BreakType.java?rev=1682473&r1=1682472&r2=1682473&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/BreakType.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/BreakType.java Fri May 29 14:01:31 2015
@@ -21,18 +21,18 @@ import java.util.Map;
 
 /**
  * Specifies the possible types of break characters in a WordprocessingML
- * document.
- * The break type determines the next location where text shall be
- * placed after this manual break is applied to the text contents
- * 
- * @author Gisella Bronzetti
- */
-public enum BreakType {
-
-    
-    /**
-     * Specifies that the current break shall restart itself on the next page of
-     * the document when the document is displayed in page view.
+ * document.
+ * The break type determines the next location where text shall be
+ * placed after this manual break is applied to the text contents
+ *
+ * @author Gisella Bronzetti
+ */
+public enum BreakType {
+
+
+    /**
+     * Specifies that the current break shall restart itself on the next page of
+     * the document when the document is displayed in page view.
      */
     PAGE(1),
 
@@ -53,31 +53,32 @@ public enum BreakType {
      * the document when the document is displayed in page view.
      * The determine of the next line shall be done subject to the value of the clear
      * attribute on the specified break character.
-     */
-    TEXT_WRAPPING(3);
-
-    private final int value;
-
-    private BreakType(int val) {
-       value = val;
-    }
-
-    public int getValue() {
-       return value;
-    }
-
-    private static Map<Integer, BreakType> imap = new HashMap<Integer, BreakType>();
-    static {
-       for (BreakType p : values()) {
-          imap.put(new Integer(p.getValue()), p);
-       }
-    }
-
-    public static BreakType valueOf(int type) {
-       BreakType bType = imap.get(new Integer(type));
-       if (bType == null)
-          throw new IllegalArgumentException("Unknown break type: "
-                + type);
-       return bType;
-    }
-}
+     */
+    TEXT_WRAPPING(3);
+
+    private static Map<Integer, BreakType> imap = new HashMap<Integer, BreakType>();
+
+    static {
+        for (BreakType p : values()) {
+            imap.put(new Integer(p.getValue()), p);
+        }
+    }
+
+    private final int value;
+
+    private BreakType(int val) {
+        value = val;
+    }
+
+    public static BreakType valueOf(int type) {
+        BreakType bType = imap.get(new Integer(type));
+        if (bType == null)
+            throw new IllegalArgumentException("Unknown break type: "
+                    + type);
+        return bType;
+    }
+
+    public int getValue() {
+        return value;
+    }
+}

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/Document.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/Document.java?rev=1682473&r1=1682472&r2=1682473&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/Document.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/Document.java Fri May 29 14:01:31 2015
@@ -14,31 +14,45 @@
    See the License for the specific language governing permissions and
    limitations under the License.
 ==================================================================== */
-package org.apache.poi.xwpf.usermodel;
-
-public interface Document {
-    /** Extended windows meta file */
-    public static final int PICTURE_TYPE_EMF = 2;
-
-    /** Windows Meta File */
-    public static final int PICTURE_TYPE_WMF = 3;
-
-    /** Mac PICT format */
-    public static final int PICTURE_TYPE_PICT = 4;
-
-    /** JPEG format */
-    public static final int PICTURE_TYPE_JPEG = 5;
-
-    /** PNG format */
-    public static final int PICTURE_TYPE_PNG = 6;
-
-    /** Device independent bitmap */
-    public static final int PICTURE_TYPE_DIB = 7;
-
-    /** GIF image format */
-    public static final int PICTURE_TYPE_GIF = 8;
-
-    /**
+package org.apache.poi.xwpf.usermodel;
+
+public interface Document {
+    /**
+     * Extended windows meta file
+     */
+    public static final int PICTURE_TYPE_EMF = 2;
+
+    /**
+     * Windows Meta File
+     */
+    public static final int PICTURE_TYPE_WMF = 3;
+
+    /**
+     * Mac PICT format
+     */
+    public static final int PICTURE_TYPE_PICT = 4;
+
+    /**
+     * JPEG format
+     */
+    public static final int PICTURE_TYPE_JPEG = 5;
+
+    /**
+     * PNG format
+     */
+    public static final int PICTURE_TYPE_PNG = 6;
+
+    /**
+     * Device independent bitmap
+     */
+    public static final int PICTURE_TYPE_DIB = 7;
+
+    /**
+     * GIF image format
+     */
+    public static final int PICTURE_TYPE_GIF = 8;
+
+    /**
      * Tag Image File (.tiff)
      */
     public static final int PICTURE_TYPE_TIFF = 9;

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/IBody.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/IBody.java?rev=1682473&r1=1682472&r2=1682473&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/IBody.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/IBody.java Fri May 29 14:01:31 2015
@@ -27,64 +27,68 @@ import org.openxmlformats.schemas.wordpr
 
 /**
  * <p>An IBody represents the different parts of the document which
- * can contain collections of Paragraphs and Tables. It provides a
- * common way to work with these and their contents.</p>
- * <p>Typically, this is something like a XWPFDocument, or one of
- *  the parts in it like XWPFHeader, XWPFFooter, XWPFTableCell
- * </p>
- */
-public interface IBody {
-    /**
-     * returns the Part, to which the body belongs, which you need for adding relationship to other parts
-     * Actually it is needed of the class XWPFTableCell. Because you have to know to which part the tableCell
-     * belongs.
-     * @return the Part, to which the body belongs
-     */
-    public POIXMLDocumentPart getPart();
-
-    /**
-     * get the PartType of the body, for example
-     * DOCUMENT, HEADER, FOOTER, FOOTNOTE, 
-     * @return the PartType of the body
-     */
-    public BodyType getPartType();
-
-    /**
-     * Returns an Iterator with paragraphs and tables, 
-     *  in the order that they occur in the text.
-     */
-    public List<IBodyElement> getBodyElements();
-
-    /**
-     * Returns the paragraph(s) that holds
-     *  the text of the header or footer.
-     */
-    public List<XWPFParagraph> getParagraphs();
-
-    /**
-     * Return the table(s) that holds the text
-     *  of the IBodyPart, for complex cases
-     *  where a paragraph isn't used.
-     */
-    public List<XWPFTable> getTables();
-
-    /**
-     * if there is a corresponding {@link XWPFParagraph} of the parameter ctTable in the paragraphList of this header or footer
-     * the method will return this paragraph
-     * if there is no corresponding {@link XWPFParagraph} the method will return null 
-     * @param p is instance of CTP and is searching for an XWPFParagraph
-     * @return null if there is no XWPFParagraph with an corresponding CTPparagraph in the paragraphList of this header or footer
-     * 		   XWPFParagraph with the correspondig CTP p
-     */
-    public XWPFParagraph getParagraph(CTP p);
-
-    /**
-     * if there is a corresponding {@link XWPFTable} of the parameter ctTable in the tableList of this header
-     * the method will return this table
-     * if there is no corresponding {@link XWPFTable} the method will return null 
-     * @param ctTable
-     */
-    public XWPFTable getTable(CTTbl ctTable);
+ * can contain collections of Paragraphs and Tables. It provides a
+ * common way to work with these and their contents.</p>
+ * <p>Typically, this is something like a XWPFDocument, or one of
+ * the parts in it like XWPFHeader, XWPFFooter, XWPFTableCell
+ * </p>
+ */
+public interface IBody {
+    /**
+     * returns the Part, to which the body belongs, which you need for adding relationship to other parts
+     * Actually it is needed of the class XWPFTableCell. Because you have to know to which part the tableCell
+     * belongs.
+     *
+     * @return the Part, to which the body belongs
+     */
+    public POIXMLDocumentPart getPart();
+
+    /**
+     * get the PartType of the body, for example
+     * DOCUMENT, HEADER, FOOTER, FOOTNOTE,
+     *
+     * @return the PartType of the body
+     */
+    public BodyType getPartType();
+
+    /**
+     * Returns an Iterator with paragraphs and tables,
+     * in the order that they occur in the text.
+     */
+    public List<IBodyElement> getBodyElements();
+
+    /**
+     * Returns the paragraph(s) that holds
+     * the text of the header or footer.
+     */
+    public List<XWPFParagraph> getParagraphs();
+
+    /**
+     * Return the table(s) that holds the text
+     * of the IBodyPart, for complex cases
+     * where a paragraph isn't used.
+     */
+    public List<XWPFTable> getTables();
+
+    /**
+     * if there is a corresponding {@link XWPFParagraph} of the parameter ctTable in the paragraphList of this header or footer
+     * the method will return this paragraph
+     * if there is no corresponding {@link XWPFParagraph} the method will return null
+     *
+     * @param p is instance of CTP and is searching for an XWPFParagraph
+     * @return null if there is no XWPFParagraph with an corresponding CTPparagraph in the paragraphList of this header or footer
+     * XWPFParagraph with the correspondig CTP p
+     */
+    public XWPFParagraph getParagraph(CTP p);
+
+    /**
+     * if there is a corresponding {@link XWPFTable} of the parameter ctTable in the tableList of this header
+     * the method will return this table
+     * if there is no corresponding {@link XWPFTable} the method will return null
+     *
+     * @param ctTable
+     */
+    public XWPFTable getTable(CTTbl ctTable);
 
     /**
      * Returns the paragraph that of position pos
@@ -94,32 +98,36 @@ public interface IBody {
     /**
      * Returns the table at position pos
      */
-    public XWPFTable getTableArray(int pos);
-
-    /**
-     *inserts a new paragraph at position of the cursor
-     * @param cursor
-     */
-    public XWPFParagraph insertNewParagraph(XmlCursor cursor);
-
-    /**
-     * inserts a new Table at the cursor position.
-     * @param cursor
-     */
-    public XWPFTable insertNewTbl(XmlCursor cursor);
-
-    /**
-     * inserts a new Table at position pos
-     * @param pos
-     * @param table
-     */
+    public XWPFTable getTableArray(int pos);
+
+    /**
+     * inserts a new paragraph at position of the cursor
+     *
+     * @param cursor
+     */
+    public XWPFParagraph insertNewParagraph(XmlCursor cursor);
+
+    /**
+     * inserts a new Table at the cursor position.
+     *
+     * @param cursor
+     */
+    public XWPFTable insertNewTbl(XmlCursor cursor);
+
+    /**
+     * inserts a new Table at position pos
+     *
+     * @param pos
+     * @param table
+     */
     void insertTable(int pos, XWPFTable table);
-
-    /**
-     * returns the TableCell to which the Table belongs
-     * @param cell
-     */
-    public XWPFTableCell getTableCell(CTTc cell);
+
+    /**
+     * returns the TableCell to which the Table belongs
+     *
+     * @param cell
+     */
+    public XWPFTableCell getTableCell(CTTc cell);
 
     /**
      * Return XWPFDocument

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/IBodyElement.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/IBodyElement.java?rev=1682473&r1=1682472&r2=1682473&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/IBodyElement.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/IBodyElement.java Fri May 29 14:01:31 2015
@@ -18,15 +18,18 @@
 package org.apache.poi.xwpf.usermodel;
 
 import org.apache.poi.POIXMLDocumentPart;
-
-/**
- * 9 Jan 2010
- * @author Philipp Epp
- *
- */
-public interface IBodyElement{
-	IBody getBody();
-    POIXMLDocumentPart getPart();
-	BodyType getPartType();
-	BodyElementType getElementType();
-}
+
+/**
+ * 9 Jan 2010
+ *
+ * @author Philipp Epp
+ */
+public interface IBodyElement {
+    IBody getBody();
+
+    POIXMLDocumentPart getPart();
+
+    BodyType getPartType();
+
+    BodyElementType getElementType();
+}

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/ICell.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/ICell.java?rev=1682473&r1=1682472&r2=1682473&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/ICell.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/ICell.java Fri May 29 14:01:31 2015
@@ -15,13 +15,13 @@
    limitations under the License.
 ==================================================================== */
 package org.apache.poi.xwpf.usermodel;
-
-/**
- * Interface for anything that can be at a table cell level:
- *  {@link XWPFTableCell}, {@link XWPFSDTCell}
- *  <p>
- *  Schematically something like this:
- *  &lt;tr&gt;&lt;tc/&gt;&lt;tc/&gt;&lt;sdt&gt&lt;tc/&gt;&lt;/sdt&gt;&lt;/tr&gt;
- */
-public interface ICell {
-}
+
+/**
+ * Interface for anything that can be at a table cell level:
+ * {@link XWPFTableCell}, {@link XWPFSDTCell}
+ * <p/>
+ * Schematically something like this:
+ * &lt;tr&gt;&lt;tc/&gt;&lt;tc/&gt;&lt;sdt&gt&lt;tc/&gt;&lt;/sdt&gt;&lt;/tr&gt;
+ */
+public interface ICell {
+}

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/IRunBody.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/IRunBody.java?rev=1682473&r1=1682472&r2=1682473&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/IRunBody.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/IRunBody.java Fri May 29 14:01:31 2015
@@ -22,10 +22,11 @@ import org.apache.poi.wp.usermodel.Parag
 /**
  * Simple interface describing both {@link XWPFParagraph}
  * and {@link XWPFSDT}
- * 
+ * <p/>
  * TODO Should this be based on / extend {@link Paragraph}?
  */
 public interface IRunBody {
-   public XWPFDocument getDocument();
-   public POIXMLDocumentPart getPart();
+    public XWPFDocument getDocument();
+
+    public POIXMLDocumentPart getPart();
 }

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/IRunElement.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/IRunElement.java?rev=1682473&r1=1682472&r2=1682473&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/IRunElement.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/IRunElement.java Fri May 29 14:01:31 2015
@@ -20,11 +20,10 @@ import org.apache.poi.wp.usermodel.Chara
 
 /**
  * Common interface for things that can occur
- *  where a run (text with common stylings) can,
- *  eg {@link XWPFRun} or {@link XWPFSDT}.
+ * where a run (text with common stylings) can,
+ * eg {@link XWPFRun} or {@link XWPFSDT}.
  * TODO More methods to follow shortly!
- * 
+ * <p/>
  * TODO Make this based on {@link CharacterRun}
  */
-public interface IRunElement {
-}
\ No newline at end of file
+public interface IRunElement {}
\ No newline at end of file

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/ISDTContent.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/ISDTContent.java?rev=1682473&r1=1682472&r2=1682473&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/ISDTContent.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/ISDTContent.java Fri May 29 14:01:31 2015
@@ -15,21 +15,20 @@
    limitations under the License.
 ==================================================================== */
 package org.apache.poi.xwpf.usermodel;
-
-
-/**
- * Experimental interface to offer rudimentary read-only processing of 
- *  of the contentblock of an SDT/ContentControl.
- *  
- *
- *
- * WARNING - APIs expected to change rapidly
- * 
- */
-public interface ISDTContent  {
-
-    public String getText();
-
-    public String toString();
-    
+
+
+/**
+ * Experimental interface to offer rudimentary read-only processing of
+ * of the contentblock of an SDT/ContentControl.
+ * <p/>
+ * <p/>
+ * <p/>
+ * WARNING - APIs expected to change rapidly
+ */
+public interface ISDTContent {
+
+    public String getText();
+
+    public String toString();
+
 }

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/ISDTContents.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/ISDTContents.java?rev=1682473&r1=1682472&r2=1682473&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/ISDTContents.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/ISDTContents.java Fri May 29 14:01:31 2015
@@ -18,8 +18,8 @@ package org.apache.poi.xwpf.usermodel;
 
 /**
  * Interface for anything that can be within an SDT:
- *  {@link XWPFRun}, {@link XWPFTable}, {@link XWPFParagraph},
- *  {@link XWPFSDT} etc
+ * {@link XWPFRun}, {@link XWPFTable}, {@link XWPFParagraph},
+ * {@link XWPFSDT} etc
  */
 public interface ISDTContents {
 }

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/LineSpacingRule.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/LineSpacingRule.java?rev=1682473&r1=1682472&r2=1682473&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/LineSpacingRule.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/LineSpacingRule.java Fri May 29 14:01:31 2015
@@ -19,13 +19,13 @@ package org.apache.poi.xwpf.usermodel;
 import java.util.HashMap;
 import java.util.Map;
 
-/**
- * Specifies the logic which shall be used to calculate the line spacing of the
- * parent object when it is displayed in the document.
- * 
- * @author Gisella Bronzetti
- */
-public enum LineSpacingRule {
+/**
+ * Specifies the logic which shall be used to calculate the line spacing of the
+ * parent object when it is displayed in the document.
+ *
+ * @author Gisella Bronzetti
+ */
+public enum LineSpacingRule {
 
     /**
      * Specifies that the line spacing of the parent object shall be
@@ -45,31 +45,32 @@ public enum LineSpacingRule {
     /**
      * Specifies that the height of the line shall be at least the value
      * specified, but may be expanded to fit its content as needed.
-     */
-    AT_LEAST(3);
-
-    
-    private final int value;
-
-    private LineSpacingRule(int val) {
-       value = val;
-    }
-
-    public int getValue() {
-       return value;
-    }
-
-    private static Map<Integer, LineSpacingRule> imap = new HashMap<Integer, LineSpacingRule>();
-    static {
-       for (LineSpacingRule p : values()) {
-          imap.put(new Integer(p.getValue()), p);
-       }
-    }
-
-    public static LineSpacingRule valueOf(int type) {
-       LineSpacingRule lineType = imap.get(new Integer(type));
-       if (lineType == null)
-          throw new IllegalArgumentException("Unknown line type: " + type);
-       return lineType;
-    }
-}
+     */
+    AT_LEAST(3);
+
+
+    private static Map<Integer, LineSpacingRule> imap = new HashMap<Integer, LineSpacingRule>();
+
+    static {
+        for (LineSpacingRule p : values()) {
+            imap.put(new Integer(p.getValue()), p);
+        }
+    }
+
+    private final int value;
+
+    private LineSpacingRule(int val) {
+        value = val;
+    }
+
+    public static LineSpacingRule valueOf(int type) {
+        LineSpacingRule lineType = imap.get(new Integer(type));
+        if (lineType == null)
+            throw new IllegalArgumentException("Unknown line type: " + type);
+        return lineType;
+    }
+
+    public int getValue() {
+        return value;
+    }
+}

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/ParagraphAlignment.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/ParagraphAlignment.java?rev=1682473&r1=1682472&r2=1682473&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/ParagraphAlignment.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/ParagraphAlignment.java Fri May 29 14:01:31 2015
@@ -37,30 +37,31 @@ public enum ParagraphAlignment {
     DISTRIBUTE(6),
     NUM_TAB(7),
     HIGH_KASHIDA(8),
-    LOW_KASHIDA(9),
-    THAI_DISTRIBUTE(10);
-
-    private final int value;
-
-    private ParagraphAlignment(int val){
-        value = val;
-    }
-
-    public int getValue(){
-        return value;
-    }
-
-    private static Map<Integer, ParagraphAlignment> imap = new HashMap<Integer, ParagraphAlignment>();
-    static{
-        for (ParagraphAlignment p : values()) {
-            imap.put(new Integer(p.getValue()), p);
-        }
-    }
-
-    public static ParagraphAlignment valueOf(int type){
-        ParagraphAlignment err = imap.get(new Integer(type));
-        if(err == null) throw new IllegalArgumentException("Unknown paragraph alignment: " + type);
-        return err;
-    }
-
-}
+    LOW_KASHIDA(9),
+    THAI_DISTRIBUTE(10);
+
+    private static Map<Integer, ParagraphAlignment> imap = new HashMap<Integer, ParagraphAlignment>();
+
+    static {
+        for (ParagraphAlignment p : values()) {
+            imap.put(new Integer(p.getValue()), p);
+        }
+    }
+
+    private final int value;
+
+    private ParagraphAlignment(int val) {
+        value = val;
+    }
+
+    public static ParagraphAlignment valueOf(int type) {
+        ParagraphAlignment err = imap.get(new Integer(type));
+        if (err == null) throw new IllegalArgumentException("Unknown paragraph alignment: " + type);
+        return err;
+    }
+
+    public int getValue() {
+        return value;
+    }
+
+}

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/PositionInParagraph.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/PositionInParagraph.java?rev=1682473&r1=1682472&r2=1682473&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/PositionInParagraph.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/PositionInParagraph.java Fri May 29 14:01:31 2015
@@ -17,49 +17,47 @@
 
 package org.apache.poi.xwpf.usermodel;
 
-
-/**
- * postion of a character in a paragrapho
-* 1st RunPositon
-* 2nd TextPosition
-* 3rd CharacterPosition 
-* 
-*
-*/
-public class PositionInParagraph {
-	private int posRun = 0, posText = 0, posChar = 0;
-
-	public PositionInParagraph(){
-	}
-	
-	public PositionInParagraph(int posRun, int posText, int posChar){
-		this.posRun=posRun;
-		this.posChar=posChar;
-		this.posText= posText;
-	}
-	
-	public int getRun() {
-		return posRun;
-	}
-
-	public void setRun(int beginRun) {
-		this.posRun = beginRun;
-	}
-
-	public int getText() {
-		return posText;
-	}
-
-	public void setText(int beginText) {
-		this.posText = beginText;
-	}
-
-	public int getChar() {
-		return posChar;
-	}
-
-	public void setChar(int beginChar) {
-		this.posChar = beginChar;
-	}
-
-}
+
+/**
+ * postion of a character in a paragrapho
+ * 1st RunPositon
+ * 2nd TextPosition
+ * 3rd CharacterPosition
+ */
+public class PositionInParagraph {
+    private int posRun = 0, posText = 0, posChar = 0;
+
+    public PositionInParagraph() {
+    }
+
+    public PositionInParagraph(int posRun, int posText, int posChar) {
+        this.posRun = posRun;
+        this.posChar = posChar;
+        this.posText = posText;
+    }
+
+    public int getRun() {
+        return posRun;
+    }
+
+    public void setRun(int beginRun) {
+        this.posRun = beginRun;
+    }
+
+    public int getText() {
+        return posText;
+    }
+
+    public void setText(int beginText) {
+        this.posText = beginText;
+    }
+
+    public int getChar() {
+        return posChar;
+    }
+
+    public void setChar(int beginChar) {
+        this.posChar = beginChar;
+    }
+
+}

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/TOC.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/TOC.java?rev=1682473&r1=1682472&r2=1682473&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/TOC.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/TOC.java Fri May 29 14:01:31 2015
@@ -38,85 +38,85 @@ import org.openxmlformats.schemas.wordpr
 import org.openxmlformats.schemas.wordprocessingml.x2006.main.STTabJc;
 import org.openxmlformats.schemas.wordprocessingml.x2006.main.STTabTlc;
 import org.openxmlformats.schemas.wordprocessingml.x2006.main.STTheme;
-
-public class TOC {
-
-	CTSdtBlock block;
-
-	public TOC() {
-		this(CTSdtBlock.Factory.newInstance());
-	}
-
-	public TOC(CTSdtBlock block) {
-		this.block = block;
-		CTSdtPr sdtPr = block.addNewSdtPr();
-		CTDecimalNumber id = sdtPr.addNewId();
-		id.setVal(new BigInteger("4844945"));
-		sdtPr.addNewDocPartObj().addNewDocPartGallery().setVal("Table of contents");
-		CTSdtEndPr sdtEndPr = block.addNewSdtEndPr();
-		CTRPr rPr = sdtEndPr.addNewRPr();
-		CTFonts fonts = rPr.addNewRFonts();
-		fonts.setAsciiTheme(STTheme.MINOR_H_ANSI);
-		fonts.setEastAsiaTheme(STTheme.MINOR_H_ANSI);
-		fonts.setHAnsiTheme(STTheme.MINOR_H_ANSI);
-		fonts.setCstheme(STTheme.MINOR_BIDI);
-		rPr.addNewB().setVal(STOnOff.OFF);
-		rPr.addNewBCs().setVal(STOnOff.OFF);
-		rPr.addNewColor().setVal("auto");
-		rPr.addNewSz().setVal(new BigInteger("24"));
-		rPr.addNewSzCs().setVal(new BigInteger("24"));
-		CTSdtContentBlock content = block.addNewSdtContent();
-		CTP p = content.addNewP();
-		p.setRsidR("00EF7E24".getBytes());
-		p.setRsidRDefault("00EF7E24".getBytes());
-		p.addNewPPr().addNewPStyle().setVal("TOCHeading");
-		p.addNewR().addNewT().setStringValue("Table of Contents");
-	}
-
-    @Internal
-    public CTSdtBlock getBlock() {
-		return this.block;
-	}
-
-	public void addRow(int level, String title, int page, String bookmarkRef) {
-		CTSdtContentBlock contentBlock = this.block.getSdtContent();
-		CTP p = contentBlock.addNewP();
-		p.setRsidR("00EF7E24".getBytes());
-		p.setRsidRDefault("00EF7E24".getBytes());
-		CTPPr pPr = p.addNewPPr();
-		pPr.addNewPStyle().setVal("TOC" + level);
-		CTTabs tabs = pPr.addNewTabs();
-		CTTabStop tab = tabs.addNewTab();
-		tab.setVal(STTabJc.RIGHT);
-		tab.setLeader(STTabTlc.DOT);
-		tab.setPos(new BigInteger("8290"));
-		pPr.addNewRPr().addNewNoProof();
-		CTR run = p.addNewR();
-		run.addNewRPr().addNewNoProof();
-		run.addNewT().setStringValue(title);
-		run = p.addNewR();
-		run.addNewRPr().addNewNoProof();
-		run.addNewTab();
-		run = p.addNewR();
-		run.addNewRPr().addNewNoProof();
-		run.addNewFldChar().setFldCharType(STFldCharType.BEGIN);
-		// pageref run
-		run = p.addNewR();
-		run.addNewRPr().addNewNoProof();
-		CTText text = run.addNewInstrText();
-		text.setSpace(Space.PRESERVE);
-		// bookmark reference
-		text.setStringValue(" PAGEREF _Toc" + bookmarkRef + " \\h ");
-		p.addNewR().addNewRPr().addNewNoProof();
-		run = p.addNewR();
-		run.addNewRPr().addNewNoProof();
-		run.addNewFldChar().setFldCharType(STFldCharType.SEPARATE);
-		// page number run
-		run = p.addNewR();
-		run.addNewRPr().addNewNoProof();
-		run.addNewT().setStringValue(Integer.valueOf(page).toString());
-		run = p.addNewR();
-		run.addNewRPr().addNewNoProof();
-		run.addNewFldChar().setFldCharType(STFldCharType.END);
-	}
-}
+
+public class TOC {
+
+    CTSdtBlock block;
+
+    public TOC() {
+        this(CTSdtBlock.Factory.newInstance());
+    }
+
+    public TOC(CTSdtBlock block) {
+        this.block = block;
+        CTSdtPr sdtPr = block.addNewSdtPr();
+        CTDecimalNumber id = sdtPr.addNewId();
+        id.setVal(new BigInteger("4844945"));
+        sdtPr.addNewDocPartObj().addNewDocPartGallery().setVal("Table of contents");
+        CTSdtEndPr sdtEndPr = block.addNewSdtEndPr();
+        CTRPr rPr = sdtEndPr.addNewRPr();
+        CTFonts fonts = rPr.addNewRFonts();
+        fonts.setAsciiTheme(STTheme.MINOR_H_ANSI);
+        fonts.setEastAsiaTheme(STTheme.MINOR_H_ANSI);
+        fonts.setHAnsiTheme(STTheme.MINOR_H_ANSI);
+        fonts.setCstheme(STTheme.MINOR_BIDI);
+        rPr.addNewB().setVal(STOnOff.OFF);
+        rPr.addNewBCs().setVal(STOnOff.OFF);
+        rPr.addNewColor().setVal("auto");
+        rPr.addNewSz().setVal(new BigInteger("24"));
+        rPr.addNewSzCs().setVal(new BigInteger("24"));
+        CTSdtContentBlock content = block.addNewSdtContent();
+        CTP p = content.addNewP();
+        p.setRsidR("00EF7E24".getBytes());
+        p.setRsidRDefault("00EF7E24".getBytes());
+        p.addNewPPr().addNewPStyle().setVal("TOCHeading");
+        p.addNewR().addNewT().setStringValue("Table of Contents");
+    }
+
+    @Internal
+    public CTSdtBlock getBlock() {
+        return this.block;
+    }
+
+    public void addRow(int level, String title, int page, String bookmarkRef) {
+        CTSdtContentBlock contentBlock = this.block.getSdtContent();
+        CTP p = contentBlock.addNewP();
+        p.setRsidR("00EF7E24".getBytes());
+        p.setRsidRDefault("00EF7E24".getBytes());
+        CTPPr pPr = p.addNewPPr();
+        pPr.addNewPStyle().setVal("TOC" + level);
+        CTTabs tabs = pPr.addNewTabs();
+        CTTabStop tab = tabs.addNewTab();
+        tab.setVal(STTabJc.RIGHT);
+        tab.setLeader(STTabTlc.DOT);
+        tab.setPos(new BigInteger("8290"));
+        pPr.addNewRPr().addNewNoProof();
+        CTR run = p.addNewR();
+        run.addNewRPr().addNewNoProof();
+        run.addNewT().setStringValue(title);
+        run = p.addNewR();
+        run.addNewRPr().addNewNoProof();
+        run.addNewTab();
+        run = p.addNewR();
+        run.addNewRPr().addNewNoProof();
+        run.addNewFldChar().setFldCharType(STFldCharType.BEGIN);
+        // pageref run
+        run = p.addNewR();
+        run.addNewRPr().addNewNoProof();
+        CTText text = run.addNewInstrText();
+        text.setSpace(Space.PRESERVE);
+        // bookmark reference
+        text.setStringValue(" PAGEREF _Toc" + bookmarkRef + " \\h ");
+        p.addNewR().addNewRPr().addNewNoProof();
+        run = p.addNewR();
+        run.addNewRPr().addNewNoProof();
+        run.addNewFldChar().setFldCharType(STFldCharType.SEPARATE);
+        // page number run
+        run = p.addNewR();
+        run.addNewRPr().addNewNoProof();
+        run.addNewT().setStringValue(Integer.valueOf(page).toString());
+        run = p.addNewR();
+        run.addNewRPr().addNewNoProof();
+        run.addNewFldChar().setFldCharType(STFldCharType.END);
+    }
+}



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


Mime
View raw message