poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n...@apache.org
Subject svn commit: r1657717 - in /poi/trunk/src: ooxml/java/org/apache/poi/xwpf/usermodel/XWPFParagraph.java scratchpad/src/org/apache/poi/wp/usermodel/Paragraph.java
Date Thu, 05 Feb 2015 23:32:00 GMT
Author: nick
Date: Thu Feb  5 23:31:59 2015
New Revision: 1657717

URL: http://svn.apache.org/r1657717
Log:
XWPF implementation of some common Paragraph methods

Modified:
    poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFParagraph.java
    poi/trunk/src/scratchpad/src/org/apache/poi/wp/usermodel/Paragraph.java

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFParagraph.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFParagraph.java?rev=1657717&r1=1657716&r2=1657717&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFParagraph.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFParagraph.java Thu Feb  5 23:31:59
2015
@@ -380,6 +380,17 @@ public class XWPFParagraph implements IB
     }
 
     /**
+     * @return The raw alignment value, {@link #getAlignment()} is suggested
+     */
+    public int getFontAlignment() {
+        return getAlignment().getValue();
+    }
+    public void setFontAlignment(int align) {
+        ParagraphAlignment pAlign = ParagraphAlignment.valueOf(align);
+        setAlignment(pAlign);
+    }
+
+    /**
      * Returns the text vertical alignment which shall be applied to text in
      * this paragraph.
      * <p/>
@@ -942,7 +953,7 @@ public class XWPFParagraph implements IB
         return (indentation != null && indentation.isSetLeft()) ? indentation.getLeft().intValue()
                 : -1;
     }
-
+    
     /**
      * Specifies the indentation which shall be placed between the right text
      * margin for this paragraph and the right edge of that paragraph's content
@@ -1061,6 +1072,27 @@ public class XWPFParagraph implements IB
                 : -1;
     }
 
+    public int getIndentFromLeft() {
+        return getIndentFromLeft();
+    }
+    public void setIndentFromLeft(int dxaLeft) {
+        setIndentationLeft(dxaLeft);
+    }
+
+    public int getIndentFromRight() {
+        return getIndentFromRight();
+    }
+    public void setIndentFromRight(int dxaRight) {
+        setIndentationRight(dxaRight);
+    }
+
+    public int getFirstLineIndent() {
+        return getIndentationFirstLine();
+    }
+    public void setFirstLineIndent(int first) {
+        setIndentationFirstLine(first);
+    }
+
     /**
      * This element specifies whether a consumer shall break Latin text which
      * exceeds the text extents of a line by breaking the word across two lines
@@ -1069,7 +1101,7 @@ public class XWPFParagraph implements IB
      *
      * @param wrap - boolean
      */
-    public void setWordWrap(boolean wrap) {
+    public void setWordWrapped(boolean wrap) {
         CTOnOff wordWrap = getCTPPr().isSetWordWrap() ? getCTPPr()
                 .getWordWrap() : getCTPPr().addNewWordWrap();
         if (wrap)
@@ -1077,6 +1109,10 @@ public class XWPFParagraph implements IB
         else
             wordWrap.unsetVal();
     }
+    @Deprecated
+    public void setWordWrap(boolean wrap) {
+        setWordWrapped(wrap);
+    }
 
     /**
      * This element specifies whether a consumer shall break Latin text which
@@ -1086,7 +1122,7 @@ public class XWPFParagraph implements IB
      *
      * @return boolean
      */
-    public boolean isWordWrap() {
+    public boolean isWordWrapped() {
         CTOnOff wordWrap = getCTPPr().isSetWordWrap() ? getCTPPr()
                 .getWordWrap() : null;
         if (wordWrap != null) {
@@ -1096,6 +1132,9 @@ public class XWPFParagraph implements IB
         }
         return false;
     }
+    public boolean isWordWrap() {
+        return isWordWrapped();
+    }
 
     /**
      * This method provides a style to the paragraph

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/wp/usermodel/Paragraph.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/wp/usermodel/Paragraph.java?rev=1657717&r1=1657716&r2=1657717&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/wp/usermodel/Paragraph.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/wp/usermodel/Paragraph.java Thu Feb  5 23:31:59
2015
@@ -47,6 +47,15 @@ public interface Paragraph {
     public void setSideBySide(boolean fSideBySide);
 */
 
+    public int getIndentFromRight();
+    public void setIndentFromRight(int dxaRight);
+
+    public int getIndentFromLeft();
+    public void setIndentFromLeft(int dxaLeft);
+
+    public int getFirstLineIndent();
+    public void setFirstLineIndent(int first);
+
 /*
     public boolean isLineNotNumbered();
     public void setLineNotNumbered(boolean fNoLnn);
@@ -57,15 +66,6 @@ public interface Paragraph {
     public boolean isWidowControlled();
     public void setWidowControl(boolean widowControl);
 
-    public int getIndentFromRight();
-    public void setIndentFromRight(int dxaRight);
-
-    public int getIndentFromLeft();
-    public void setIndentFromLeft(int dxaLeft);
-
-    public int getFirstLineIndent();
-    public void setFirstLineIndent(int first);
-
     public int getSpacingBefore();
     public void setSpacingBefore(int before);
 
@@ -76,13 +76,13 @@ public interface Paragraph {
     //  public LineSpacingDescriptor getLineSpacing();
     //  public void setLineSpacing(LineSpacingDescriptor lspd);
 
-/*
-    public boolean isWordWrapped();
-    public void setWordWrapped(boolean wrap);
-
     public int getFontAlignment();
     public void setFontAlignment(int align);
 
+    public boolean isWordWrapped();
+    public void setWordWrapped(boolean wrap);
+
+/*
     public boolean isVertical();
     public void setVertical(boolean vertical);
 
@@ -90,6 +90,7 @@ public interface Paragraph {
     public void setBackward(boolean bward);
 */
 
+    // TODO Make the HWPF and XWPF interface wrappers compatible for these
 /*
     public BorderCode getTopBorder();
     public void setTopBorder(BorderCode top);



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


Mime
View raw message