You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by ki...@apache.org on 2015/07/08 02:09:35 UTC

svn commit: r1689777 [1/6] - in /poi/branches/common_sl: ./ src/examples/src/org/apache/poi/xslf/usermodel/ src/examples/src/org/apache/poi/xslf/usermodel/tutorial/ src/java/org/apache/poi/ddf/ src/java/org/apache/poi/util/ src/ooxml/java/org/apache/po...

Author: kiwiwings
Date: Wed Jul  8 00:09:34 2015
New Revision: 1689777

URL: http://svn.apache.org/r1689777
Log:
downgraded xjc params to jdk6 and regenerated geometry binding classes
added rendering for auto numbers
fixed various bugs on failing tests
changed xslf paragraph indent to indentLevel to align with hslf
added escher record factory subclass to hslf, to eventually make hslf wrapper classes obsolete

Added:
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/record/EscherPlaceholder.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/record/HSLFEscherRecordFactory.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/usermodel/AutoNumberingScheme.java
Removed:
    poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/ListAutoNumber.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/record/TextAutoNumberSchemeEnum.java
Modified:
    poi/branches/common_sl/build.xml
    poi/branches/common_sl/src/examples/src/org/apache/poi/xslf/usermodel/Tutorial1.java
    poi/branches/common_sl/src/examples/src/org/apache/poi/xslf/usermodel/Tutorial7.java
    poi/branches/common_sl/src/examples/src/org/apache/poi/xslf/usermodel/tutorial/Step1.java
    poi/branches/common_sl/src/java/org/apache/poi/ddf/DefaultEscherRecordFactory.java
    poi/branches/common_sl/src/java/org/apache/poi/ddf/EscherTextboxRecord.java
    poi/branches/common_sl/src/java/org/apache/poi/util/Units.java
    poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTextParagraph.java
    poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTextRun.java
    poi/branches/common_sl/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFAutoShape.java
    poi/branches/common_sl/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFTextParagraph.java
    poi/branches/common_sl/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFTextShape.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/dev/SlideShowDumper.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/dev/SlideShowRecordDumper.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/extractor/PowerPointExtractor.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/model/Line.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/model/textproperties/TextPFException9.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/record/PPDrawing.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/record/PPDrawingGroup.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/record/StyleTextProp9Atom.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFShape.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFShapeFactory.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFSheet.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFSimpleShape.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFSlide.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTable.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTextParagraph.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTextRun.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTextShape.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawTextParagraph.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawTextShape.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTAdjPoint2D.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTAdjustHandleList.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTAngle.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTColor.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTColorMRU.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTComplementTransform.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTConnection.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTConnectionSite.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTConnectionSiteList.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTCustomGeometry2D.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTEmbeddedWAVAudioFile.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTFixedPercentage.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTGammaTransform.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTGeomGuide.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTGeomGuideList.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTGeomRect.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTGrayscaleTransform.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTGroupTransform2D.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTHslColor.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTHyperlink.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTInverseGammaTransform.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTInverseTransform.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTOfficeArtExtension.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTOfficeArtExtensionList.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPath2D.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPath2DArcTo.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPath2DClose.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPath2DCubicBezierTo.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPath2DLineTo.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPath2DList.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPath2DMoveTo.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPath2DQuadBezierTo.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPercentage.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPoint2D.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPoint3D.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPolarAdjustHandle.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPositiveFixedAngle.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPositiveFixedPercentage.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPositivePercentage.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPositiveSize2D.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPresetColor.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPresetGeometry2D.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPresetTextShape.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTRatio.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTRelativeRect.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTSRgbColor.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTScRgbColor.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTScale2D.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTSchemeColor.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTSphereCoords.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTSystemColor.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTTransform2D.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTVector3D.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTXYAdjustHandle.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/ObjectFactory.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/usermodel/TextParagraph.java
    poi/branches/common_sl/src/scratchpad/testcases/org/apache/poi/hslf/extractor/TestExtractor.java
    poi/branches/common_sl/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestNumberedList.java
    poi/branches/common_sl/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestNumberedList2.java
    poi/branches/common_sl/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestNumberedList3.java
    poi/branches/common_sl/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestPicture.java

Modified: poi/branches/common_sl/build.xml
URL: http://svn.apache.org/viewvc/poi/branches/common_sl/build.xml?rev=1689777&r1=1689776&r2=1689777&view=diff
==============================================================================
--- poi/branches/common_sl/build.xml (original)
+++ poi/branches/common_sl/build.xml Wed Jul  8 00:09:34 2015
@@ -586,7 +586,7 @@ under the License.
                     <available file="${ooxml.xsds.jar}"/>
                     <available file="${ooxml.security.jar}"/>
                     <available file="${ooxml.xsds.src.jar}"/>
-                    <available file="${${ooxml.security.src.jar}"/>
+                    <available file="${ooxml.security.src.jar}"/>
             	</and>
                 <isset property="disconnected"/>
             </or>
@@ -710,7 +710,8 @@ under the License.
 			<arg value="-readOnly"/>
 			<arg value="-npa"/>
 			<arg value="-no-header"/>
-			<arg value="-Xlocator"/>
+			<!--arg value="-mark-generated"/ -->
+			<!--arg value="-Xlocator"/ -->
 			<arg file="${geometry.output.tmpdir}/dml-shapeGeometry.xsd"/>
 			<arg value="-d"/>
 			<arg file="${geometry.output.tmpdir}"/>

Modified: poi/branches/common_sl/src/examples/src/org/apache/poi/xslf/usermodel/Tutorial1.java
URL: http://svn.apache.org/viewvc/poi/branches/common_sl/src/examples/src/org/apache/poi/xslf/usermodel/Tutorial1.java?rev=1689777&r1=1689776&r2=1689777&view=diff
==============================================================================
--- poi/branches/common_sl/src/examples/src/org/apache/poi/xslf/usermodel/Tutorial1.java (original)
+++ poi/branches/common_sl/src/examples/src/org/apache/poi/xslf/usermodel/Tutorial1.java Wed Jul  8 00:09:34 2015
@@ -56,13 +56,13 @@ public class Tutorial1 {
         // we are going to add text by paragraphs. Clear the default placehoder text before that
         bodyPlaceholder.clearText();
         XSLFTextParagraph p1 = bodyPlaceholder.addNewTextParagraph();
-        p1.setLevel(0);
+        p1.setIndentLevel(0);
         p1.addNewTextRun().setText("Level1 text");
         XSLFTextParagraph p2 = bodyPlaceholder.addNewTextParagraph();
-        p2.setLevel(1);
+        p2.setIndentLevel(1);
         p2.addNewTextRun().setText("Level2 text");
         XSLFTextParagraph p3 = bodyPlaceholder.addNewTextParagraph();
-        p3.setLevel(3);
+        p3.setIndentLevel(3);
         p3.addNewTextRun().setText("Level3 text");
 
         FileOutputStream out = new FileOutputStream("slides.pptx");

Modified: poi/branches/common_sl/src/examples/src/org/apache/poi/xslf/usermodel/Tutorial7.java
URL: http://svn.apache.org/viewvc/poi/branches/common_sl/src/examples/src/org/apache/poi/xslf/usermodel/Tutorial7.java?rev=1689777&r1=1689776&r2=1689777&view=diff
==============================================================================
--- poi/branches/common_sl/src/examples/src/org/apache/poi/xslf/usermodel/Tutorial7.java (original)
+++ poi/branches/common_sl/src/examples/src/org/apache/poi/xslf/usermodel/Tutorial7.java Wed Jul  8 00:09:34 2015
@@ -23,6 +23,8 @@ import java.awt.*;
 import java.io.FileOutputStream;
 import java.io.IOException;
 
+import org.apache.poi.sl.usermodel.AutoNumberingScheme;
+
 /**
  * Bullets and numbering
  *
@@ -38,7 +40,7 @@ public class Tutorial7 {
         shape.setAnchor(new Rectangle(50, 50, 400, 200));
 
         XSLFTextParagraph p1 = shape.addNewTextParagraph();
-        p1.setLevel(0);
+        p1.setIndentLevel(0);
         p1.setBullet(true);
         XSLFTextRun r1 = p1.addNewTextRun();
         r1.setText("Bullet1");
@@ -53,26 +55,26 @@ public class Tutorial7 {
         p2.setBulletFontColor(Color.red);
         p2.setBulletFont("Wingdings");
         p2.setBulletCharacter("\u0075");
-        p2.setLevel(1);
+        p2.setIndentLevel(1);
         XSLFTextRun r2 = p2.addNewTextRun();
         r2.setText("Bullet2");
 
         // the next three paragraphs form an auto-numbered list
         XSLFTextParagraph p3 = shape.addNewTextParagraph();
-        p3.setBulletAutoNumber(ListAutoNumber.ALPHA_LC_PARENT_R, 1);
-        p3.setLevel(2);
+        p3.setBulletAutoNumber(AutoNumberingScheme.alphaLcParenRight, 1);
+        p3.setIndentLevel(2);
         XSLFTextRun r3 = p3.addNewTextRun();
         r3.setText("Numbered List Item - 1");
 
         XSLFTextParagraph p4 = shape.addNewTextParagraph();
-        p4.setBulletAutoNumber(ListAutoNumber.ALPHA_LC_PARENT_R, 2);
-        p4.setLevel(2);
+        p4.setBulletAutoNumber(AutoNumberingScheme.alphaLcParenRight, 2);
+        p4.setIndentLevel(2);
         XSLFTextRun r4 = p4.addNewTextRun();
         r4.setText("Numbered List Item - 2");
 
         XSLFTextParagraph p5 = shape.addNewTextParagraph();
-        p5.setBulletAutoNumber(ListAutoNumber.ALPHA_LC_PARENT_R, 3);
-        p5.setLevel(2);
+        p5.setBulletAutoNumber(AutoNumberingScheme.alphaLcParenRight, 3);
+        p5.setIndentLevel(2);
         XSLFTextRun r5 = p5.addNewTextRun();
         r5.setText("Numbered List Item - 3");
 

Modified: poi/branches/common_sl/src/examples/src/org/apache/poi/xslf/usermodel/tutorial/Step1.java
URL: http://svn.apache.org/viewvc/poi/branches/common_sl/src/examples/src/org/apache/poi/xslf/usermodel/tutorial/Step1.java?rev=1689777&r1=1689776&r2=1689777&view=diff
==============================================================================
--- poi/branches/common_sl/src/examples/src/org/apache/poi/xslf/usermodel/tutorial/Step1.java (original)
+++ poi/branches/common_sl/src/examples/src/org/apache/poi/xslf/usermodel/tutorial/Step1.java Wed Jul  8 00:09:34 2015
@@ -50,7 +50,7 @@ public class Step1 {
                 if(shape instanceof XSLFTextShape) {
                     XSLFTextShape tsh = (XSLFTextShape)shape;
                     for(XSLFTextParagraph p : tsh){
-                        System.out.println("Paragraph level: " + p.getLevel());
+                        System.out.println("Paragraph level: " + p.getIndentLevel());
                         for(XSLFTextRun r : p){
                             System.out.println(r.getRawText());
                             System.out.println("  bold: " + r.isBold());

Modified: poi/branches/common_sl/src/java/org/apache/poi/ddf/DefaultEscherRecordFactory.java
URL: http://svn.apache.org/viewvc/poi/branches/common_sl/src/java/org/apache/poi/ddf/DefaultEscherRecordFactory.java?rev=1689777&r1=1689776&r2=1689777&view=diff
==============================================================================
--- poi/branches/common_sl/src/java/org/apache/poi/ddf/DefaultEscherRecordFactory.java (original)
+++ poi/branches/common_sl/src/java/org/apache/poi/ddf/DefaultEscherRecordFactory.java Wed Jul  8 00:09:34 2015
@@ -117,7 +117,7 @@ public class DefaultEscherRecordFactory
      * @param recClasses The records to convert
      * @return The map containing the id/constructor pairs.
      */
-    private static Map<Short, Constructor<? extends EscherRecord>> recordsToMap(Class<?>[] recClasses) {
+    protected static Map<Short, Constructor<? extends EscherRecord>> recordsToMap(Class<?>[] recClasses) {
         Map<Short, Constructor<? extends EscherRecord>> result = new HashMap<Short, Constructor<? extends EscherRecord>>();
         final Class<?>[] EMPTY_CLASS_ARRAY = new Class[0];
 

Modified: poi/branches/common_sl/src/java/org/apache/poi/ddf/EscherTextboxRecord.java
URL: http://svn.apache.org/viewvc/poi/branches/common_sl/src/java/org/apache/poi/ddf/EscherTextboxRecord.java?rev=1689777&r1=1689776&r2=1689777&view=diff
==============================================================================
--- poi/branches/common_sl/src/java/org/apache/poi/ddf/EscherTextboxRecord.java (original)
+++ poi/branches/common_sl/src/java/org/apache/poi/ddf/EscherTextboxRecord.java Wed Jul  8 00:09:34 2015
@@ -17,10 +17,7 @@
 
 package org.apache.poi.ddf;
 
-import org.apache.poi.hslf.record.RecordTypes;
-import org.apache.poi.util.HexDump;
-import org.apache.poi.util.LittleEndian;
-import org.apache.poi.util.RecordFormatException;
+import org.apache.poi.util.*;
 
 /**
  * Holds data from the parent application. Most commonly used to store
@@ -33,7 +30,7 @@ import org.apache.poi.util.RecordFormatE
  */
 public class EscherTextboxRecord extends EscherRecord
 {
-    public static final short RECORD_ID = (short)RecordTypes.EscherClientTextbox;
+    public static final short RECORD_ID = (short)0xf00d;
     public static final String RECORD_DESCRIPTION = "msofbtClientTextbox";
 
     private static final byte[] NO_BYTES = new byte[0];

Modified: poi/branches/common_sl/src/java/org/apache/poi/util/Units.java
URL: http://svn.apache.org/viewvc/poi/branches/common_sl/src/java/org/apache/poi/util/Units.java?rev=1689777&r1=1689776&r2=1689777&view=diff
==============================================================================
--- poi/branches/common_sl/src/java/org/apache/poi/util/Units.java (original)
+++ poi/branches/common_sl/src/java/org/apache/poi/util/Units.java Wed Jul  8 00:09:34 2015
@@ -16,8 +16,6 @@
 ==================================================================== */
 package org.apache.poi.util;
 
-import org.apache.poi.hslf.usermodel.HSLFShape;
-
 /**
  * @author Yegor Kozlov
  */
@@ -91,14 +89,14 @@ public class Units {
 
     public static double masterToPoints(int masterDPI) {
         double points = masterDPI;
-        points *= HSLFShape.POINT_DPI;
-        points /= HSLFShape.MASTER_DPI;
+        points *= POINT_DPI;
+        points /= MASTER_DPI;
         return points;
     }
     
     public static int pointsToMaster(double points) {
-        points *= HSLFShape.MASTER_DPI;
-        points /= HSLFShape.POINT_DPI;
+        points *= MASTER_DPI;
+        points /= POINT_DPI;
         return (int)points;
     }
 }

Modified: poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTextParagraph.java
URL: http://svn.apache.org/viewvc/poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTextParagraph.java?rev=1689777&r1=1689776&r2=1689777&view=diff
==============================================================================
--- poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTextParagraph.java (original)
+++ poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTextParagraph.java Wed Jul  8 00:09:34 2015
@@ -19,6 +19,7 @@ package org.apache.poi.xslf.usermodel;
 import java.awt.Color;
 import java.util.*;
 
+import org.apache.poi.sl.usermodel.AutoNumberingScheme;
 import org.apache.poi.sl.usermodel.TextParagraph;
 import org.apache.poi.util.*;
 import org.apache.poi.xslf.model.ParagraphPropertyFetcher;
@@ -143,7 +144,7 @@ public class XSLFTextParagraph implement
      * @return alignment that is applied to the paragraph
      */
     public TextAlign getTextAlign(){
-        ParagraphPropertyFetcher<TextAlign> fetcher = new ParagraphPropertyFetcher<TextAlign>(getLevel()){
+        ParagraphPropertyFetcher<TextAlign> fetcher = new ParagraphPropertyFetcher<TextAlign>(getIndentLevel()){
             public boolean fetch(CTTextParagraphProperties props){
                 if(props.isSetAlgn()){
                     TextAlign val = TextAlign.values()[props.getAlgn().intValue() - 1];
@@ -175,7 +176,7 @@ public class XSLFTextParagraph implement
 
     @Override
     public FontAlign getFontAlign(){
-        ParagraphPropertyFetcher<FontAlign> fetcher = new ParagraphPropertyFetcher<FontAlign>(getLevel()){
+        ParagraphPropertyFetcher<FontAlign> fetcher = new ParagraphPropertyFetcher<FontAlign>(getIndentLevel()){
             public boolean fetch(CTTextParagraphProperties props){
                 if(props.isSetFontAlgn()){
                     FontAlign val = FontAlign.values()[props.getFontAlgn().intValue() - 1];
@@ -211,7 +212,7 @@ public class XSLFTextParagraph implement
      * @return the font to be used on bullet characters within a given paragraph
      */
     public String getBulletFont(){
-        ParagraphPropertyFetcher<String> fetcher = new ParagraphPropertyFetcher<String>(getLevel()){
+        ParagraphPropertyFetcher<String> fetcher = new ParagraphPropertyFetcher<String>(getIndentLevel()){
             public boolean fetch(CTTextParagraphProperties props){
                 if(props.isSetBuFont()){
                     setValue(props.getBuFont().getTypeface());
@@ -234,7 +235,7 @@ public class XSLFTextParagraph implement
      * @return the character to be used in place of the standard bullet point
      */
     public String getBulletCharacter(){
-        ParagraphPropertyFetcher<String> fetcher = new ParagraphPropertyFetcher<String>(getLevel()){
+        ParagraphPropertyFetcher<String> fetcher = new ParagraphPropertyFetcher<String>(getIndentLevel()){
             public boolean fetch(CTTextParagraphProperties props){
                 if(props.isSetBuChar()){
                     setValue(props.getBuChar().getChar());
@@ -260,7 +261,7 @@ public class XSLFTextParagraph implement
      */
     public Color getBulletFontColor(){
         final XSLFTheme theme = getParentShape().getSheet().getTheme();
-        ParagraphPropertyFetcher<Color> fetcher = new ParagraphPropertyFetcher<Color>(getLevel()){
+        ParagraphPropertyFetcher<Color> fetcher = new ParagraphPropertyFetcher<Color>(getIndentLevel()){
             public boolean fetch(CTTextParagraphProperties props){
                 if(props.isSetBuClr()){
                     XSLFColor c = new XSLFColor(props.getBuClr(), theme, null);
@@ -297,7 +298,7 @@ public class XSLFTextParagraph implement
      * @return the bullet size
      */
     public Double getBulletFontSize(){
-        ParagraphPropertyFetcher<Double> fetcher = new ParagraphPropertyFetcher<Double>(getLevel()){
+        ParagraphPropertyFetcher<Double> fetcher = new ParagraphPropertyFetcher<Double>(getIndentLevel()){
             public boolean fetch(CTTextParagraphProperties props){
                 if(props.isSetBuSzPct()){
                     setValue(props.getBuSzPct().getVal() * 0.001);
@@ -336,6 +337,46 @@ public class XSLFTextParagraph implement
         }
    }
 
+    /**
+     * @return the auto numbering scheme, or null if not defined
+     */
+    public AutoNumberingScheme getAutoNumberingScheme() {
+        ParagraphPropertyFetcher<AutoNumberingScheme> fetcher = new ParagraphPropertyFetcher<AutoNumberingScheme>(getIndentLevel()) {
+            public boolean fetch(CTTextParagraphProperties props) {
+                if (props.isSetBuAutoNum()) {
+                    AutoNumberingScheme ans = AutoNumberingScheme.forOoxmlID(props.getBuAutoNum().getType().intValue());
+                    if (ans != null) {
+                        setValue(ans);
+                        return true;
+                    }
+                }
+                return false;
+            }
+        };
+        fetchParagraphProperty(fetcher);
+        return fetcher.getValue();
+    }
+
+    /**
+     * @return the auto numbering starting number, or null if not defined
+     */
+    public Integer getAutoNumberingStartAt() {
+        ParagraphPropertyFetcher<Integer> fetcher = new ParagraphPropertyFetcher<Integer>(getIndentLevel()) {
+            public boolean fetch(CTTextParagraphProperties props) {
+                if (props.isSetBuAutoNum()) {
+                    if (props.getBuAutoNum().isSetStartAt()) {
+                        setValue(props.getBuAutoNum().getStartAt());
+                        return true;
+                    }
+                }
+                return false;
+            }
+        };
+        fetchParagraphProperty(fetcher);
+        return fetcher.getValue();
+    }
+    
+    
     @Override
     public void setIndent(Double indent){
         if (indent == null && !_p.isSetPPr()) return;
@@ -350,7 +391,7 @@ public class XSLFTextParagraph implement
     @Override
     public Double getIndent() {
 
-        ParagraphPropertyFetcher<Double> fetcher = new ParagraphPropertyFetcher<Double>(getLevel()){
+        ParagraphPropertyFetcher<Double> fetcher = new ParagraphPropertyFetcher<Double>(getIndentLevel()){
             public boolean fetch(CTTextParagraphProperties props){
                 if(props.isSetIndent()){
                     setValue(Units.toPoints(props.getIndent()));
@@ -381,7 +422,7 @@ public class XSLFTextParagraph implement
      */
     @Override
     public Double getLeftMargin(){
-        ParagraphPropertyFetcher<Double> fetcher = new ParagraphPropertyFetcher<Double>(getLevel()){
+        ParagraphPropertyFetcher<Double> fetcher = new ParagraphPropertyFetcher<Double>(getIndentLevel()){
             public boolean fetch(CTTextParagraphProperties props){
                 if(props.isSetMarL()){
                     double val = Units.toPoints(props.getMarL());
@@ -413,7 +454,7 @@ public class XSLFTextParagraph implement
      */
     @Override
     public Double getRightMargin(){
-        ParagraphPropertyFetcher<Double> fetcher = new ParagraphPropertyFetcher<Double>(getLevel()){
+        ParagraphPropertyFetcher<Double> fetcher = new ParagraphPropertyFetcher<Double>(getIndentLevel()){
             public boolean fetch(CTTextParagraphProperties props){
                 if(props.isSetMarR()){
                     double val = Units.toPoints(props.getMarR());
@@ -424,13 +465,12 @@ public class XSLFTextParagraph implement
             }
         };
         fetchParagraphProperty(fetcher);
-        // if the marL attribute is omitted, then a value of 347663 is implied
         return fetcher.getValue();
     }
 
     @Override
     public Double getDefaultTabSize(){
-        ParagraphPropertyFetcher<Double> fetcher = new ParagraphPropertyFetcher<Double>(getLevel()){
+        ParagraphPropertyFetcher<Double> fetcher = new ParagraphPropertyFetcher<Double>(getIndentLevel()){
             public boolean fetch(CTTextParagraphProperties props){
                 if(props.isSetDefTabSz()){
                     double val = Units.toPoints(props.getDefTabSz());
@@ -445,7 +485,7 @@ public class XSLFTextParagraph implement
     }
 
     public double getTabStop(final int idx){
-        ParagraphPropertyFetcher<Double> fetcher = new ParagraphPropertyFetcher<Double>(getLevel()){
+        ParagraphPropertyFetcher<Double> fetcher = new ParagraphPropertyFetcher<Double>(getIndentLevel()){
             public boolean fetch(CTTextParagraphProperties props){
                 if(props.isSetTabLst()){
                     CTTextTabStopList tabStops = props.getTabLst();
@@ -489,7 +529,7 @@ public class XSLFTextParagraph implement
 
     @Override
     public Double getLineSpacing(){
-        ParagraphPropertyFetcher<Double> fetcher = new ParagraphPropertyFetcher<Double>(getLevel()){
+        ParagraphPropertyFetcher<Double> fetcher = new ParagraphPropertyFetcher<Double>(getIndentLevel()){
             public boolean fetch(CTTextParagraphProperties props){
                 if(props.isSetLnSpc()){
                     CTTextSpacing spc = props.getLnSpc();
@@ -528,7 +568,7 @@ public class XSLFTextParagraph implement
 
     @Override
     public Double getSpaceBefore(){
-        ParagraphPropertyFetcher<Double> fetcher = new ParagraphPropertyFetcher<Double>(getLevel()){
+        ParagraphPropertyFetcher<Double> fetcher = new ParagraphPropertyFetcher<Double>(getIndentLevel()){
             public boolean fetch(CTTextParagraphProperties props){
                 if(props.isSetSpcBef()){
                     CTTextSpacing spc = props.getSpcBef();
@@ -556,7 +596,7 @@ public class XSLFTextParagraph implement
 
     @Override
     public Double getSpaceAfter(){
-        ParagraphPropertyFetcher<Double> fetcher = new ParagraphPropertyFetcher<Double>(getLevel()){
+        ParagraphPropertyFetcher<Double> fetcher = new ParagraphPropertyFetcher<Double>(getIndentLevel()){
             public boolean fetch(CTTextParagraphProperties props){
                 if(props.isSetSpcAft()){
                     CTTextSpacing spc = props.getSpcAft();
@@ -572,23 +612,14 @@ public class XSLFTextParagraph implement
         return fetcher.getValue();
     }
 
-    /**
-     * Specifies the particular level text properties that this paragraph will follow.
-     * The value for this attribute formats the text according to the corresponding level
-     * paragraph properties defined in the SlideMaster.
-     *
-     * @param level the level (0 ... 4)
-     */
-    public void setLevel(int level){
+    @Override
+    public void setIndentLevel(int level){
         CTTextParagraphProperties pr = _p.isSetPPr() ? _p.getPPr() : _p.addNewPPr();
         pr.setLvl(level);
     }
 
-    /**
-     *
-     * @return the text level of this paragraph (0-based). Default is 0.
-     */
-    public int getLevel(){
+    @Override
+    public int getIndentLevel() {
         CTTextParagraphProperties pr = _p.getPPr();
         return (pr == null || !pr.isSetLvl()) ? 0 : pr.getLvl();
     }
@@ -597,7 +628,7 @@ public class XSLFTextParagraph implement
      * Returns whether this paragraph has bullets
      */
     public boolean isBullet() {
-        ParagraphPropertyFetcher<Boolean> fetcher = new ParagraphPropertyFetcher<Boolean>(getLevel()){
+        ParagraphPropertyFetcher<Boolean> fetcher = new ParagraphPropertyFetcher<Boolean>(getIndentLevel()){
             public boolean fetch(CTTextParagraphProperties props){
                 if(props.isSetBuNone()) {
                     setValue(false);
@@ -637,11 +668,11 @@ public class XSLFTextParagraph implement
      * @param startAt the number that will start number for a given sequence of automatically
     numbered bullets (1-based).
      */
-    public void setBulletAutoNumber(ListAutoNumber scheme, int startAt) {
+    public void setBulletAutoNumber(AutoNumberingScheme scheme, int startAt) {
         if(startAt < 1) throw new IllegalArgumentException("Start Number must be greater or equal that 1") ;
         CTTextParagraphProperties pr = _p.isSetPPr() ? _p.getPPr() : _p.addNewPPr();
         CTTextAutonumberBullet lst = pr.isSetBuAutoNum() ? pr.getBuAutoNum() : pr.addNewBuAutoNum();
-        lst.setType(STTextAutonumberScheme.Enum.forInt(scheme.ordinal() + 1));
+        lst.setType(STTextAutonumberScheme.Enum.forInt(scheme.ooxmlId));
         lst.setStartAt(startAt);
     }
 
@@ -669,28 +700,29 @@ public class XSLFTextParagraph implement
                 defaultStyleSelector = "bodyStyle";
                 break;
         }
-        int level = getLevel();
+        int level = getIndentLevel();
 
         // wind up and find the root master sheet which must be slide master
-        XSLFSheet masterSheet = _shape.getSheet();
-        for (XSLFSheet m = masterSheet; m != null; m = (XSLFSheet)m.getMasterSheet()) {
-            masterSheet = m;
-        }
-
-        String nsDecl =
+        final String nsDecl =
             "declare namespace p='http://schemas.openxmlformats.org/presentationml/2006/main' " +
             "declare namespace a='http://schemas.openxmlformats.org/drawingml/2006/main' ";
-        String xpaths[] = {
+        final String xpaths[] = {
             nsDecl+".//p:txStyles/p:" + defaultStyleSelector +"/a:lvl" +(level+1)+ "pPr",
             nsDecl+".//p:notesStyle/a:lvl" +(level+1)+ "pPr"
         };
-        XmlObject xo = masterSheet.getXmlObject();
-        for (String xpath : xpaths) {
-            XmlObject[] o = xo.selectPath(xpath);
-            if (o.length == 1) {
-                return (CTTextParagraphProperties)o[0];
+        XSLFSheet masterSheet = _shape.getSheet();
+        for (XSLFSheet m = masterSheet; m != null; m = (XSLFSheet)m.getMasterSheet()) {
+            masterSheet = m;
+
+            XmlObject xo = masterSheet.getXmlObject();
+            for (String xpath : xpaths) {
+                XmlObject[] o = xo.selectPath(xpath);
+                if (o.length == 1) {
+                    return (CTTextParagraphProperties)o[0];
+                }
             }
         }
+
         
 //        for (CTTextBody txBody : (CTTextBody[])xo.selectPath(nsDecl+".//p:txBody")) {
 //            CTTextParagraphProperties defaultPr = null, lastPr = null;
@@ -730,7 +762,7 @@ public class XSLFTextParagraph implement
                 if(ph == null){
                     // if it is a plain text box then take defaults from presentation.xml
                     XMLSlideShow ppt = getParentShape().getSheet().getSlideShow();
-                    CTTextParagraphProperties themeProps = ppt.getDefaultParagraphStyle(getLevel());
+                    CTTextParagraphProperties themeProps = ppt.getDefaultParagraphStyle(getIndentLevel());
                     if(themeProps != null) ok = visitor.fetch(themeProps);
                 }
 
@@ -817,24 +849,40 @@ public class XSLFTextParagraph implement
         return (_runs.isEmpty() ? "Arial" : _runs.get(0).getFontFamily());
     }
 
+    @Override
     public BulletStyle getBulletStyle() {
         if (!isBullet()) return null;
         return new BulletStyle(){
+            @Override
             public String getBulletCharacter() {
                 return XSLFTextParagraph.this.getBulletCharacter();
             }
 
+            @Override
             public String getBulletFont() {
                 return XSLFTextParagraph.this.getBulletFont();
             }
 
+            @Override
             public Double getBulletFontSize() {
                 return XSLFTextParagraph.this.getBulletFontSize();
             }
 
+            @Override
             public Color getBulletFontColor() {
                 return XSLFTextParagraph.this.getBulletFontColor();
             }
+            
+            @Override
+            public AutoNumberingScheme getAutoNumberingScheme() {
+                return XSLFTextParagraph.this.getAutoNumberingScheme();
+            }
+
+            @Override
+            public Integer getAutoNumberingStartAt() {
+                return XSLFTextParagraph.this.getAutoNumberingStartAt();
+            }
+
         };
     }
 }

Modified: poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTextRun.java
URL: http://svn.apache.org/viewvc/poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTextRun.java?rev=1689777&r1=1689776&r2=1689777&view=diff
==============================================================================
--- poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTextRun.java (original)
+++ poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTextRun.java Wed Jul  8 00:09:34 2015
@@ -101,7 +101,7 @@ public class XSLFTextRun implements Text
         CTShapeStyle style = _p.getParentShape().getSpStyle();
         final CTSchemeColor phClr = style == null ? null : style.getFontRef().getSchemeClr();
 
-        CharacterPropertyFetcher<Color> fetcher = new CharacterPropertyFetcher<Color>(_p.getLevel()){
+        CharacterPropertyFetcher<Color> fetcher = new CharacterPropertyFetcher<Color>(_p.getIndentLevel()){
             public boolean fetch(CTTextCharacterProperties props){
                 CTSolidColorFillProperties solidFill = props.getSolidFill();
                 if(solidFill != null) {
@@ -146,7 +146,7 @@ public class XSLFTextRun implements Text
         CTTextNormalAutofit afit = getParentParagraph().getParentShape().getTextBodyPr().getNormAutofit();
         if(afit != null) scale = (double)afit.getFontScale() / 100000;
 
-        CharacterPropertyFetcher<Double> fetcher = new CharacterPropertyFetcher<Double>(_p.getLevel()){
+        CharacterPropertyFetcher<Double> fetcher = new CharacterPropertyFetcher<Double>(_p.getIndentLevel()){
             public boolean fetch(CTTextCharacterProperties props){
                 if(props.isSetSz()){
                     setValue(props.getSz()*0.01);
@@ -166,7 +166,7 @@ public class XSLFTextRun implements Text
      */
     public double getCharacterSpacing(){
 
-        CharacterPropertyFetcher<Double> fetcher = new CharacterPropertyFetcher<Double>(_p.getLevel()){
+        CharacterPropertyFetcher<Double> fetcher = new CharacterPropertyFetcher<Double>(_p.getIndentLevel()){
             public boolean fetch(CTTextCharacterProperties props){
                 if(props.isSetSpc()){
                     setValue(props.getSpc()*0.01);
@@ -233,7 +233,7 @@ public class XSLFTextRun implements Text
     public String getFontFamily(){
         final XSLFTheme theme = _p.getParentShape().getSheet().getTheme();
 
-        CharacterPropertyFetcher<String> visitor = new CharacterPropertyFetcher<String>(_p.getLevel()){
+        CharacterPropertyFetcher<String> visitor = new CharacterPropertyFetcher<String>(_p.getIndentLevel()){
             public boolean fetch(CTTextCharacterProperties props){
                 CTTextFont font = props.getLatin();
                 if(font != null){
@@ -257,7 +257,7 @@ public class XSLFTextRun implements Text
     public byte getPitchAndFamily(){
         final XSLFTheme theme = _p.getParentShape().getSheet().getTheme();
 
-        CharacterPropertyFetcher<Byte> visitor = new CharacterPropertyFetcher<Byte>(_p.getLevel()){
+        CharacterPropertyFetcher<Byte> visitor = new CharacterPropertyFetcher<Byte>(_p.getIndentLevel()){
             public boolean fetch(CTTextCharacterProperties props){
                 CTTextFont font = props.getLatin();
                 if(font != null){
@@ -285,7 +285,7 @@ public class XSLFTextRun implements Text
      * @return whether a run of text will be formatted as strikethrough text. Default is false.
      */
     public boolean isStrikethrough() {
-        CharacterPropertyFetcher<Boolean> fetcher = new CharacterPropertyFetcher<Boolean>(_p.getLevel()){
+        CharacterPropertyFetcher<Boolean> fetcher = new CharacterPropertyFetcher<Boolean>(_p.getIndentLevel()){
             public boolean fetch(CTTextCharacterProperties props){
                 if(props.isSetStrike()){
                     setValue(props.getStrike() != STTextStrikeType.NO_STRIKE);
@@ -302,7 +302,7 @@ public class XSLFTextRun implements Text
      * @return whether a run of text will be formatted as a superscript text. Default is false.
      */
     public boolean isSuperscript() {
-        CharacterPropertyFetcher<Boolean> fetcher = new CharacterPropertyFetcher<Boolean>(_p.getLevel()){
+        CharacterPropertyFetcher<Boolean> fetcher = new CharacterPropertyFetcher<Boolean>(_p.getIndentLevel()){
             public boolean fetch(CTTextCharacterProperties props){
                 if(props.isSetBaseline()){
                     setValue(props.getBaseline() > 0);
@@ -352,7 +352,7 @@ public class XSLFTextRun implements Text
      * @return whether a run of text will be formatted as a superscript text. Default is false.
      */
     public boolean isSubscript() {
-        CharacterPropertyFetcher<Boolean> fetcher = new CharacterPropertyFetcher<Boolean>(_p.getLevel()){
+        CharacterPropertyFetcher<Boolean> fetcher = new CharacterPropertyFetcher<Boolean>(_p.getIndentLevel()){
             public boolean fetch(CTTextCharacterProperties props){
                 if(props.isSetBaseline()){
                     setValue(props.getBaseline() < 0);
@@ -369,7 +369,7 @@ public class XSLFTextRun implements Text
      * @return whether a run of text will be formatted as a superscript text. Default is false.
      */
     public TextCap getTextCap() {
-        CharacterPropertyFetcher<TextCap> fetcher = new CharacterPropertyFetcher<TextCap>(_p.getLevel()){
+        CharacterPropertyFetcher<TextCap> fetcher = new CharacterPropertyFetcher<TextCap>(_p.getIndentLevel()){
             public boolean fetch(CTTextCharacterProperties props){
                 if(props.isSetCap()){
                     int idx = props.getCap().intValue() - 1;
@@ -396,7 +396,7 @@ public class XSLFTextRun implements Text
      * @return whether this run of text is formatted as bold text
      */
     public boolean isBold(){
-        CharacterPropertyFetcher<Boolean> fetcher = new CharacterPropertyFetcher<Boolean>(_p.getLevel()){
+        CharacterPropertyFetcher<Boolean> fetcher = new CharacterPropertyFetcher<Boolean>(_p.getIndentLevel()){
             public boolean fetch(CTTextCharacterProperties props){
                 if(props.isSetB()){
                     setValue(props.getB());
@@ -420,7 +420,7 @@ public class XSLFTextRun implements Text
      * @return whether this run of text is formatted as italic text
      */
     public boolean isItalic(){
-        CharacterPropertyFetcher<Boolean> fetcher = new CharacterPropertyFetcher<Boolean>(_p.getLevel()){
+        CharacterPropertyFetcher<Boolean> fetcher = new CharacterPropertyFetcher<Boolean>(_p.getIndentLevel()){
             public boolean fetch(CTTextCharacterProperties props){
                 if(props.isSetI()){
                     setValue(props.getI());
@@ -444,7 +444,7 @@ public class XSLFTextRun implements Text
      * @return whether this run of text is formatted as underlined text
      */
     public boolean isUnderlined(){
-        CharacterPropertyFetcher<Boolean> fetcher = new CharacterPropertyFetcher<Boolean>(_p.getLevel()){
+        CharacterPropertyFetcher<Boolean> fetcher = new CharacterPropertyFetcher<Boolean>(_p.getIndentLevel()){
             public boolean fetch(CTTextCharacterProperties props){
                 if(props.isSetU()){
                     setValue(props.getU() != STTextUnderlineType.NONE);
@@ -491,7 +491,7 @@ public class XSLFTextRun implements Text
                 if(ph == null){
                     // if it is a plain text box then take defaults from presentation.xml
                     XMLSlideShow ppt = shape.getSheet().getSlideShow();
-                    CTTextParagraphProperties themeProps = ppt.getDefaultParagraphStyle(_p.getLevel());
+                    CTTextParagraphProperties themeProps = ppt.getDefaultParagraphStyle(_p.getIndentLevel());
                     if(themeProps != null) {
                         fetcher.isFetchingFromMaster = true;
                         ok = fetcher.fetch(themeProps);

Modified: poi/branches/common_sl/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFAutoShape.java
URL: http://svn.apache.org/viewvc/poi/branches/common_sl/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFAutoShape.java?rev=1689777&r1=1689776&r2=1689777&view=diff
==============================================================================
--- poi/branches/common_sl/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFAutoShape.java (original)
+++ poi/branches/common_sl/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFAutoShape.java Wed Jul  8 00:09:34 2015
@@ -120,7 +120,7 @@ public class TestXSLFAutoShape {
         assertEquals(100., p.getLineSpacing(), 0);
         assertEquals(0., p.getSpaceAfter(), 0);
         assertEquals(0., p.getSpaceBefore(), 0);
-        assertEquals(0, p.getLevel());
+        assertEquals(0, p.getIndentLevel());
 
         p.setIndent(2.0);
         assertEquals(2.0, p.getIndent(), 0);
@@ -134,11 +134,11 @@ public class TestXSLFAutoShape {
 
 
         assertFalse(p.getXmlObject().getPPr().isSetLvl());
-        p.setLevel(1);
-        assertEquals(1, p.getLevel());
+        p.setIndentLevel(1);
+        assertEquals(1, p.getIndentLevel());
         assertTrue(p.getXmlObject().getPPr().isSetLvl());
-        p.setLevel(2);
-        assertEquals(2, p.getLevel());
+        p.setIndentLevel(2);
+        assertEquals(2, p.getIndentLevel());
 
         p.setLeftMargin(2.0);
         assertEquals(2.0, p.getLeftMargin(), 0);

Modified: poi/branches/common_sl/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFTextParagraph.java
URL: http://svn.apache.org/viewvc/poi/branches/common_sl/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFTextParagraph.java?rev=1689777&r1=1689776&r2=1689777&view=diff
==============================================================================
--- poi/branches/common_sl/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFTextParagraph.java (original)
+++ poi/branches/common_sl/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFTextParagraph.java Wed Jul  8 00:09:34 2015
@@ -25,6 +25,7 @@ import java.util.List;
 
 import org.apache.poi.sl.draw.DrawTextFragment;
 import org.apache.poi.sl.draw.DrawTextParagraph;
+import org.apache.poi.sl.usermodel.AutoNumberingScheme;
 import org.apache.poi.sl.usermodel.TextParagraph.TextAlign;
 import org.apache.poi.util.POILogFactory;
 import org.apache.poi.util.POILogger;
@@ -297,11 +298,11 @@ public class TestXSLFTextParagraph {
         p.setLeftMargin(-1.0); // the value of -1.0 resets to the defaults
         assertEquals(0.0, p.getLeftMargin(), 0);
 
-        assertEquals(0, p.getLevel());
-        p.setLevel(1);
-        assertEquals(1, p.getLevel());
-        p.setLevel(2);
-        assertEquals(2, p.getLevel());
+        assertEquals(0, p.getIndentLevel());
+        p.setIndentLevel(1);
+        assertEquals(1, p.getIndentLevel());
+        p.setIndentLevel(2);
+        assertEquals(2, p.getIndentLevel());
 
         assertEquals(100., p.getLineSpacing(), 0);
         p.setLineSpacing(200.);
@@ -328,7 +329,7 @@ public class TestXSLFTextParagraph {
         p.setBullet(false);
         assertFalse(p.isBullet());
 
-        p.setBulletAutoNumber(ListAutoNumber.ALPHA_LC_PARENT_BOTH, 1);
+        p.setBulletAutoNumber(AutoNumberingScheme.alphaLcParenBoth, 1);
 
         double tabStop = p.getTabStop(0);
         assertEquals(0.0, tabStop, 0);

Modified: poi/branches/common_sl/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFTextShape.java
URL: http://svn.apache.org/viewvc/poi/branches/common_sl/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFTextShape.java?rev=1689777&r1=1689776&r2=1689777&view=diff
==============================================================================
--- poi/branches/common_sl/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFTextShape.java (original)
+++ poi/branches/common_sl/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFTextShape.java Wed Jul  8 00:09:34 2015
@@ -180,7 +180,7 @@ public class TestXSLFTextShape {
         assertEquals(VerticalAlignment.TOP, shape2.getVerticalAlignment());
 
         XSLFTextRun pr1 = shape2.getTextParagraphs().get(0).getTextRuns().get(0);
-        assertEquals(0, pr1.getParentParagraph().getLevel());
+        assertEquals(0, pr1.getParentParagraph().getIndentLevel());
         assertEquals("Content", pr1.getRawText());
         assertEquals("Calibri", pr1.getFontFamily());
         assertEquals(32.0, pr1.getFontSize(), 0);
@@ -189,7 +189,7 @@ public class TestXSLFTextShape {
         assertEquals("Arial", pr1.getParentParagraph().getBulletFont());
 
         XSLFTextRun pr2 = shape2.getTextParagraphs().get(1).getTextRuns().get(0);
-        assertEquals(1, pr2.getParentParagraph().getLevel());
+        assertEquals(1, pr2.getParentParagraph().getIndentLevel());
         assertEquals("Level 2", pr2.getRawText());
         assertEquals("Calibri", pr2.getFontFamily());
         assertEquals(28.0, pr2.getFontSize(), 0);
@@ -198,7 +198,7 @@ public class TestXSLFTextShape {
         assertEquals("Arial", pr2.getParentParagraph().getBulletFont());
 
         XSLFTextRun pr3 = shape2.getTextParagraphs().get(2).getTextRuns().get(0);
-        assertEquals(2, pr3.getParentParagraph().getLevel());
+        assertEquals(2, pr3.getParentParagraph().getIndentLevel());
         assertEquals("Level 3", pr3.getRawText());
         assertEquals("Calibri", pr3.getFontFamily());
         assertEquals(24.0, pr3.getFontSize(), 0);
@@ -207,7 +207,7 @@ public class TestXSLFTextShape {
         assertEquals("Arial", pr3.getParentParagraph().getBulletFont());
 
         XSLFTextRun pr4 = shape2.getTextParagraphs().get(3).getTextRuns().get(0);
-        assertEquals(3, pr4.getParentParagraph().getLevel());
+        assertEquals(3, pr4.getParentParagraph().getIndentLevel());
         assertEquals("Level 4", pr4.getRawText());
         assertEquals("Calibri", pr4.getFontFamily());
         assertEquals(20.0, pr4.getFontSize(), 0);
@@ -216,7 +216,7 @@ public class TestXSLFTextShape {
         assertEquals("Arial", pr4.getParentParagraph().getBulletFont());
 
         XSLFTextRun pr5 = shape2.getTextParagraphs().get(4).getTextRuns().get(0);
-        assertEquals(4, pr5.getParentParagraph().getLevel());
+        assertEquals(4, pr5.getParentParagraph().getIndentLevel());
         assertEquals("Level 5", pr5.getRawText());
         assertEquals("Calibri", pr5.getFontFamily());
         assertEquals(20.0, pr5.getFontSize(), 0);
@@ -362,7 +362,7 @@ public class TestXSLFTextShape {
         assertEquals(VerticalAlignment.TOP, shape2.getVerticalAlignment());
 
         XSLFTextRun pr1 = shape2.getTextParagraphs().get(0).getTextRuns().get(0);
-        assertEquals(0, pr1.getParentParagraph().getLevel());
+        assertEquals(0, pr1.getParentParagraph().getIndentLevel());
         assertEquals("Left", pr1.getRawText());
         assertEquals("Calibri", pr1.getFontFamily());
         assertEquals(28.0, pr1.getFontSize(), 0);
@@ -371,7 +371,7 @@ public class TestXSLFTextShape {
         assertEquals("Arial", pr1.getParentParagraph().getBulletFont());
 
         XSLFTextRun pr2 = shape2.getTextParagraphs().get(1).getTextRuns().get(0);
-        assertEquals(1, pr2.getParentParagraph().getLevel());
+        assertEquals(1, pr2.getParentParagraph().getIndentLevel());
         assertEquals("Level 2", pr2.getParentParagraph().getText());
         assertEquals("Calibri", pr2.getFontFamily());
         assertEquals(24.0, pr2.getFontSize(), 0);
@@ -380,7 +380,7 @@ public class TestXSLFTextShape {
         assertEquals("Arial", pr2.getParentParagraph().getBulletFont());
 
         XSLFTextRun pr3 = shape2.getTextParagraphs().get(2).getTextRuns().get(0);
-        assertEquals(2, pr3.getParentParagraph().getLevel());
+        assertEquals(2, pr3.getParentParagraph().getIndentLevel());
         assertEquals("Level 3", pr3.getParentParagraph().getText());
         assertEquals("Calibri", pr3.getFontFamily());
         assertEquals(20.0, pr3.getFontSize(), 0);
@@ -389,7 +389,7 @@ public class TestXSLFTextShape {
         assertEquals("Arial", pr3.getParentParagraph().getBulletFont());
 
         XSLFTextRun pr4 = shape2.getTextParagraphs().get(3).getTextRuns().get(0);
-        assertEquals(3, pr4.getParentParagraph().getLevel());
+        assertEquals(3, pr4.getParentParagraph().getIndentLevel());
         assertEquals("Level 4", pr4.getParentParagraph().getText());
         assertEquals("Calibri", pr4.getFontFamily());
         assertEquals(18.0, pr4.getFontSize(), 0);
@@ -399,7 +399,7 @@ public class TestXSLFTextShape {
 
         XSLFTextShape shape3 = (XSLFTextShape)shapes.get(2);
         XSLFTextRun pr5 = shape3.getTextParagraphs().get(0).getTextRuns().get(0);
-        assertEquals(0, pr5.getParentParagraph().getLevel());
+        assertEquals(0, pr5.getParentParagraph().getIndentLevel());
         assertEquals("Right", pr5.getRawText());
         assertEquals("Calibri", pr5.getFontFamily());
         assertEquals(Color.black, pr5.getFontColor());
@@ -461,7 +461,7 @@ public class TestXSLFTextShape {
         assertEquals(VerticalAlignment.TOP, shape2.getVerticalAlignment());
 
         XSLFTextRun pr1 = shape2.getTextParagraphs().get(0).getTextRuns().get(0);
-        assertEquals(0, pr1.getParentParagraph().getLevel());
+        assertEquals(0, pr1.getParentParagraph().getIndentLevel());
         assertEquals("Default Text", pr1.getRawText());
         assertEquals("Calibri", pr1.getFontFamily());
         assertEquals(18.0, pr1.getFontSize(), 0);
@@ -544,7 +544,7 @@ public class TestXSLFTextShape {
         assertEquals(VerticalAlignment.TOP, shape2.getVerticalAlignment());
 
         XSLFTextRun pr1 = shape2.getTextParagraphs().get(0).getTextRuns().get(0);
-        assertEquals(0, pr1.getParentParagraph().getLevel());
+        assertEquals(0, pr1.getParentParagraph().getIndentLevel());
         assertEquals("Level 1", pr1.getRawText());
         assertEquals("Calibri", pr1.getFontFamily());
         assertEquals(32.0, pr1.getFontSize(), 0);
@@ -553,7 +553,7 @@ public class TestXSLFTextShape {
         assertEquals("Arial", pr1.getParentParagraph().getBulletFont());
 
         XSLFTextRun pr2 = shape2.getTextParagraphs().get(1).getTextRuns().get(0);
-        assertEquals(1, pr2.getParentParagraph().getLevel());
+        assertEquals(1, pr2.getParentParagraph().getIndentLevel());
         assertEquals("Level 2", pr2.getParentParagraph().getText());
         assertEquals("Calibri", pr2.getFontFamily());
         assertEquals(28.0, pr2.getFontSize(), 0);
@@ -562,7 +562,7 @@ public class TestXSLFTextShape {
         assertEquals("Arial", pr2.getParentParagraph().getBulletFont());
 
         XSLFTextRun pr3 = shape2.getTextParagraphs().get(2).getTextRuns().get(0);
-        assertEquals(2, pr3.getParentParagraph().getLevel());
+        assertEquals(2, pr3.getParentParagraph().getIndentLevel());
         assertEquals("Level 3", pr3.getParentParagraph().getText());
         assertEquals("Calibri", pr3.getFontFamily());
         assertEquals(24.0, pr3.getFontSize(), 0);
@@ -571,7 +571,7 @@ public class TestXSLFTextShape {
         assertEquals("Arial", pr3.getParentParagraph().getBulletFont());
 
         XSLFTextRun pr4 = shape2.getTextParagraphs().get(3).getTextRuns().get(0);
-        assertEquals(3, pr4.getParentParagraph().getLevel());
+        assertEquals(3, pr4.getParentParagraph().getIndentLevel());
         assertEquals("Level 4", pr4.getParentParagraph().getText());
         assertEquals("Calibri", pr4.getFontFamily());
         assertEquals(20.0, pr4.getFontSize(), 0);
@@ -584,7 +584,7 @@ public class TestXSLFTextShape {
         assertEquals("Content with caption", shape3.getText());
 
         pr1 = shape3.getTextParagraphs().get(0).getTextRuns().get(0);
-        assertEquals(0, pr1.getParentParagraph().getLevel());
+        assertEquals(0, pr1.getParentParagraph().getIndentLevel());
         assertEquals("Content with caption", pr1.getRawText());
         assertEquals("Calibri", pr1.getFontFamily());
         assertEquals(14.0, pr1.getFontSize(), 0);
@@ -707,19 +707,19 @@ public class TestXSLFTextShape {
         tx1.clearText();
 
         XSLFTextParagraph p1 = tx1.addNewTextParagraph();
-        assertEquals(0, p1.getLevel());
+        assertEquals(0, p1.getIndentLevel());
         XSLFTextRun r1 = p1.addNewTextRun();
         r1.setText("Apache POI");
 
         XSLFTextParagraph p2 = tx1.addNewTextParagraph();
-        p2.setLevel(1);
-        assertEquals(1, p2.getLevel());
+        p2.setIndentLevel(1);
+        assertEquals(1, p2.getIndentLevel());
         XSLFTextRun r2 = p2.addNewTextRun();
         r2.setText("HSLF");
 
         XSLFTextParagraph p3 = tx1.addNewTextParagraph();
-        p3.setLevel(2);
-        assertEquals(2, p3.getLevel());
+        p3.setIndentLevel(2);
+        assertEquals(2, p3.getIndentLevel());
         XSLFTextRun r3 = p3.addNewTextRun();
         r3.setText("XSLF");
 

Modified: poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/dev/SlideShowDumper.java
URL: http://svn.apache.org/viewvc/poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/dev/SlideShowDumper.java?rev=1689777&r1=1689776&r2=1689777&view=diff
==============================================================================
--- poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/dev/SlideShowDumper.java (original)
+++ poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/dev/SlideShowDumper.java Wed Jul  8 00:09:34 2015
@@ -21,10 +21,9 @@ import java.io.*;
 
 import org.apache.poi.poifs.filesystem.POIFSFileSystem;
 import org.apache.poi.poifs.filesystem.DocumentEntry;
-
 import org.apache.poi.ddf.*;
+import org.apache.poi.hslf.record.HSLFEscherRecordFactory;
 import org.apache.poi.hslf.record.RecordTypes;
-
 import org.apache.poi.util.LittleEndian;
 
 /**
@@ -274,7 +273,7 @@ public void walkTree(int depth, int star
 
 	byte[] contents = new byte[len];
 	System.arraycopy(_docstream,pos,contents,0,len);
-	DefaultEscherRecordFactory erf = new DefaultEscherRecordFactory();
+	DefaultEscherRecordFactory erf = new HSLFEscherRecordFactory();
 	EscherRecord record = erf.createRecord(contents,0);
 
 	// For now, try filling in the fields

Modified: poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/dev/SlideShowRecordDumper.java
URL: http://svn.apache.org/viewvc/poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/dev/SlideShowRecordDumper.java?rev=1689777&r1=1689776&r2=1689777&view=diff
==============================================================================
--- poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/dev/SlideShowRecordDumper.java (original)
+++ poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/dev/SlideShowRecordDumper.java Wed Jul  8 00:09:34 2015
@@ -27,10 +27,7 @@ import org.apache.poi.ddf.DefaultEscherR
 import org.apache.poi.ddf.EscherRecord;
 import org.apache.poi.ddf.EscherContainerRecord;
 import org.apache.poi.ddf.EscherTextboxRecord;
-import org.apache.poi.hslf.record.EscherTextboxWrapper;
-import org.apache.poi.hslf.record.TextCharsAtom;
-import org.apache.poi.hslf.record.TextBytesAtom;
-import org.apache.poi.hslf.record.StyleTextPropAtom;
+import org.apache.poi.hslf.record.*;
 import org.apache.poi.hslf.usermodel.HSLFSlideShowImpl;
 
 /**
@@ -263,7 +260,7 @@ public final class SlideShowRecordDumper
 
 		// print additional information for drawings and atoms
 		if (optEscher && cname.equals("PPDrawing")) {
-			DefaultEscherRecordFactory factory = new DefaultEscherRecordFactory();
+			DefaultEscherRecordFactory factory = new HSLFEscherRecordFactory();
 
 			ByteArrayOutputStream baos = new ByteArrayOutputStream();
 			r.writeOut(baos);

Modified: poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/extractor/PowerPointExtractor.java
URL: http://svn.apache.org/viewvc/poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/extractor/PowerPointExtractor.java?rev=1689777&r1=1689776&r2=1689777&view=diff
==============================================================================
--- poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/extractor/PowerPointExtractor.java (original)
+++ poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/extractor/PowerPointExtractor.java Wed Jul  8 00:09:34 2015
@@ -328,13 +328,9 @@ public final class PowerPointExtractor e
         }
 
         for (List<HSLFTextParagraph> lp : paragraphs) {
-            for (HSLFTextParagraph p : lp) {
-                for (HSLFTextRun r : p.getTextRuns()) {
-                    ret.append(r.getRawText());
-                }
-                if (ret.length() > 0 && ret.charAt(ret.length()-1) != '\n') {
-                    ret.append("\n");
-                }
+            ret.append(HSLFTextParagraph.getText(lp));
+            if (ret.length() > 0 && ret.charAt(ret.length()-1) != '\n') {
+                ret.append("\n");
             }
         }
     }

Modified: poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/model/Line.java
URL: http://svn.apache.org/viewvc/poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/model/Line.java?rev=1689777&r1=1689776&r2=1689777&view=diff
==============================================================================
--- poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/model/Line.java (original)
+++ poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/model/Line.java Wed Jul  8 00:09:34 2015
@@ -22,9 +22,6 @@ import org.apache.poi.hslf.usermodel.*;
 import org.apache.poi.sl.usermodel.ShapeContainer;
 import org.apache.poi.sl.usermodel.ShapeType;
 
-import java.awt.geom.*;
-import java.util.ArrayList;
-
 /**
  * Represents a line in a PowerPoint drawing
  *
@@ -46,6 +43,8 @@ public final class Line extends HSLFSimp
 
     protected EscherContainerRecord createSpContainer(boolean isChild){
         _escherContainer = super.createSpContainer(isChild);
+        
+        setShapeType(ShapeType.LINE);
 
         EscherSpRecord spRecord = _escherContainer.getChildById(EscherSpRecord.RECORD_ID);
         short type = (short)((ShapeType.LINE.nativeId << 4) | 0x2);
@@ -64,68 +63,24 @@ public final class Line extends HSLFSimp
 
         return _escherContainer;
     }
-
-    public java.awt.Shape getOutline(){
-        Rectangle2D anchor = getLogicalAnchor2D();
-        return new Line2D.Double(anchor.getX(), anchor.getY(), anchor.getX() + anchor.getWidth(), anchor.getY() + anchor.getHeight());
+    
+    /**
+     * Sets the orientation of the line, if inverse is false, then line goes
+     * from top-left to bottom-right, otherwise use inverse equals true 
+     *
+     * @param inverse the orientation of the line
+     */
+    public void setInverse(boolean inverse) {
+        setShapeType(inverse ? ShapeType.LINE_INV : ShapeType.LINE);
     }
     
     /**
-    *
-    * @return 'absolute' anchor of this shape relative to the parent sheet
-    * 
-    * @deprecated TODO: remove the whole class, should work with preset geometries instead
-    */
-   public Rectangle2D getLogicalAnchor2D(){
-       Rectangle2D anchor = getAnchor2D();
-
-       //if it is a groupped shape see if we need to transform the coordinates
-       if (getParent() != null){
-           ArrayList<HSLFGroupShape> lst = new ArrayList<HSLFGroupShape>();
-           for (ShapeContainer<HSLFShape> parent=this.getParent();
-               parent instanceof HSLFGroupShape;
-               parent = ((HSLFGroupShape)parent).getParent()) {
-               lst.add(0, (HSLFGroupShape)parent);
-           }
-           
-           AffineTransform tx = new AffineTransform();
-           for(HSLFGroupShape prnt : lst) {
-               Rectangle2D exterior = prnt.getAnchor2D();
-               Rectangle2D interior = prnt.getInteriorAnchor();
-
-               double scaleX =  exterior.getWidth() / interior.getWidth();
-               double scaleY = exterior.getHeight() / interior.getHeight();
-
-               tx.translate(exterior.getX(), exterior.getY());
-               tx.scale(scaleX, scaleY);
-               tx.translate(-interior.getX(), -interior.getY());
-               
-           }
-           anchor = tx.createTransformedShape(anchor).getBounds2D();
-       }
-
-       double angle = getRotation();
-       if(angle != 0.){
-           double centerX = anchor.getX() + anchor.getWidth()/2;
-           double centerY = anchor.getY() + anchor.getHeight()/2;
-
-           AffineTransform trans = new AffineTransform();
-           trans.translate(centerX, centerY);
-           trans.rotate(Math.toRadians(angle));
-           trans.translate(-centerX, -centerY);
-
-           Rectangle2D rect = trans.createTransformedShape(anchor).getBounds2D();
-           if((anchor.getWidth() < anchor.getHeight() && rect.getWidth() > rect.getHeight()) ||
-               (anchor.getWidth() > anchor.getHeight() && rect.getWidth() < rect.getHeight())    ){
-               trans = new AffineTransform();
-               trans.translate(centerX, centerY);
-               trans.rotate(Math.PI/2);
-               trans.translate(-centerX, -centerY);
-               anchor = trans.createTransformedShape(anchor).getBounds2D();
-           }
-       }
-       return anchor;
-   }
-
-
+     * Gets the orientation of the line, if inverse is false, then line goes
+     * from top-left to bottom-right, otherwise inverse equals true 
+     *
+     * @return inverse the orientation of the line
+     */
+    public boolean isInverse() {
+        return (getShapeType() == ShapeType.LINE_INV);
+    }
 }

Modified: poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/model/textproperties/TextPFException9.java
URL: http://svn.apache.org/viewvc/poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/model/textproperties/TextPFException9.java?rev=1689777&r1=1689776&r2=1689777&view=diff
==============================================================================
--- poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/model/textproperties/TextPFException9.java (original)
+++ poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/model/textproperties/TextPFException9.java Wed Jul  8 00:09:34 2015
@@ -21,7 +21,7 @@
  */
 package org.apache.poi.hslf.model.textproperties;
 
-import org.apache.poi.hslf.record.TextAutoNumberSchemeEnum;
+import org.apache.poi.sl.usermodel.AutoNumberingScheme;
 import org.apache.poi.util.LittleEndian;
 
 /**
@@ -41,8 +41,8 @@ public class TextPFException9 {
 	private final byte mask4;
 	private final Short bulletBlipRef;
 	private final Short fBulletHasAutoNumber;
-	private final TextAutoNumberSchemeEnum autoNumberScheme;
-	private final static TextAutoNumberSchemeEnum DEFAULT_AUTONUMBER_SHEME = TextAutoNumberSchemeEnum.ANM_ArabicPeriod;
+	private final AutoNumberingScheme autoNumberScheme;
+	private final static AutoNumberingScheme DEFAULT_AUTONUMBER_SHEME = AutoNumberingScheme.arabicPeriod;
 	private final Short autoNumberStartNumber;
 	private final static Short DEFAULT_START_NUMBER = new Short((short)1);
 	private final int recordLength;
@@ -71,7 +71,7 @@ public class TextPFException9 {
 			this.autoNumberScheme = null;
 			this.autoNumberStartNumber = null;
 		} else {
-			this.autoNumberScheme = TextAutoNumberSchemeEnum.valueOf(LittleEndian.getShort(source, index));
+			this.autoNumberScheme = AutoNumberingScheme.forNativeID(LittleEndian.getShort(source, index));
 			index +=2;
 			this.autoNumberStartNumber = LittleEndian.getShort(source, index);
 			index +=2;
@@ -85,7 +85,7 @@ public class TextPFException9 {
 	public Short getfBulletHasAutoNumber() {
 		return fBulletHasAutoNumber;
 	}
-	public TextAutoNumberSchemeEnum getAutoNumberScheme() {
+	public AutoNumberingScheme getAutoNumberScheme() {
 		if (null != this.autoNumberScheme) {
 			return this.autoNumberScheme;
 		}

Added: poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/record/EscherPlaceholder.java
URL: http://svn.apache.org/viewvc/poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/record/EscherPlaceholder.java?rev=1689777&view=auto
==============================================================================
--- poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/record/EscherPlaceholder.java (added)
+++ poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/record/EscherPlaceholder.java Wed Jul  8 00:09:34 2015
@@ -0,0 +1,75 @@
+/* ====================================================================
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   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.hslf.record;
+
+import org.apache.poi.ddf.*;
+import org.apache.poi.util.*;
+
+/**
+ * An atom record that specifies whether a shape is a placeholder shape.
+ * The number, position, and type of placeholder shapes are determined by
+ * the slide layout as specified in the SlideAtom record.
+ */
+public class EscherPlaceholder extends EscherRecord {
+    public static final short RECORD_ID = (short)RecordTypes.OEPlaceholderAtom.typeID;
+    public static final String RECORD_DESCRIPTION = "msofbtClientTextboxPlaceholder";
+
+    int position = -1;
+    byte placementId = 0;
+    byte size = 0;
+    short unused = 0;
+    
+    public EscherPlaceholder() {}
+    
+    public int fillFields(byte[] data, int offset, EscherRecordFactory recordFactory) {
+        int bytesRemaining = readHeader( data, offset );
+
+        position = LittleEndian.getInt(data, offset+8);
+        placementId = data[offset+12];
+        size = data[offset+13];
+        unused = LittleEndian.getShort(data, offset+14);
+        
+        assert(bytesRemaining + 8 == 16);
+        return bytesRemaining + 8;
+    }
+
+    public int serialize(int offset, byte[] data, EscherSerializationListener listener) {
+        listener.beforeRecordSerialize( offset, getRecordId(), this );
+        
+        LittleEndian.putShort(data, offset, getOptions());
+        LittleEndian.putShort(data, offset+2, getRecordId());
+        LittleEndian.putInt(data, offset+4, 8);
+        LittleEndian.putInt(data, offset+8, position);
+        LittleEndian.putByte(data, offset+12, placementId);
+        LittleEndian.putByte(data, offset+13, size);
+        LittleEndian.putShort(data, offset+14, unused);
+        
+        listener.afterRecordSerialize( offset+getRecordSize(), getRecordId(), getRecordSize(), this );
+        return getRecordSize();
+    }
+
+    public int getRecordSize() {
+        return 8 + 8;
+    }
+
+    public String getRecordName() {
+        return "ClientTextboxPlaceholder";
+    }
+
+    
+}

Added: poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/record/HSLFEscherRecordFactory.java
URL: http://svn.apache.org/viewvc/poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/record/HSLFEscherRecordFactory.java?rev=1689777&view=auto
==============================================================================
--- poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/record/HSLFEscherRecordFactory.java (added)
+++ poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/record/HSLFEscherRecordFactory.java Wed Jul  8 00:09:34 2015
@@ -0,0 +1,70 @@
+/* ====================================================================
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   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.hslf.record;
+
+import java.lang.reflect.Constructor;
+import java.util.Map;
+
+import org.apache.poi.ddf.*;
+import org.apache.poi.util.LittleEndian;
+
+/**
+ * Generates escher records when provided the byte array containing those records.
+ *
+ * @see EscherRecordFactory
+ */
+public class HSLFEscherRecordFactory extends DefaultEscherRecordFactory {
+    private static Class<?>[] escherRecordClasses = { EscherPlaceholder.class };
+    private static Map<Short, Constructor<? extends EscherRecord>> recordsMap = recordsToMap( escherRecordClasses );
+
+    
+    /**
+     * Creates an instance of the escher record factory
+     */
+    public HSLFEscherRecordFactory() {
+        // no instance initialisation
+    }
+    
+    /**
+     * Generates an escher record including the any children contained under that record.
+     * An exception is thrown if the record could not be generated.
+     *
+     * @param data   The byte array containing the records
+     * @param offset The starting offset into the byte array
+     * @return The generated escher record
+     */
+    public EscherRecord createRecord(byte[] data, int offset) {
+        short options = LittleEndian.getShort( data, offset );
+        short recordId = LittleEndian.getShort( data, offset + 2 );
+        // int remainingBytes = LittleEndian.getInt( data, offset + 4 );
+
+        Constructor<? extends EscherRecord> recordConstructor = recordsMap.get(Short.valueOf(recordId));
+        if (recordConstructor == null) {
+            return super.createRecord(data, offset);
+        }
+        EscherRecord escherRecord = null;
+        try {
+            escherRecord = recordConstructor.newInstance(new Object[] {});
+        } catch (Exception e) {
+            return super.createRecord(data, offset);
+        }
+        escherRecord.setRecordId(recordId);
+        escherRecord.setOptions(options);
+        return escherRecord;
+    }
+}

Modified: poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/record/PPDrawing.java
URL: http://svn.apache.org/viewvc/poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/record/PPDrawing.java?rev=1689777&r1=1689776&r2=1689777&view=diff
==============================================================================
--- poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/record/PPDrawing.java (original)
+++ poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/record/PPDrawing.java Wed Jul  8 00:09:34 2015
@@ -92,7 +92,7 @@ public final class PPDrawing extends Rec
 		System.arraycopy(source,start,contents,0,len);
 
 		// Build up a tree of Escher records contained within
-		final DefaultEscherRecordFactory erf = new DefaultEscherRecordFactory();
+		final DefaultEscherRecordFactory erf = new HSLFEscherRecordFactory();
 		final List<EscherRecord> escherChildren = new ArrayList<EscherRecord>();
 		findEscherChildren(erf, contents, 8, len-8, escherChildren);
 		this.childRecords = escherChildren.toArray(new EscherRecord[escherChildren.size()]);
@@ -129,20 +129,20 @@ public final class PPDrawing extends Rec
 	private StyleTextProp9Atom findInSpContainer(final EscherContainerRecord spContainer) {
 		EscherContainerRecord clientData = findFirstEscherContainerRecordOfType((short)RecordTypes.EscherClientData, spContainer);
 		if (null == clientData) { return null; }
-		final EscherContainerRecord escherContainer1388 = findFirstEscherContainerRecordOfType((short)0x1388, clientData);
-		if (null == escherContainer1388) { return null; }
-		final EscherContainerRecord escherContainer138A = findFirstEscherContainerRecordOfType((short)0x138A, escherContainer1388);
-		if (null == escherContainer138A) { return null; }
-		int size = escherContainer138A.getChildRecords().size();
+		final EscherContainerRecord progTagsContainer = findFirstEscherContainerRecordOfType((short)0x1388, clientData);
+		if (null == progTagsContainer) { return null; }
+		final EscherContainerRecord progBinaryTag = findFirstEscherContainerRecordOfType((short)0x138A, progTagsContainer);
+		if (null == progBinaryTag) { return null; }
+		int size = progBinaryTag.getChildRecords().size();
 		if (2 != size) { return null; }
-		final Record r0 = buildFromUnknownEscherRecord((UnknownEscherRecord) escherContainer138A.getChild(0));
-		final Record r1 = buildFromUnknownEscherRecord((UnknownEscherRecord) escherContainer138A.getChild(1));
+		final Record r0 = buildFromUnknownEscherRecord((UnknownEscherRecord) progBinaryTag.getChild(0));
+		final Record r1 = buildFromUnknownEscherRecord((UnknownEscherRecord) progBinaryTag.getChild(1));
 		if (!(r0 instanceof CString)) { return null; }
 		if (!("___PPT9".equals(((CString) r0).getText()))) { return null; };
 		if (!(r1 instanceof BinaryTagDataBlob )) { return null; }
 		final BinaryTagDataBlob blob = (BinaryTagDataBlob) r1;
 		if (1 != blob.getChildRecords().length) { return null; }
-		return (StyleTextProp9Atom) blob.findFirstOfType(0x0FACL);
+		return (StyleTextProp9Atom) blob.findFirstOfType(RecordTypes.StyleTextProp9Atom.typeID);
 	}
 	/**
 	 * Creates a new, empty, PPDrawing (typically for use with a new Slide
@@ -403,32 +403,13 @@ public final class PPDrawing extends Rec
 
     public StyleTextProp9Atom[] getNumberedListInfo() {
     	final List<StyleTextProp9Atom> result = new LinkedList<StyleTextProp9Atom>();
-    	EscherRecord[] escherRecords = this.getEscherRecords();
-    	for (EscherRecord escherRecord : escherRecords) {
-			if (escherRecord instanceof EscherContainerRecord && (short)0xf002 == escherRecord.getRecordId()) {
-				EscherContainerRecord escherContainerF002 = (EscherContainerRecord) escherRecord;
-				final EscherContainerRecord escherContainerF003 = findFirstEscherContainerRecordOfType((short)0xf003, escherContainerF002);
-				final EscherContainerRecord[] escherContainersF004 = findAllEscherContainerRecordOfType((short)0xf004, escherContainerF003);
-				for (EscherContainerRecord containerF004 : escherContainersF004) {
-					final EscherContainerRecord escherContainerF011 = findFirstEscherContainerRecordOfType((short)0xf011, containerF004);
-					if (null == escherContainerF011) { continue; }
-					final EscherContainerRecord escherContainer1388 = findFirstEscherContainerRecordOfType((short)0x1388, escherContainerF011);
-					if (null == escherContainer1388) { continue; }
-					final EscherContainerRecord escherContainer138A = findFirstEscherContainerRecordOfType((short)0x138A, escherContainer1388);
-					if (null == escherContainer138A) { continue; }
-					int size = escherContainer138A.getChildRecords().size();
-					if (2 != size) { continue; }
-					final Record r0 = buildFromUnknownEscherRecord((UnknownEscherRecord) escherContainer138A.getChild(0));
-					final Record r1 = buildFromUnknownEscherRecord((UnknownEscherRecord) escherContainer138A.getChild(1));
-					if (!(r0 instanceof CString)) { continue; }
-					if (!("___PPT9".equals(((CString) r0).getText()))) { continue; };
-					if (!(r1 instanceof BinaryTagDataBlob )) { continue; }
-					final BinaryTagDataBlob blob = (BinaryTagDataBlob) r1;
-					if (1 != blob.getChildRecords().length) { continue; }
-					result.add((StyleTextProp9Atom) blob.findFirstOfType(0x0FACL));
-				}
-			}
-    	}
+    	EscherContainerRecord dgContainer = (EscherContainerRecord)childRecords[0];
+		final EscherContainerRecord spgrContainer = findFirstEscherContainerRecordOfType((short)RecordTypes.EscherSpgrContainer, dgContainer);
+		final EscherContainerRecord[] spContainers = findAllEscherContainerRecordOfType((short)RecordTypes.EscherSpContainer, spgrContainer);
+		for (EscherContainerRecord spContainer : spContainers) {
+		    StyleTextProp9Atom prop9 = findInSpContainer(spContainer);
+		    if (prop9 != null) result.add(prop9);
+		}
     	return result.toArray(new StyleTextProp9Atom[result.size()]);
 	}
 }

Modified: poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/record/PPDrawingGroup.java
URL: http://svn.apache.org/viewvc/poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/record/PPDrawingGroup.java?rev=1689777&r1=1689776&r2=1689777&view=diff
==============================================================================
--- poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/record/PPDrawingGroup.java (original)
+++ poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/record/PPDrawingGroup.java Wed Jul  8 00:09:34 2015
@@ -49,7 +49,7 @@ public final class PPDrawingGroup extend
         byte[] contents = new byte[len];
         System.arraycopy(source,start,contents,0,len);
 
-        DefaultEscherRecordFactory erf = new DefaultEscherRecordFactory();
+        DefaultEscherRecordFactory erf = new HSLFEscherRecordFactory();
         EscherRecord child = erf.createRecord(contents, 0);
         child.fillFields( contents, 0, erf );
         dggContainer = (EscherContainerRecord)child.getChild(0);

Modified: poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/record/StyleTextProp9Atom.java
URL: http://svn.apache.org/viewvc/poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/record/StyleTextProp9Atom.java?rev=1689777&r1=1689776&r2=1689777&view=diff
==============================================================================
--- poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/record/StyleTextProp9Atom.java (original)
+++ poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/record/StyleTextProp9Atom.java Wed Jul  8 00:09:34 2015
@@ -83,7 +83,7 @@ public final class StyleTextProp9Atom ex
                 break;
             }
         }
-        this.autoNumberSchemes = (TextPFException9[]) schemes.toArray(new TextPFException9[schemes.size()]);
+        this.autoNumberSchemes = schemes.toArray(new TextPFException9[schemes.size()]);
     }
 
     /**

Modified: poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFShape.java
URL: http://svn.apache.org/viewvc/poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFShape.java?rev=1689777&r1=1689776&r2=1689777&view=diff
==============================================================================
--- poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFShape.java (original)
+++ poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFShape.java Wed Jul  8 00:09:34 2015
@@ -165,35 +165,32 @@ public abstract class HSLFShape implemen
     public Rectangle2D getAnchor2D(){
         EscherSpRecord spRecord = getEscherChild(EscherSpRecord.RECORD_ID);
         int flags = spRecord.getFlags();
-        Rectangle2D anchor;
-        if ((flags & EscherSpRecord.FLAG_CHILD) != 0){
-            EscherChildAnchorRecord rec = getEscherChild(EscherChildAnchorRecord.RECORD_ID);
-            if(rec == null){
+        int x,y,w,h;
+        EscherChildAnchorRecord childRec = getEscherChild(EscherChildAnchorRecord.RECORD_ID);
+        boolean useChildRec = ((flags & EscherSpRecord.FLAG_CHILD) != 0);
+        if (useChildRec && childRec != null){
+            x = childRec.getDx1();
+            y = childRec.getDy1();
+            w = childRec.getDx2()-childRec.getDx1();
+            h = childRec.getDy2()-childRec.getDy1();
+        } else {
+            if (useChildRec) {
                 logger.log(POILogger.WARN, "EscherSpRecord.FLAG_CHILD is set but EscherChildAnchorRecord was not found");
-                EscherClientAnchorRecord clrec = getEscherChild(EscherClientAnchorRecord.RECORD_ID);
-                anchor = new Rectangle2D.Float(
-                    (float)clrec.getCol1()*POINT_DPI/MASTER_DPI,
-                    (float)clrec.getFlag()*POINT_DPI/MASTER_DPI,
-                    (float)(clrec.getDx1()-clrec.getCol1())*POINT_DPI/MASTER_DPI,
-                    (float)(clrec.getRow1()-clrec.getFlag())*POINT_DPI/MASTER_DPI
-                );
-            } else {
-                anchor = new Rectangle2D.Float(
-                    (float)rec.getDx1()*POINT_DPI/MASTER_DPI,
-                    (float)rec.getDy1()*POINT_DPI/MASTER_DPI,
-                    (float)(rec.getDx2()-rec.getDx1())*POINT_DPI/MASTER_DPI,
-                    (float)(rec.getDy2()-rec.getDy1())*POINT_DPI/MASTER_DPI
-                );
             }
-        } else {
-            EscherClientAnchorRecord rec = getEscherChild(EscherClientAnchorRecord.RECORD_ID);
-            anchor = new Rectangle2D.Float(
-                (float)rec.getCol1()*POINT_DPI/MASTER_DPI,
-                (float)rec.getFlag()*POINT_DPI/MASTER_DPI,
-                (float)(rec.getDx1()-rec.getCol1())*POINT_DPI/MASTER_DPI,
-                (float)(rec.getRow1()-rec.getFlag())*POINT_DPI/MASTER_DPI
-            );
+            EscherClientAnchorRecord clientRec = getEscherChild(EscherClientAnchorRecord.RECORD_ID);
+            x = clientRec.getFlag();
+            y = clientRec.getCol1();
+            w = clientRec.getDx1()-clientRec.getFlag();
+            h = clientRec.getRow1()-clientRec.getCol1();
         }
+
+        Rectangle2D anchor = new Rectangle2D.Float(
+            (float)Units.masterToPoints(x),
+            (float)Units.masterToPoints(y),
+            (float)Units.masterToPoints(w),
+            (float)Units.masterToPoints(h)
+        );
+        
         return anchor;
     }
 
@@ -204,21 +201,24 @@ public abstract class HSLFShape implemen
      * @param anchor new anchor
      */
     public void setAnchor(Rectangle2D anchor){
+        int x = Units.pointsToMaster(anchor.getX());
+        int y = Units.pointsToMaster(anchor.getY());
+        int w = Units.pointsToMaster(anchor.getWidth() + anchor.getX());
+        int h = Units.pointsToMaster(anchor.getHeight() + anchor.getY());
         EscherSpRecord spRecord = getEscherChild(EscherSpRecord.RECORD_ID);
         int flags = spRecord.getFlags();
         if ((flags & EscherSpRecord.FLAG_CHILD) != 0){
             EscherChildAnchorRecord rec = (EscherChildAnchorRecord)getEscherChild(EscherChildAnchorRecord.RECORD_ID);
-            rec.setDx1((int)(anchor.getX()*MASTER_DPI/POINT_DPI));
-            rec.setDy1((int)(anchor.getY()*MASTER_DPI/POINT_DPI));
-            rec.setDx2((int)((anchor.getWidth() + anchor.getX())*MASTER_DPI/POINT_DPI));
-            rec.setDy2((int)((anchor.getHeight() + anchor.getY())*MASTER_DPI/POINT_DPI));
-        }
-        else {
+            rec.setDx1(x);
+            rec.setDy1(y);
+            rec.setDx2(w);
+            rec.setDy2(h);
+        } else {
             EscherClientAnchorRecord rec = (EscherClientAnchorRecord)getEscherChild(EscherClientAnchorRecord.RECORD_ID);
-            rec.setFlag((short)(anchor.getY()*MASTER_DPI/POINT_DPI));
-            rec.setCol1((short)(anchor.getX()*MASTER_DPI/POINT_DPI));
-            rec.setDx1((short)(((anchor.getWidth() + anchor.getX())*MASTER_DPI/POINT_DPI)));
-            rec.setRow1((short)(((anchor.getHeight() + anchor.getY())*MASTER_DPI/POINT_DPI)));
+            rec.setFlag((short)x);
+            rec.setCol1((short)y);
+            rec.setDx1((short)w);
+            rec.setRow1((short)h);
         }
 
     }



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