New method SortReorderByRow() for the new row-based reordering.

Easier to follow this way.

Change-Id: Idf7e93106f1e1927967f4917062ee619ed71d694