summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2015-03-27 22:23:33 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-03-30 09:23:55 +0200
commit9987747c47dba52a5c83956f370941aa25bf5d6a (patch)
tree721742a449ecf95bf3af2730b32eb6e84671694b /sc
parent99394c8e09631280f9d76a790832133f5ef7b873 (diff)
sc tiled editing: Improve the deselection.
Change-Id: Ia7e320bbb8b61497f33e20b9b80aabfed4f75234
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/unoobj/docuno.cxx19
1 files changed, 13 insertions, 6 deletions
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index 5bf0c057b1f2..35566dcdadb1 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -567,7 +567,8 @@ void ScModelObj::setTextSelection(int nType, int nX, int nY)
SolarMutexGuard aGuard;
ScViewData* pViewData = ScDocShell::GetViewData();
- ScInputHandler* pInputHandler = SC_MOD()->GetInputHdl(pViewData->GetViewShell());
+ ScTabViewShell* pViewShell = pViewData->GetViewShell();
+ ScInputHandler* pInputHandler = SC_MOD()->GetInputHdl(pViewShell);
if (pInputHandler && pInputHandler->IsInputMode())
{
@@ -594,8 +595,6 @@ void ScModelObj::setTextSelection(int nType, int nX, int nY)
}
else
{
- // moving the cell selection handles
-
// 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.
ScGridWindow* pGridWindow = pViewData->GetActiveWin();
@@ -603,6 +602,7 @@ void ScModelObj::setTextSelection(int nType, int nX, int nY)
if (!pGridWindow)
return;
+ // move the cell selection handles
pGridWindow->SetCellSelectionPixel(nType, nX * pViewData->GetPPTX(), nY * pViewData->GetPPTY());
}
}
@@ -648,10 +648,17 @@ void ScModelObj::resetSelection()
SolarMutexGuard aGuard;
ScViewData* pViewData = ScDocShell::GetViewData();
- ScTabView* pTabView = pViewData->GetView();
+ ScTabViewShell* pViewShell = pViewData->GetViewShell();
- // deselect the shapes
- pTabView->DrawDeselectAll();
+ // deselect the shapes & texts
+ ScDrawView* pDrawView = pViewShell->GetScDrawView();
+ if (pDrawView)
+ {
+ pDrawView->ScEndTextEdit();
+ pDrawView->UnmarkAll();
+ }
+ else
+ pViewShell->Unmark();
// and hide the cell and text selection
pDocShell->GetDocument().GetDrawLayer()->libreOfficeKitCallback(LOK_CALLBACK_TEXT_SELECTION, "");