import org.apache.poi.ss.formula.ptg.Ref3DPxg;
import org.apache.poi.ss.util.CellReference;
import org.apache.poi.ss.util.CellReference.NameType;
+import org.apache.poi.util.LocaleUtil;
+
+import java.util.Locale;
/**
* Contains all the contextual information required to evaluate an operation
}
public static CellReference applyR1C1Reference(CellReference anchorReference, String relativeReference) {
- int rpos = relativeReference.indexOf('R');
- int cpos = relativeReference.indexOf('C');
+ String upRef = relativeReference.toUpperCase(LocaleUtil.getUserLocale());
+ int rpos = upRef.indexOf('R');
+ int cpos = upRef.indexOf('C');
if (rpos >= 0 && cpos > rpos) {
String rval = relativeReference.substring(rpos + 1, cpos).trim();
String cval = relativeReference.substring(cpos + 1).trim();
// non-error cases
confirm(feA, c, "INDIRECT(\"R2C3\", FALSE)", 23);
+ confirm(feA, c, "INDIRECT(\"r2c3\", FALSE)", 23);
confirm(feA, c, "INDIRECT(\"R[-4]C[0]\", FALSE)", 23);
confirm(feA, c, "INDIRECT(\"R[-4]C\", FALSE)", 23);
confirm(feA, c, "INDIRECT(\"R1C1:R1C7\", FALSE)", 13); // de-reference area ref (note formula is in C4)
+ confirm(feA, c, "INDIRECT(\"r1c1:r1c7\", FALSE)", 13); // de-reference area ref (note formula is in C4)
confirm(feA, c, "SUM(INDIRECT(\"Sheet2!R1C2:R3C3\", FALSE))", 351); // area ref
+ confirm(feA, c, "SUM(INDIRECT(\"Sheet2!r1c2:r3c3\", FALSE))", 351); // area ref
confirm(feA, c, "SUM(INDIRECT(\"Sheet2! R1C2 : R3C3 \", FALSE))", 351); // spaces in area ref
//scenarios yet to support