summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2015-03-26 11:18:35 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-03-30 09:23:51 +0200
commit3aed864e7a2f7024fd81ba81bdc6182848320e0e (patch)
tree35b3632c210723e711efef212df36563921d2e53
parent16d8839c24be1a9539f3d6e0157c5279e92cd37e (diff)
Make SetCellSelection work in pixels, and change the name accordingly.
Change-Id: Ic08f436b8196f29bb958845505a517cebba09f4b
-rw-r--r--sc/source/ui/inc/gridwin.hxx6
-rw-r--r--sc/source/ui/unoobj/docuno.cxx2
-rw-r--r--sc/source/ui/view/gridwin4.cxx4
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)