summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2020-12-04 15:14:03 +0100
committerSzymon Kłos <szymon.klos@collabora.com>2020-12-09 14:09:01 +0100
commitab224c4196b61c222fbf74a0dfbc57aab9859977 (patch)
treefd30eb54f234deb3f3b8847a69c19a1ec4da740f /sc
parent2a0a670a7bae450bd9d783c7def3d3641647404d (diff)
pivot table: fix interactions in online
Single clicks were identified as double so clicks in the pivot table caused to create new tables or other unwanted behaviour. In case cursor is over pivot table - require real double click. Change-Id: I6ca9af9ff9dbe5a1e00f2b57753ce4f8f298288d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107225 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107405 Tested-by: Jenkins
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/view/gridwin.cxx27
1 files changed, 13 insertions, 14 deletions
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 418e73554096..654554a17dbe 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -2089,23 +2089,26 @@ void ScGridWindow::MouseButtonUp( const MouseEvent& rMEvt )
pView->ResetBrushDocument(); // invalidates pBrushDoc pointer
}
+ Point aPos = rMEvt.GetPosPixel();
+ SCCOL nPosX;
+ SCROW nPosY;
+ SCTAB nTab = mrViewData.GetTabNo();
+ mrViewData.GetPosFromPixel( aPos.X(), aPos.Y(), eWhich, nPosX, nPosY );
+ ScDPObject* pDPObj = rDoc.GetDPAtCursor( nPosX, nPosY, nTab );
+
+ bool bInDataPilotTable = (pDPObj != nullptr);
+
// double click (only left button)
// in the tiled rendering case, single click works this way too
bool bIsTiledRendering = comphelper::LibreOfficeKit::isActive();
bool bDouble = ( rMEvt.GetClicks() == 2 && rMEvt.IsLeft() );
- if ((bDouble || bIsTiledRendering)
+ if ((bDouble || (bIsTiledRendering && !bInDataPilotTable))
&& !bRefMode
&& (nMouseStatus == SC_GM_DBLDOWN || (bIsTiledRendering && nMouseStatus != SC_GM_URLDOWN))
&& !pScMod->IsRefDialogOpen())
{
// data pilot table
- Point aPos = rMEvt.GetPosPixel();
- SCCOL nPosX;
- SCROW nPosY;
- SCTAB nTab = mrViewData.GetTabNo();
- mrViewData.GetPosFromPixel( aPos.X(), aPos.Y(), eWhich, nPosX, nPosY );
- ScDPObject* pDPObj = rDoc.GetDPAtCursor( nPosX, nPosY, nTab );
if ( pDPObj && pDPObj->GetSaveData()->GetDrillDown() )
{
ScAddress aCellPos( nPosX, nPosY, mrViewData.GetTabNo() );
@@ -2221,9 +2224,7 @@ void ScGridWindow::MouseButtonUp( const MouseEvent& rMEvt )
if (isTiledRendering && pViewShell &&
(pViewShell->isLOKMobilePhone() || pViewShell->isLOKTablet()))
{
- Point aPos = rMEvt.GetPosPixel();
- SCCOL nPosX;
- SCROW nPosY;
+ aPos = rMEvt.GetPosPixel();
mrViewData.GetPosFromPixel( aPos.X(), aPos.Y(), eWhich, nPosX, nPosY );
auto pForTabView = dynamic_cast<const ScTabViewShell *>(pViewShell);
OString aCursor = pForTabView->GetViewData().describeCellCursorAt(nPosX, nPosY);
@@ -2276,10 +2277,8 @@ void ScGridWindow::MouseButtonUp( const MouseEvent& rMEvt )
uno::Reference< script::vba::XVBAEventProcessor > xVbaEvents = rDoc.GetVbaEventProcessor();
if( xVbaEvents.is() ) try
{
- Point aPos = rMEvt.GetPosPixel();
- SCCOL nPosX;
- SCROW nPosY;
- SCTAB nTab = mrViewData.GetTabNo();
+ aPos = rMEvt.GetPosPixel();
+ nTab = mrViewData.GetTabNo();
mrViewData.GetPosFromPixel( aPos.X(), aPos.Y(), eWhich, nPosX, nPosY );
OUString sURL;
ScRefCellValue aCell;