calc ScTable::SearchAll : avoid calling GetLastDataPos uselessly

in the loop we are in the same table
refactor ScTable::Search too

perfchek result for testSheetFindAll-Search value
before : 804252982
after :  229861999

Change-Id: I907f1260472bcc5d93b2c6425c342187a5f4c787
Reviewed-on: https://gerrit.libreoffice.org/12225
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Eike Rathke <erack@redhat.com>
 calc ScTable::ReplaceAll : avoid calling GetLastDataPos uselessly

Change-Id: Ibb6fb9ea3e524a889de96f560e308a4aa54fa2af
Reviewed-on: https://gerrit.libreoffice.org/12248
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Eike Rathke <erack@redhat.com>