diff options
author | Yegor Kozlov <yegor@apache.org> | 2009-08-05 17:02:04 +0000 |
---|---|---|
committer | Yegor Kozlov <yegor@apache.org> | 2009-08-05 17:02:04 +0000 |
commit | df16f03172c33968ef96d2d6f484ace61460719a (patch) | |
tree | 1ca86562b58c5cf7c48af48ad782c4cd3f5051da /src/ooxml/java/org | |
parent | 562fe9897cc6c3def95c1251e5de6cf9e9f10272 (diff) | |
download | poi-df16f03172c33968ef96d2d6f484ace61460719a.tar.gz poi-df16f03172c33968ef96d2d6f484ace61460719a.zip |
Fixed XSSFCell to correctly parse column indexes greater than 702 (ZZ), see Bugzilla #47606
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@801305 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/ooxml/java/org')
-rw-r--r-- | src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCell.java | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCell.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCell.java index e817553a4c..f6615b73e8 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCell.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCell.java @@ -97,7 +97,7 @@ public final class XSSFCell implements Cell { this.cell = cell; this.row = row; if (cell.getR() != null) { - this.cellNum = parseCellNum(cell.getR()); + this.cellNum = new CellReference(cell.getR()).getCol(); } this.sharedStringSource = row.getSheet().getWorkbook().getSharedStringSource(); this.stylesSource = row.getSheet().getWorkbook().getStylesSource(); @@ -648,21 +648,6 @@ public final class XSSFCell implements Cell { } /** - * Converts A1 style reference into 0-based column index - * - * @param r an A1 style reference to the location of this cell - * @return 0-based column index - */ - protected static short parseCellNum(String r) { - r = r.split("\\d+")[0]; - if (r.length() == 1) { - return (short) (r.charAt(0) - 'A'); - } else { - return (short) (r.charAt(1) - 'A' + 26 * (r.charAt(0) - '@')); - } - } - - /** * Set the cells type (numeric, formula or string) * * @throws IllegalArgumentException if the specified cell type is invalid |