poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ser...@apache.org
Subject svn commit: r1143709 - in /poi/trunk/src/scratchpad/src/org/apache/poi/hwpf: HWPFDocument.java HWPFDocumentCore.java HWPFOldDocument.java usermodel/Range.java
Date Thu, 07 Jul 2011 08:35:52 GMT
Author: sergey
Date: Thu Jul  7 08:35:51 2011
New Revision: 1143709

URL: http://svn.apache.org/viewvc?rev=1143709&view=rev
Log:
add getOverallRange() method definition to HWPFDocumentCore

Modified:
    poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/HWPFDocument.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/HWPFDocumentCore.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/HWPFOldDocument.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Range.java

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/HWPFDocument.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/HWPFDocument.java?rev=1143709&r1=1143708&r2=1143709&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/HWPFDocument.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/HWPFDocument.java Thu Jul  7 08:35:51
2011
@@ -284,11 +284,6 @@ public final class HWPFDocument extends 
     return _dop;
   }
 
-  /**
-   * Returns the range that covers all text in the
-   *  file, including main text, footnotes, headers
-   *  and comments
-   */
   public Range getOverallRange() {
 	  // hack to get the ending cp of the document, Have to revisit this.
       PropertyNode p =  _tpt.getTextPieces().get(_tpt.getTextPieces().size() - 1);

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/HWPFDocumentCore.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/HWPFDocumentCore.java?rev=1143709&r1=1143708&r2=1143709&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/HWPFDocumentCore.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/HWPFDocumentCore.java Thu Jul  7 08:35:51
2011
@@ -149,12 +149,18 @@ public abstract class HWPFDocumentCore e
     }
   }
 
-  /**
-   * Returns the range which covers the whole of the
-   *  document, but excludes any headers and footers.
-   */
-  public abstract Range getRange();
-  
+    /**
+     * Returns the range which covers the whole of the document, but excludes
+     * any headers and footers.
+     */
+    public abstract Range getRange();
+
+    /**
+     * Returns the range that covers all text in the file, including main text,
+     * footnotes, headers and comments
+     */
+    public abstract Range getOverallRange();
+
   public abstract TextPieceTable getTextTable();
   
   public CHPBinTable getCharacterTable()

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/HWPFOldDocument.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/HWPFOldDocument.java?rev=1143709&r1=1143708&r2=1143709&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/HWPFOldDocument.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/HWPFOldDocument.java Thu Jul  7 08:35:51
2011
@@ -109,12 +109,16 @@ public class HWPFOldDocument extends HWP
                 _fib.getFcMin(), tpt
         );
     }
-    
-    public Range getRange() {
+
+    public Range getOverallRange()
+    {
         // Life is easy when we have no footers, headers or unicode!
-        return new Range(
-                0, _fib.getFcMac() - _fib.getFcMin(), this
-        );
+        return new Range( 0, _fib.getFcMac() - _fib.getFcMin(), this );
+    }
+
+    public Range getRange()
+    {
+        return getOverallRange();
     }
 
     public TextPieceTable getTextTable()

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Range.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Range.java?rev=1143709&r1=1143708&r2=1143709&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Range.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Range.java Thu Jul  7 08:35:51
2011
@@ -901,8 +901,7 @@ public class Range { // TODO -instantiab
             }
         }
 
-        final Range overallrange = getDocument() instanceof HWPFDocument ? ((HWPFDocument)
getDocument())
-                .getOverallRange() : getDocument().getRange();
+        final Range overallrange = getDocument().getOverallRange();
         int limit = _paragraphs.size();
         for ( ; tableEndInclusive < limit - 1; tableEndInclusive++ )
         {



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


Mime
View raw message