[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - sc/inc sc/source

Jan Holesovsky kendy at collabora.com
Tue Mar 24 07:17:08 PDT 2015


 sc/inc/docuno.hxx              |    3 +++
 sc/source/ui/unoobj/docuno.cxx |   34 ++++++++++++++++++++++++++++++++++
 2 files changed, 37 insertions(+)

New commits:
commit 0811fc2ff9a06f4289937ce0af1072467e2f2aa3
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Tue Mar 24 15:15:26 2015 +0100

    sc tiled editing: Implement moving of the selection handles.
    
    Change-Id: I724f1693a03194426dfe233c1be08f1fbec1242d

diff --git a/sc/inc/docuno.hxx b/sc/inc/docuno.hxx
index 4e86b83..a2af3b4 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 44e47b0..c1c3e4e 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;


More information about the Libreoffice-commits mailing list