poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ye...@apache.org
Subject svn commit: r1334342 - in /poi/trunk/src/java/org/apache/poi/ddf: AbstractEscherOptRecord.java EscherComplexProperty.java EscherContainerRecord.java EscherTextboxRecord.java
Date Sat, 05 May 2012 08:25:08 GMT
Author: yegor
Date: Sat May  5 08:25:08 2012
New Revision: 1334342

URL: http://svn.apache.org/viewvc?rev=1334342&view=rev
Log:
polishing BiffDrawingToXml: more readable output and removed unnecessary tags

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

Modified: poi/trunk/src/java/org/apache/poi/ddf/AbstractEscherOptRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ddf/AbstractEscherOptRecord.java?rev=1334342&r1=1334341&r2=1334342&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/ddf/AbstractEscherOptRecord.java (original)
+++ poi/trunk/src/java/org/apache/poi/ddf/AbstractEscherOptRecord.java Sat May  5 08:25:08
2012
@@ -173,19 +173,18 @@ public abstract class AbstractEscherOptR
             stringBuilder.append( "    " + property.toString() + nl );
         }
 
-        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())))
-                .append(tab).append("\t").append("<Numchildren>").append(getChildRecords().size()).append("</Numchildren>\n")
-                .append(tab).append("\t").append("<IsContainer>").append(isContainerRecord()).append("</IsContainer>\n");
-        for (EscherProperty property: getEscherProperties()){
-            builder.append(property.toXml(tab+"\t"));
-        }
-        builder.append(tab).append("</").append(getClass().getSimpleName()).append(">\n");
-        return builder.toString();
-    }
-}
+        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();
+    }
+}

Modified: poi/trunk/src/java/org/apache/poi/ddf/EscherComplexProperty.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ddf/EscherComplexProperty.java?rev=1334342&r1=1334341&r2=1334342&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/ddf/EscherComplexProperty.java (original)
+++ poi/trunk/src/java/org/apache/poi/ddf/EscherComplexProperty.java Sat May  5 08:25:08 2012
@@ -140,7 +140,7 @@ public class EscherComplexProperty exten
         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();
     }

Modified: poi/trunk/src/java/org/apache/poi/ddf/EscherContainerRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ddf/EscherContainerRecord.java?rev=1334342&r1=1334341&r2=1334342&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/ddf/EscherContainerRecord.java (original)
+++ poi/trunk/src/java/org/apache/poi/ddf/EscherContainerRecord.java Sat May  5 08:25:08 2012
@@ -258,17 +258,14 @@ public final class EscherContainerRecord
     @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();
     }
 

Modified: poi/trunk/src/java/org/apache/poi/ddf/EscherTextboxRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ddf/EscherTextboxRecord.java?rev=1334342&r1=1334341&r2=1334342&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/ddf/EscherTextboxRecord.java (original)
+++ poi/trunk/src/java/org/apache/poi/ddf/EscherTextboxRecord.java Sat May  5 08:25:08 2012
@@ -155,8 +155,6 @@ public class EscherTextboxRecord extends
         }
         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();



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


Mime
View raw message