GetLastDataRow() is more efficient than iterating every cell with HasDataAt(), so first reduce the row range from the end (in case the whole range is empty cells it's just one call). Change-Id: Idc494795f68492ed8b05b2cd575598a9c5868b7f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135605 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>