[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sc/source

Szymon KÅ‚os (via logerrit) logerrit at kemper.freedesktop.org
Fri Dec 4 14:35:05 UTC 2020


 sc/source/ui/view/gridwin.cxx |   27 +++++++++++++--------------
 1 file changed, 13 insertions(+), 14 deletions(-)

New commits:
commit cbad3dec6421afb5f0040058bba7b97c3ee09cb4
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Fri Dec 4 15:14:03 2020 +0100
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Fri Dec 4 15:33:52 2020 +0100

    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 at gmail.com>
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>

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;


More information about the Libreoffice-commits mailing list