for (GridRectangle cellRectangle : cellRectangles) {
int direction = cellRectangle.firstDim.size() > 0
|| cellRectangle.secondDim.size() > 0 ? 1 : -1;
for (int i = cellRectangle.firstDim.start; Math
.abs(cellRectangle.firstDim.end - i) > 0; i += direction) {
PositionCoordinate result = findCell(layer, configRegistry, i,
cellRectangle.secondDim.start,
cellRectangle.secondDim.end, direction, pattern,
stringValue, comparator, caseSensitive, wholeWord,
regex, columnFirst, includeCollapsed);
if (result != null) {