BCellNamedRange extension
Named ranges / defined names (spec cat 10): map a name to an A1 ref or range
so formulas can say =SUM(SALES) or =PRICE*QTY instead of =SUM(A2:A10).
Names are resolved by rewriting the formula to A1 before evaluation (see
BCellGridStateManager.namedRangeResolver + substituteNames), so every
formula path — display, sort, export — sees them, and no engine change is
needed. Names are case-insensitive (Excel behaviour).
ponytail: flat name -> A1 map only. No workbook-vs-sheet scope, no relative
refs, no structured/table references — those are the rest of cat 10 and stay
out. A name pointing at a range is only valid where a range is (inside a
function argument), same as a literal A2:A10.
Properties
-
definedNames
→ Map<
String, String> -
Available on BCellGridStateManager, provided by the BCellNamedRange extension
Unmodifiable view of all defined names (uppercased) -> their A1 targets.no setter
Methods
-
clearNames(
) → void -
Available on BCellGridStateManager, provided by the BCellNamedRange extension
Removes every defined name. Calls notifyListeners if any existed. -
defineName(
String name, String refOrRange) → void -
Available on BCellGridStateManager, provided by the BCellNamedRange extension
Defines (or redefines)nameto point atrefOrRange— a single A1 ref (B2) or an A1 range (A2:A10). Throws ArgumentError whennameis not a letters-only bare identifier (which also rules out shadowing a cell address likeA1— those contain digits), or whenrefOrRangeis not a valid A1 ref/range. Calls notifyListeners so cached formula results drop and re-evaluate. -
namedRange(
String name) → String? -
Available on BCellGridStateManager, provided by the BCellNamedRange extension
The A1 ref/rangenameresolves to (uppercased), or null if undefined. -
removeName(
String name) → void -
Available on BCellGridStateManager, provided by the BCellNamedRange extension
Removesname. Calls notifyListeners if it existed. When the last name goes, the resolver is unwired so the no-names formula fast path resumes.