diff options
author | Jan Holesovsky <kendy@collabora.com> | 2015-04-02 10:00:39 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-04-07 09:18:12 +0200 |
commit | a72a026c0f6fd3fecd154b2330f6f25e4a206fe6 (patch) | |
tree | 417525cee136b58871de873216e4b37f4b7ec14b | |
parent | 51576ad26a9a9a53383ab0c17fb7e46f586b3a26 (diff) |
sc tiled editing: Moving handles in text in drawing shapes in Calc.
Now it is possible to move the cursor or adjust the selection in text in
drawing shapes in Calc too.
Change-Id: I9ed5b2efa426dda669ec32a2b6aa05d95481ef3d
-rw-r--r-- | sc/source/ui/unoobj/docuno.cxx | 31 |
1 files changed, 27 insertions, 4 deletions
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx index 67d93eebf0be..bb319bc58b84 100644 --- a/sc/source/ui/unoobj/docuno.cxx +++ b/sc/source/ui/unoobj/docuno.cxx @@ -21,6 +21,7 @@ #include "scitems.hxx" #include <editeng/editview.hxx> +#include <editeng/outliner.hxx> #include <svx/fmdpage.hxx> #include <svx/fmview.hxx> #include <svx/svditer.hxx> @@ -569,10 +570,11 @@ void ScModelObj::setTextSelection(int nType, int nX, int nY) ScViewData* pViewData = ScDocShell::GetViewData(); ScTabViewShell* pViewShell = pViewData->GetViewShell(); ScInputHandler* pInputHandler = SC_MOD()->GetInputHdl(pViewShell); + ScDrawView* pDrawView = pViewData->GetScDrawView(); if (pInputHandler && pInputHandler->IsInputMode()) { - // forwarding to editeng - we are editing a cell content + // forwarding to editeng - we are editing the cell content EditView* pTableView = pInputHandler->GetTableView(); assert(pTableView); @@ -593,12 +595,33 @@ void ScModelObj::setTextSelection(int nType, int nX, int nY) break; } } + else if (pDrawView && pDrawView->IsTextEdit()) + { + // forwarding to editeng - we are editing the text in shape + OutlinerView* pOutlinerView = pDrawView->GetTextEditOutlinerView(); + EditView& rEditView = pOutlinerView->GetEditView(); + + Point aPoint(convertTwipToMm100(nX), convertTwipToMm100(nY)); + switch (nType) + { + case LOK_SETTEXTSELECTION_START: + rEditView.SetCursorLogicPosition(aPoint, /*bPoint=*/false, /*bClearMark=*/false); + break; + case LOK_SETTEXTSELECTION_END: + rEditView.SetCursorLogicPosition(aPoint, /*bPoint=*/true, /*bClearMark=*/false); + break; + case LOK_SETTEXTSELECTION_RESET: + rEditView.SetCursorLogicPosition(aPoint, /*bPoint=*/true, /*bClearMark=*/true); + break; + default: + assert(false); + break; + } + } else { - // There seems to be no clear way of getting the grid window for this - // particular document, hence we need to hope we get the right window. + // just updating the cell selection ScGridWindow* pGridWindow = pViewData->GetActiveWin(); - if (!pGridWindow) return; |