diff options
author | Jan Holesovsky <kendy@collabora.com> | 2015-03-25 15:45:32 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-03-30 09:23:49 +0200 |
commit | a7e75be63e7ca7a084d0dbcb78c13f2896eb5b5c (patch) | |
tree | a64810ac4e5f63380dc9ba13d081a8e9ad8dd97a /sc | |
parent | dd3eb52e5b9837e6408b0c2e9b44dc63119cd62c (diff) |
sc tiled editing: Small refactor, preparing for moving cell selections.
Change-Id: I61e98357a4d7248bd805907c8b37c94900259297
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/unoobj/docuno.cxx | 45 |
1 files changed, 25 insertions, 20 deletions
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx index 683573cff871..fa133f35dd21 100644 --- a/sc/source/ui/unoobj/docuno.cxx +++ b/sc/source/ui/unoobj/docuno.cxx @@ -563,28 +563,33 @@ void ScModelObj::setTextSelection(int nType, int nX, int nY) ScViewData* pViewData = ScDocShell::GetViewData(); ScInputHandler* pInputHandler = SC_MOD()->GetInputHdl(pViewData->GetViewShell()); - if (!pInputHandler) - return; - - EditView* pTableView = pInputHandler->GetTableView(); - if (!pTableView) - return; + if (pInputHandler && pInputHandler->IsInputMode()) + { + // forwarding to editeng - we are editing a cell content + EditView* pTableView = pInputHandler->GetTableView(); + assert(pTableView); - Point aPoint(convertTwipToMm100(nX), convertTwipToMm100(nY)); - switch (nType) + 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; + } + } + else { - 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; + // moving the cell selection handles + // TODO } } |