]> source.dussan.org Git - poi.git/commitdiff
fix the same problem with SPX and move deprecation to BytePropertyNode
authorSergey Vladimirov <sergey@apache.org>
Sat, 9 Jul 2011 11:14:53 +0000 (11:14 +0000)
committerSergey Vladimirov <sergey@apache.org>
Sat, 9 Jul 2011 11:14:53 +0000 (11:14 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1144641 13f79535-47bb-0310-9956-ffa450edef68

src/scratchpad/src/org/apache/poi/hwpf/model/BytePropertyNode.java
src/scratchpad/src/org/apache/poi/hwpf/model/PAPX.java
src/scratchpad/src/org/apache/poi/hwpf/model/SectionTable.java

index 2bc5f004cff5b0be8309d0872a79eda851223164..e131e7d03948c31d146d285b5e5c45aa9b07e03f 100644 (file)
@@ -49,11 +49,25 @@ public abstract class BytePropertyNode<T extends BytePropertyNode<T>> extends
                 this.endBytes = fcEnd;
        }
 
-       public int getStartBytes() {
-                return startBytes;
-       }
+    /**
+     * @deprecated Though bytes are actually stored in file, it is advised to
+     *             use char positions for all operations. Including save
+     *             operations, because only char positions are preserved.
+     */
+       @Deprecated
+    public int getStartBytes()
+    {
+        return startBytes;
+    }
 
-       public int getEndBytes() {
-                return endBytes;
-       }
+    /**
+     * @deprecated Though bytes are actually stored in file, it is advised to
+     *             use char positions for all operations. Including save
+     *             operations, because only char positions are preserved.
+     */
+    @Deprecated
+    public int getEndBytes()
+    {
+        return endBytes;
+    }
 }
index 4d9a315982ab3d93c92097fe8fc38c15ef2fa4f0..1707ccd71a63a8b4b9775b4d8f61cc78d34f2132 100644 (file)
@@ -123,31 +123,6 @@ public final class PAPX extends BytePropertyNode<PAPX> {
     return (SprmBuffer)_buf;
   }
 
-    /**
-     * @deprecated Though bytes are actually stored in file, it is advised to
-     *             use char positions for all operations. Including save
-     *             operations, because only char positions are preserved.
-     */
-    @Deprecated
-    @Override
-    public int getEndBytes()
-    {
-        return super.getEndBytes();
-    }
-
-    /**
-     * @deprecated Though bytes are actually stored in file, it is advised to
-     *             use char positions for all operations. Including save
-     *             operations, because only char positions are preserved.
-     */
-    @Deprecated
-    @Override
-    public int getStartBytes()
-    {
-        // TODO Auto-generated method stub
-        return super.getStartBytes();
-    }
-
   public ParagraphProperties getParagraphProperties(StyleSheet ss)
   {
     if(ss == null) {
index c6f9cb24579b98ff3c6c66566aed4cbffbc8bc55..f61efd5b37e253a3ca00d649a128e2e93660b75d 100644 (file)
 
 package org.apache.poi.hwpf.model;
 
-import java.util.ArrayList;
 import java.io.IOException;
+import java.util.ArrayList;
 import java.util.List;
 
+import org.apache.poi.hwpf.model.io.HWPFFileSystem;
+import org.apache.poi.hwpf.model.io.HWPFOutputStream;
 import org.apache.poi.util.LittleEndian;
-import org.apache.poi.hwpf.model.io.*;
 import org.apache.poi.util.POILogFactory;
 import org.apache.poi.util.POILogger;
 
@@ -180,21 +181,20 @@ public class SectionTable
       // add the section descriptor bytes to the PlexOfCps.
 
             /* original line */
-            // GenericPropertyNode property = new
-            // GenericPropertyNode(sepx.getStart(), sepx.getEnd(),
-            // sed.toByteArray());
+            GenericPropertyNode property = new GenericPropertyNode(
+                    sepx.getStart(), sepx.getEnd(), sed.toByteArray() );
             /*
              * Line using Ryan's FCtoCP() conversion method - unable to observe
              * any effect on our testcases when using this code - piers
              */
             /*
              * there is an effect on Bug45743.doc actually. writeoutreadback
-             * changes byte offset of chars (but preserve string offsets) -
-             * sergey
+             * changes byte offset of chars (but preserve string offsets).
+             * Changing back to original lines - sergey
              */
-            GenericPropertyNode property = new GenericPropertyNode(
-                    tpt.getCharIndex( sepx.getStartBytes() ),
-                    tpt.getCharIndex( sepx.getEndBytes() ), sed.toByteArray() );
+            // GenericPropertyNode property = new GenericPropertyNode(
+            // tpt.getCharIndex( sepx.getStartBytes() ),
+            // tpt.getCharIndex( sepx.getEndBytes() ), sed.toByteArray() );
 
       plex.addProperty(property);