diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-03-27 09:19:25 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-03-30 09:23:54 +0200 |
commit | 54510b3b65141bebb342fea9ffe9f59e7b2d9bbf (patch) | |
tree | f342662d0503762998f2a974b5a8a5c383854f42 /svx | |
parent | ffc571462b99b9b0976099d24f5647feb7371631 (diff) |
svx tiled rendering: double-click in empty table cell selects it
This brings Impress tables in sync with Writer, where long push on
Android selects the empty cell.
Change-Id: If8403ec43daeea6ca79b488a54253cb8b71794d9
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/table/tablecontroller.cxx | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/svx/source/table/tablecontroller.cxx b/svx/source/table/tablecontroller.cxx index 27d6a7d87367..fdd8481cff2c 100644 --- a/svx/source/table/tablecontroller.cxx +++ b/svx/source/table/tablecontroller.cxx @@ -248,6 +248,16 @@ bool SvxTableController::onKeyInput(const KeyEvent& rKEvt, vcl::Window* pWindow bool SvxTableController::onMouseButtonDown(const MouseEvent& rMEvt, vcl::Window* pWindow ) { + if (mxTableObj->GetModel()->isTiledRendering() && !pWindow) + { + // Tiled rendering: get the window that has the disabled map mode. + if (OutputDevice* pOutputDevice = mpView->GetFirstOutputDevice()) + { + if (pOutputDevice->GetOutDevType() == OUTDEV_WINDOW) + pWindow = static_cast<vcl::Window*>(pOutputDevice); + } + } + if( !pWindow || !checkTableObject() ) return false; @@ -294,6 +304,28 @@ bool SvxTableController::onMouseButtonDown(const MouseEvent& rMEvt, vcl::Window* } } + if (mxTableObj->GetModel()->isTiledRendering() && rMEvt.GetClicks() == 2 && rMEvt.IsLeft() && eHit == SDRTABLEHIT_CELLTEXTAREA) + { + bool bEmptyOutliner = false; + if (Outliner* pOutliner = mpView->GetTextEditOutliner()) + { + if (pOutliner->GetParagraphCount() == 1) + { + if (Paragraph* pParagraph = pOutliner->GetParagraph(0)) + bEmptyOutliner = pOutliner->GetText(pParagraph).isEmpty(); + } + } + if (bEmptyOutliner) + { + // Tiled rendering: a left double-click in an empty cell: select it. + StartSelection(maMouseDownPos); + setSelectedCells(maMouseDownPos, maMouseDownPos); + // Update graphic selection, should be hidden now. + mpView->AdjustMarkHdl(); + return true; + } + } + return false; } |