poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acoli...@apache.org
Subject cvs commit: jakarta-poi/src/java/org/apache/poi/hssf/util CellReference.java
Date Thu, 28 Nov 2002 19:26:20 GMT
acoliver    2002/11/28 11:26:20

  Modified:    src/java/org/apache/poi/hssf/util CellReference.java
  Log:
  http://nagoya.apache.org/bugzilla/show_bug.cgi?id=14269
  
  Revision  Changes    Path
  1.2       +11 -3     jakarta-poi/src/java/org/apache/poi/hssf/util/CellReference.java
  
  Index: CellReference.java
  ===================================================================
  RCS file: /home/cvs/jakarta-poi/src/java/org/apache/poi/hssf/util/CellReference.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- CellReference.java	4 May 2002 15:45:05 -0000	1.1
  +++ CellReference.java	28 Nov 2002 19:26:20 -0000	1.2
  @@ -57,6 +57,7 @@
   /**
    *
    * @author  Avik Sengupta
  + * @author  Dennis Doubleday (patch to seperateRowColumns())
    */
   public class CellReference {
       
  @@ -126,11 +127,18 @@
        * number format.
        */
       private String[] seperateRowColumns(String reference) {
  -        int loc = 0; // location of first number
  +        
  +        // Look for end of sheet name. This will either set
  +        // start to 0 (if no sheet name present) or the
  +        // index after the sheet reference ends.
  +        int start = reference.indexOf("!") + 1;
  +
           String retval[] = new String[2];
           int length = reference.length();
  -        
  +
  +
           char[] chars = reference.toCharArray();
  +        int loc = start;
           if (chars[loc]=='$') loc++;
           for (; loc < chars.length; loc++) {
               if (Character.isDigit(chars[loc]) || chars[loc] == '$') {
  @@ -139,7 +147,7 @@
           }
           
           
  -        retval[0] = reference.substring(0,loc);
  +        retval[0] = reference.substring(start,loc);
           retval[1] = reference.substring(loc);
           return retval;
       }
  
  
  

Mime
View raw message