You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by se...@apache.org on 2011/07/09 13:14:53 UTC
svn commit: r1144641 - in
/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model:
BytePropertyNode.java PAPX.java SectionTable.java
Author: sergey
Date: Sat Jul 9 11:14:53 2011
New Revision: 1144641
URL: http://svn.apache.org/viewvc?rev=1144641&view=rev
Log:
fix the same problem with SPX and move deprecation to BytePropertyNode
Modified:
poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/BytePropertyNode.java
poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/PAPX.java
poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/SectionTable.java
Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/BytePropertyNode.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/BytePropertyNode.java?rev=1144641&r1=1144640&r2=1144641&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/BytePropertyNode.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/BytePropertyNode.java Sat Jul 9 11:14:53 2011
@@ -49,11 +49,25 @@ public abstract class BytePropertyNode<T
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;
+ }
}
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=1144641&r1=1144640&r2=1144641&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 Sat Jul 9 11:14:53 2011
@@ -123,31 +123,6 @@ public final class PAPX extends ByteProp
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) {
Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/SectionTable.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/SectionTable.java?rev=1144641&r1=1144640&r2=1144641&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/SectionTable.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/SectionTable.java Sat Jul 9 11:14:53 2011
@@ -17,12 +17,13 @@
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);
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org