* @return the SHRFMLA, TABLE or ARRAY record for the formula cell, if it is the first cell of
* a table or array region. <code>null</code> if the formula cell is not shared/array/table,
* or if the specified formula is not the the first in the group.
*/
public SharedValueRecordBase getRecordForFirstCell(FormulaRecordAggregate agg) {
CellReference firstCell = agg.getFormulaRecord().getFormula().getExpReference();
// perhaps this could be optimised by consulting the (somewhat unreliable) isShared flag
// and/or distinguishing between tExp and tTbl.
if (firstCell == null) {
// not a shared/array/table formula
return null;
}
int row = firstCell.getRow();
int column = firstCell.getCol();
if (agg.getRow() != row || agg.getColumn() != column) {
// not the first formula cell in the group
return null;
}