diff options
author | Jan Holesovsky <kendy@collabora.com> | 2015-03-26 11:18:35 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-03-30 09:23:51 +0200 |
commit | 3aed864e7a2f7024fd81ba81bdc6182848320e0e (patch) | |
tree | 35b3632c210723e711efef212df36563921d2e53 /sc | |
parent | 16d8839c24be1a9539f3d6e0157c5279e92cd37e (diff) |
Make SetCellSelection work in pixels, and change the name accordingly.
Change-Id: Ic08f436b8196f29bb958845505a517cebba09f4b
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/inc/gridwin.hxx | 6 | ||||
-rw-r--r-- | sc/source/ui/unoobj/docuno.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/gridwin4.cxx | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/sc/source/ui/inc/gridwin.hxx b/sc/source/ui/inc/gridwin.hxx index 3cf3e360b7b4..3d4f90fe5451 100644 --- a/sc/source/ui/inc/gridwin.hxx +++ b/sc/source/ui/inc/gridwin.hxx @@ -331,9 +331,9 @@ public: void LogicMouseButtonUp(const MouseEvent& rMouseEvent); /// Update the cell selection according to what handles have been dragged. - /// Uses the same parameteres as vcl::ITiledRenderable::setTextSelection() - /// (ie. they are in twips here). - void SetCellSelection(int nType, int nX, int nY); + /// @see vcl::ITiledRenderable::setTextSelection() for the values of nType. + /// Coordinates are in pixels. + void SetCellSelectionPixel(int nType, int nPixelX, int nPixelY); virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible() SAL_OVERRIDE; diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx index b7743ae7b34e..2c77ec6ac500 100644 --- a/sc/source/ui/unoobj/docuno.cxx +++ b/sc/source/ui/unoobj/docuno.cxx @@ -598,7 +598,7 @@ void ScModelObj::setTextSelection(int nType, int nX, int nY) if (!pGridWindow) return; - pGridWindow->SetCellSelection(nType, nX, nY); + pGridWindow->SetCellSelectionPixel(nType, nX * pViewData->GetPPTX(), nY * pViewData->GetPPTY()); } } diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx index e204b9728285..dd7b43d1eea4 100644 --- a/sc/source/ui/view/gridwin4.cxx +++ b/sc/source/ui/view/gridwin4.cxx @@ -991,7 +991,7 @@ void ScGridWindow::LogicInvalidate(const Rectangle* pRectangle) pViewData->GetDocument()->GetDrawLayer()->libreOfficeKitCallback(LOK_CALLBACK_INVALIDATE_TILES, sRectangle.getStr()); } -void ScGridWindow::SetCellSelection(int nType, int nX, int nY) +void ScGridWindow::SetCellSelectionPixel(int nType, int nPixelX, int nPixelY) { ScTabView* pTabView = pViewData->GetView(); @@ -1020,7 +1020,7 @@ void ScGridWindow::SetCellSelection(int nType, int nX, int nY) SCsCOL nNewPosX; SCsROW nNewPosY; SCTAB nTab = pViewData->GetTabNo(); - pViewData->GetPosFromPixel(nX * pViewData->GetPPTX(), nY * pViewData->GetPPTY(), eWhich, nNewPosX, nNewPosY); + pViewData->GetPosFromPixel(nPixelX, nPixelY, eWhich, nNewPosX, nNewPosY); // change the selection switch (nType) |