Lines 57-62
Link Here
|
57 |
/** |
57 |
/** |
58 |
* |
58 |
* |
59 |
* @author Avik Sengupta |
59 |
* @author Avik Sengupta |
|
|
60 |
* @author Dennis Doubleday (patch to seperateRowColumns()) |
60 |
*/ |
61 |
*/ |
61 |
public class CellReference { |
62 |
public class CellReference { |
62 |
|
63 |
|
Lines 126-136
Link Here
|
126 |
* number format. |
127 |
* number format. |
127 |
*/ |
128 |
*/ |
128 |
private String[] seperateRowColumns(String reference) { |
129 |
private String[] seperateRowColumns(String reference) { |
129 |
int loc = 0; // location of first number |
130 |
|
|
|
131 |
// Look for end of sheet name. This will either set |
132 |
// start to 0 (if no sheet name present) or the |
133 |
// index after the sheet reference ends. |
134 |
int start = reference.indexOf("!") + 1; |
135 |
System.out.println("Start is " + start); |
130 |
String retval[] = new String[2]; |
136 |
String retval[] = new String[2]; |
131 |
int length = reference.length(); |
137 |
int length = reference.length(); |
132 |
|
138 |
|
|
|
139 |
|
133 |
char[] chars = reference.toCharArray(); |
140 |
char[] chars = reference.toCharArray(); |
|
|
141 |
int loc = start; |
134 |
if (chars[loc]=='$') loc++; |
142 |
if (chars[loc]=='$') loc++; |
135 |
for (; loc < chars.length; loc++) { |
143 |
for (; loc < chars.length; loc++) { |
136 |
if (Character.isDigit(chars[loc]) || chars[loc] == '$') { |
144 |
if (Character.isDigit(chars[loc]) || chars[loc] == '$') { |
Lines 139-145
Link Here
|
139 |
} |
147 |
} |
140 |
|
148 |
|
141 |
|
149 |
|
142 |
retval[0] = reference.substring(0,loc); |
150 |
retval[0] = reference.substring(start,loc); |
143 |
retval[1] = reference.substring(loc); |
151 |
retval[1] = reference.substring(loc); |
144 |
return retval; |
152 |
return retval; |
145 |
} |
153 |
} |