poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ser...@apache.org
Subject svn commit: r1142860 - in /poi/trunk/src/scratchpad/src/org/apache/poi/hwpf: model/PAPX.java usermodel/BorderCode.java usermodel/Paragraph.java
Date Tue, 05 Jul 2011 00:48:01 GMT
Author: sergey
Date: Tue Jul  5 00:48:00 2011
New Revision: 1142860

URL: http://svn.apache.org/viewvc?rev=1142860&view=rev
Log:
add or improve toString() methods of several classes for debug purposes

Modified:
    poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/PAPX.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/BorderCode.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Paragraph.java

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/PAPX.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/PAPX.java?rev=1142860&r1=1142859&r2=1142860&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/PAPX.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/PAPX.java Tue Jul  5 00:48:00 2011
@@ -18,12 +18,11 @@
 package org.apache.poi.hwpf.model;
 
 
-import org.apache.poi.util.LittleEndian;
-
-import org.apache.poi.hwpf.usermodel.ParagraphProperties;
 import org.apache.poi.hwpf.sprm.ParagraphSprmUncompressor;
 import org.apache.poi.hwpf.sprm.SprmBuffer;
 import org.apache.poi.hwpf.sprm.SprmOperation;
+import org.apache.poi.hwpf.usermodel.ParagraphProperties;
+import org.apache.poi.util.LittleEndian;
 
 /**
  * DANGER - works in bytes!
@@ -145,4 +144,10 @@ public final class PAPX extends ByteProp
     }
     return false;
   }
+
+    public String toString()
+    {
+        return "PAPX from " + getStart() + " to " + getEnd() + " (in bytes "
+                + getStartBytes() + " to " + getEndBytes() + ")";
+    }
 }

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/BorderCode.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/BorderCode.java?rev=1142860&r1=1142859&r2=1142860&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/BorderCode.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/BorderCode.java Tue Jul  5
00:48:00 2011
@@ -197,6 +197,9 @@ public final class BorderCode implements
     @Override
     public String toString()
     {
+        if ( isEmpty() )
+            return "[BRC] EMPTY";
+
         StringBuffer buffer = new StringBuffer();
 
         buffer.append( "[BRC]\n" );

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Paragraph.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Paragraph.java?rev=1142860&r1=1142859&r2=1142860&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Paragraph.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Paragraph.java Tue Jul  5 00:48:00
2011
@@ -517,4 +517,20 @@ public class Paragraph extends Range imp
     return retVal;
   }
 
+    @Override
+    public String toString()
+    {
+        return toString( true );
+    }
+
+    public String toString( boolean withPapx )
+    {
+        return "Paragraph ("
+                + getStartOffset()
+                + "--"
+                + getEndOffset()
+                + ")"
+                + ( withPapx ? "\n"
+                        + _props.toString().replaceAll( "\n", "\n\t" ) : "" );
+    }
 }



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


Mime
View raw message