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-04 15:33:52 +0100
commitcbad3dec6421afb5f0040058bba7b97c3ee09cb4 (patch)
treee291220dede9e062afa94140f921e6063ca156d5 /sc
parentdbcc736e6f7fd540c8edd7f73a2eb80525fcf17a (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>
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 fe1bf2703a34..c3473afaebbf 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -2116,23 +2116,26 @@ void ScGridWindow::MouseButtonUp( const MouseEvent& rMEvt )
pView->ResetBrushDocument(); // invalidates pBrushDoc pointer
}
+ Point aPos = rMEvt.GetPosPixel();
+ SCCOL nPosX;
+ SCROW nPosY;
+ SCTAB nTab = pViewData->GetTabNo();
+ pViewData->GetPosFromPixel( aPos.X(), aPos.Y(), eWhich, nPosX, nPosY );
+ ScDPObject* pDPObj = pDoc->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 = pViewData->GetTabNo();
- pViewData->GetPosFromPixel( aPos.X(), aPos.Y(), eWhich, nPosX, nPosY );
- ScDPObject* pDPObj = pDoc->GetDPAtCursor( nPosX, nPosY, nTab );
if ( pDPObj && pDPObj->GetSaveData()->GetDrillDown() )
{
ScAddress aCellPos( nPosX, nPosY, pViewData->GetTabNo() );
@@ -2248,9 +2251,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();
pViewData->GetPosFromPixel( aPos.X(), aPos.Y(), eWhich, nPosX, nPosY );
auto pForTabView = dynamic_cast<const ScTabViewShell *>(pViewShell);
OString aCursor = pForTabView->GetViewData().describeCellCursorAt(nPosX, nPosY);
@@ -2303,10 +2304,8 @@ void ScGridWindow::MouseButtonUp( const MouseEvent& rMEvt )
uno::Reference< script::vba::XVBAEventProcessor > xVbaEvents = pDoc->GetVbaEventProcessor();
if( xVbaEvents.is() ) try
{
- Point aPos = rMEvt.GetPosPixel();
- SCCOL nPosX;
- SCROW nPosY;
- SCTAB nTab = pViewData->GetTabNo();
+ aPos = rMEvt.GetPosPixel();
+ nTab = pViewData->GetTabNo();
pViewData->GetPosFromPixel( aPos.X(), aPos.Y(), eWhich, nPosX, nPosY );
OUString sURL;
ScRefCellValue aCell;