summaryrefslogtreecommitdiff
path: root/sc/source/ui/view/gridwin.cxx
diff options
context:
space:
mode:
authorMarco Cecchetti <marco.cecchetti@collabora.com>2017-03-29 13:42:35 +0200
committerMarco Cecchetti <mrcekets@gmail.com>2017-10-02 18:46:00 +0200
commit31b7dc19c32f42197c481cb7d2f44c600b755e2b (patch)
treeeabaf30a1453fa7f185b492a78174fd0d48fbeb4 /sc/source/ui/view/gridwin.cxx
parent61ddf34cf72bdfb738706b0836d9ecb6c0186d5d (diff)
lok - sc: make computation of cell cursor position faster
Now the computation of the cell cursor position exploits the cached row/col positions in HeightHelper/WidthHelper. That makes navigating through arrow keys independent from the current cell cursor position: the cell cursor position is updated at the bottom of the document as fast as at the top even for very big spreadsheets. Change-Id: I2f23d4439f2157e702f09b56106bebdd0e0bbe86 Reviewed-on: https://gerrit.libreoffice.org/40450 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Marco Cecchetti <mrcekets@gmail.com>
Diffstat (limited to 'sc/source/ui/view/gridwin.cxx')
-rw-r--r--sc/source/ui/view/gridwin.cxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 1726e25a1d46..42328999c762 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -5561,6 +5561,13 @@ OString ScGridWindow::getCellCursor(const Fraction& rZoomX, const Fraction& rZoo
pViewData->SetZoom(defaultZoomX, defaultZoomY, true);
+ pViewData->GetLOKWidthHelper().removeByIndex(pViewData->GetLOKOldCurX() - 1);
+ pViewData->GetLOKWidthHelper().insert(nX - 1, aScrPos.getX());
+ pViewData->SetLOKOldCurX(nX);
+ pViewData->GetLOKHeightHelper().removeByIndex(pViewData->GetLOKOldCurY() - 1);
+ pViewData->GetLOKHeightHelper().insert(nY - 1, aScrPos.getY());
+ pViewData->SetLOKOldCurY(nY);
+
return aRect.toString();
}