diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-03-30 16:20:13 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-04-07 09:18:01 +0200 |
commit | 046be649beec4393490fd189e953eb19c472d4ee (patch) | |
tree | c5aa260acebd994a4647ccaa797f55d999d99252 /svx | |
parent | 32cfef5cb32d944df81d2e1aa8a81d175b4101cb (diff) |
sd tiled rendering: support turning an editeng selection into a table one
With this, it's possible to drag the selection handle of an editeng
selection in an Impress table and drag it outside the table cell to
create an Impress table selection. Some unexpected graphic selection
still appears, though.
Change-Id: Ia7b36036ce2bda5cca570e8b6075238d5167090f
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/svdraw/selectioncontroller.cxx | 3 | ||||
-rw-r--r-- | svx/source/table/tablecontroller.cxx | 24 |
2 files changed, 19 insertions, 8 deletions
diff --git a/svx/source/svdraw/selectioncontroller.cxx b/svx/source/svdraw/selectioncontroller.cxx index 6d8493436680..d8f7fbfcd51a 100644 --- a/svx/source/svdraw/selectioncontroller.cxx +++ b/svx/source/svdraw/selectioncontroller.cxx @@ -105,8 +105,9 @@ bool SelectionController::hasSelectedCells() const return false; } -void SelectionController::setCursorLogicPosition(const Point& /*rPosition*/, bool /*bPoint*/) +bool SelectionController::setCursorLogicPosition(const Point& /*rPosition*/, bool /*bPoint*/) { + return false; } } diff --git a/svx/source/table/tablecontroller.cxx b/svx/source/table/tablecontroller.cxx index b2d5d6aeaa10..12c4bf6222c6 100644 --- a/svx/source/table/tablecontroller.cxx +++ b/svx/source/table/tablecontroller.cxx @@ -3152,21 +3152,31 @@ bool SvxTableController::isColumnHeader() return aSettings.mbUseFirstColumn; } -void SvxTableController::setCursorLogicPosition(const Point& rPosition, bool bPoint) +bool SvxTableController::setCursorLogicPosition(const Point& rPosition, bool bPoint) { if (mxTableObj->GetObjIdentifier() != OBJ_TABLE) - return; + return false; SdrTableObj* pTableObj = static_cast<SdrTableObj*>(mxTableObj.get()); CellPos aCellPos; if (pTableObj->CheckTableHit(rPosition, aCellPos.mnCol, aCellPos.mnRow, 0) != SDRTABLEHIT_NONE) { - if (bPoint) - maCursorLastPos = aCellPos; - else - maCursorFirstPos = aCellPos; - mpView->MarkListHasChanged(); + // Position is a table cell. + if (mbCellSelectionMode) + { + // We have a table selection already: adjust the point or the mark. + if (bPoint) + setSelectedCells(maCursorFirstPos, aCellPos); + else + setSelectedCells(aCellPos, maCursorLastPos); + return true; + } + else if (aCellPos != maMouseDownPos) + // No selection, but rPosition is at an other cell: start table selection. + StartSelection(maMouseDownPos); } + + return false; } } } |