diff options
author | Mert Tumer <mert.tumer@collabora.com> | 2020-04-09 19:36:53 +0300 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2020-04-15 15:37:42 +0200 |
commit | d09a35bc10251ef0b66e06c6ffbb2d16332b318b (patch) | |
tree | b6ba17b50e296578447c83deb30e8bd746a93848 | |
parent | 2f6cbb67099edde535a81e7b0a32c1418805d6d6 (diff) |
mobile: fix double tap on chart doesn't get into editmode
Sometimes double tapping on a chart when it is not selected
in the beginning, starts the input mode instead of chart
editing.
Change-Id: Iee2a01c1ac909ac4060e91cdacfa9161dc4f1c3b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91992
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Andras Timar <andras.timar@collabora.com>
-rw-r--r-- | sc/source/ui/drawfunc/fudraw.cxx | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/sc/source/ui/drawfunc/fudraw.cxx b/sc/source/ui/drawfunc/fudraw.cxx index 65a3f0b843da..c60890c23c15 100644 --- a/sc/source/ui/drawfunc/fudraw.cxx +++ b/sc/source/ui/drawfunc/fudraw.cxx @@ -28,6 +28,7 @@ #include <svx/svdundo.hxx> #include <sfx2/dispatch.hxx> #include <sfx2/viewfrm.hxx> +#include <sfx2/lokhelper.hxx> #include <sc.hrc> #include <fudraw.hxx> @@ -38,6 +39,7 @@ #include <docsh.hxx> #include <postit.hxx> #include <drawview.hxx> +#include <comphelper/lok.hxx> // base class for draw module specific functions FuDraw::FuDraw(ScTabViewShell& rViewSh, vcl::Window* pWin, ScDrawView* pViewP, @@ -248,6 +250,15 @@ bool FuDraw::KeyInput(const KeyEvent& rKEvt) if( !pView->IsTextEdit() && 1 == rMarkList.GetMarkCount() ) { SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj(); + bool isMobilePhone = comphelper::LibreOfficeKit::isActive() && comphelper::LibreOfficeKit::isMobilePhone(SfxLokHelper::getView()); + // Double tapping on charts on phone may result in activating the edit mode which is not wanted. + // It happens due to the delay of selection message of the object from kit to javascript + // in that case F2 is sent instead of double click + if (isMobilePhone && ScDocument::IsChart(pObj)) + { + rViewShell.ActivateObject( static_cast< SdrOle2Obj* >( pObj ), 0 ); + break; + } if ( lcl_KeyEditMode( pObj, rViewShell, nullptr ) ) // start text edit for suitable object bReturn = true; } |