summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2015-03-24 15:15:26 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-03-30 09:23:43 +0200
commitefbf462ed6bbd31c92f1132038387f4e22afa5c3 (patch)
treebdb697986e1fa02d442121b0fe6bd7dc51cfc939
parentc14a2662d6004eb282f3122d9a0b4cf581863ad5 (diff)
sc tiled editing: Implement moving of the selection handles.
Change-Id: I724f1693a03194426dfe233c1be08f1fbec1242d
-rw-r--r--sc/inc/docuno.hxx3
-rw-r--r--sc/source/ui/unoobj/docuno.cxx34
2 files changed, 37 insertions, 0 deletions
diff --git a/sc/inc/docuno.hxx b/sc/inc/docuno.hxx
index 4e86b83222ad..a2af3b425497 100644
--- a/sc/inc/docuno.hxx
+++ b/sc/inc/docuno.hxx
@@ -394,6 +394,9 @@ public:
/// @see vcl::ITiledRenderable::postMouseEvent().
virtual void postMouseEvent(int nType, int nX, int nY, int nCount) SAL_OVERRIDE;
+ /// @see vcl::ITiledRenderable::setTextSelection().
+ virtual void setTextSelection(int nType, int nX, int nY) SAL_OVERRIDE;
+
/// @see vcl::ITiledRenderable::initializeForTiledRendering().
virtual void initializeForTiledRendering() SAL_OVERRIDE;
};
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index bac3479fcd6f..74fb41e3938e 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -20,6 +20,7 @@
#include <config_features.h>
#include "scitems.hxx"
+#include <editeng/editview.hxx>
#include <svx/fmdpage.hxx>
#include <svx/fmview.hxx>
#include <svx/svditer.hxx>
@@ -81,6 +82,7 @@
#include "formulagroup.hxx"
#include "gridwin.hxx"
#include "hints.hxx"
+#include <inputhdl.hxx>
#include <inputopt.hxx>
#include "interpre.hxx"
#include "linkuno.hxx"
@@ -555,6 +557,38 @@ void ScModelObj::postMouseEvent(int nType, int nX, int nY, int nCount)
}
}
+void ScModelObj::setTextSelection(int nType, int nX, int nY)
+{
+ SolarMutexGuard aGuard;
+
+ ScViewData* pViewData = ScDocShell::GetViewData();
+ ScInputHandler* pInputHandler = SC_MOD()->GetInputHdl(pViewData->GetViewShell());
+
+ if (!pInputHandler)
+ return;
+
+ EditView* pTableView = pInputHandler->GetTableView();
+ if (!pTableView)
+ return;
+
+ Point aPoint(convertTwipToMm100(nX), convertTwipToMm100(nY));
+ switch (nType)
+ {
+ case LOK_SETTEXTSELECTION_START:
+ pTableView->SetCursorLogicPosition(aPoint, /*bPoint=*/false, /*bClearMark=*/false);
+ break;
+ case LOK_SETTEXTSELECTION_END:
+ pTableView->SetCursorLogicPosition(aPoint, /*bPoint=*/true, /*bClearMark=*/false);
+ break;
+ case LOK_SETTEXTSELECTION_RESET:
+ pTableView->SetCursorLogicPosition(aPoint, /*bPoint=*/true, /*bClearMark=*/true);
+ break;
+ default:
+ assert(false);
+ break;
+ }
+}
+
void ScModelObj::initializeForTiledRendering()
{
SolarMutexGuard aGuard;