]> source.dussan.org Git - poi.git/commitdiff
Return and set paragraph indentation level
authorAlain Béarez <abearez@apache.org>
Sat, 11 Apr 2020 21:43:18 +0000 (21:43 +0000)
committerAlain Béarez <abearez@apache.org>
Sat, 11 Apr 2020 21:43:18 +0000 (21:43 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1876406 13f79535-47bb-0310-9956-ffa450edef68

src/ooxml/java/org/apache/poi/xddf/usermodel/text/XDDFTextParagraph.java

index 97082725c17fef1b049fa2df184ba80d0b9ad75e..b5e33787957bf55f044b62c9a10d86168804c90b 100644 (file)
@@ -171,6 +171,32 @@ public class XDDFTextParagraph {
         return run;
     }
 
+    /**
+     * Returns the paragraph indentation level.
+     *
+     * @return indentation level of the paragraph.
+     */
+    public int getIndentationLevel() {
+        if (_p.isSetPPr()) {
+            return getProperties().getLevel();
+        } else {
+            return 0;
+        }
+    }
+
+    /**
+     * Specifies the paragraph indentation level, between 1 and 9.
+     *
+     * @param level
+     *            new indentation level for the paragraph.
+     *            Use <code>null</code> to unset the indentation level.
+     */
+    public void setIndentationLevel(Integer level) {
+        if (_p.isSetPPr()) {
+            getProperties().setLevel(level);
+        }
+    }
+
     /**
      * Returns the alignment that is applied to the paragraph.
      *