]> source.dussan.org Git - poi.git/commitdiff
polishing BiffDrawingToXml: more readable output and removed unnecessary tags
authorYegor Kozlov <yegor@apache.org>
Sat, 5 May 2012 08:25:08 +0000 (08:25 +0000)
committerYegor Kozlov <yegor@apache.org>
Sat, 5 May 2012 08:25:08 +0000 (08:25 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1334342 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/poi/ddf/AbstractEscherOptRecord.java
src/java/org/apache/poi/ddf/EscherComplexProperty.java
src/java/org/apache/poi/ddf/EscherContainerRecord.java
src/java/org/apache/poi/ddf/EscherTextboxRecord.java

index 9606fd7603f1e1f12970a1aa7267f420c7611733..a86fbda669bc4be8cce39c7fae657fa0a5bcbc27 100644 (file)
@@ -173,19 +173,18 @@ public abstract class AbstractEscherOptRecord extends EscherRecord
             stringBuilder.append( "    " + property.toString() + nl );
         }
 
-        return stringBuilder.toString();\r
-    }\r
-\r
-    @Override\r
-    public String toXml(String tab) {\r
-        StringBuilder builder = new StringBuilder();\r
-        builder.append(tab).append(formatXmlRecordHeader(getClass().getSimpleName(), HexDump.toHex(getRecordId()), HexDump.toHex(getVersion()), HexDump.toHex(getInstance())))\r
-                .append(tab).append("\t").append("<Numchildren>").append(getChildRecords().size()).append("</Numchildren>\n")\r
-                .append(tab).append("\t").append("<IsContainer>").append(isContainerRecord()).append("</IsContainer>\n");\r
-        for (EscherProperty property: getEscherProperties()){\r
-            builder.append(property.toXml(tab+"\t"));\r
-        }\r
-        builder.append(tab).append("</").append(getClass().getSimpleName()).append(">\n");\r
-        return builder.toString();\r
-    }\r
-}\r
+        return stringBuilder.toString();
+    }
+
+    @Override
+    public String toXml(String tab) {
+        StringBuilder builder = new StringBuilder();
+        builder.append(tab).append(formatXmlRecordHeader(getClass().getSimpleName(),
+                HexDump.toHex(getRecordId()), HexDump.toHex(getVersion()), HexDump.toHex(getInstance())));
+        for (EscherProperty property: getEscherProperties()){
+            builder.append(property.toXml(tab+"\t"));
+        }
+        builder.append(tab).append("</").append(getClass().getSimpleName()).append(">\n");
+        return builder.toString();
+    }
+}
index d3db3469a48f950eb67eb00591dcce7d09e97328..8cdd46f5a0b05fdc7e9dfada83084e74d533300f 100644 (file)
@@ -140,7 +140,7 @@ public class EscherComplexProperty extends EscherProperty {
         builder.append(tab).append("<").append(getClass().getSimpleName()).append(" id=\"0x").append(HexDump.toHex(getId()))
                 .append("\" name=\"").append(getName()).append("\" blipId=\"")
                 .append(isBlipId()).append("\">\n");
-        builder.append("\t").append(tab).append(dataStr);
+        //builder.append("\t").append(tab).append(dataStr);
         builder.append(tab).append("</").append(getClass().getSimpleName()).append(">\n");
         return builder.toString();
     }
index bed9619d11e2abd6d3b668db9936415a0474a5a4..4190594b54b48af6d78df9c5c61041ea4fe9d0af 100644 (file)
@@ -258,17 +258,14 @@ public final class EscherContainerRecord extends EscherRecord {
     @Override
     public String toXml(String tab) {
         StringBuilder builder = new StringBuilder();
-        builder.append(tab).append(formatXmlRecordHeader(getClass().getSimpleName(), HexDump.toHex(getRecordId()), HexDump.toHex(getVersion()), HexDump.toHex(getInstance())))
-                .append(tab).append("\t").append("<RecordName>").append(getRecordName()).append("</RecordName>\n")
-                .append(tab).append("\t").append("<IsContainer>").append(isContainerRecord()).append("</IsContainer>\n")
-                .append(tab).append("\t").append("<Numchildren>").append(HexDump.toHex(_childRecords.size())).append("</Numchildren>\n");
+        builder.append(tab).append(formatXmlRecordHeader(getRecordName(), HexDump.toHex(getRecordId()), HexDump.toHex(getVersion()), HexDump.toHex(getInstance())));
         for ( Iterator<EscherRecord> iterator = _childRecords.iterator(); iterator
                 .hasNext(); )
         {
             EscherRecord record = iterator.next();
             builder.append(record.toXml(tab+"\t"));
         }
-        builder.append(tab).append("</").append(getClass().getSimpleName()).append(">\n");
+        builder.append(tab).append("</").append(getRecordName()).append(">\n");
         return builder.toString();
     }
 
index 12a0dcccd88a05d6d9f2d12b280e9dde09cfacdb..c21c22796801b5329c65acd31b2b7df4cb2fd8b0 100644 (file)
@@ -155,8 +155,6 @@ public class EscherTextboxRecord extends EscherRecord
         }
         StringBuilder builder = new StringBuilder();
         builder.append(tab).append(formatXmlRecordHeader(getClass().getSimpleName(), HexDump.toHex(getRecordId()), HexDump.toHex(getVersion()), HexDump.toHex(getInstance())))
-                .append(tab).append("\t").append("<IsContainer>").append(isContainerRecord()).append("</IsContainer>\n")
-                .append(tab).append("\t").append("<Numchildren>").append(getChildRecords().size()).append("</Numchildren>\n")
                 .append(tab).append("\t").append("<ExtraData>").append(theDumpHex).append("</ExtraData>\n");
         builder.append(tab).append("</").append(getClass().getSimpleName()).append(">\n");
         return builder.toString();