sc/source/ui/view/gridwin.cxx |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

New commits:
commit 77da04eb2ff83fe79e3ed8d79bc4f5f81af9119f
Author:     Tünde Tóth <toth.tu...@nisz.hu>
AuthorDate: Tue Apr 13 14:16:26 2021 +0200
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Tue Apr 20 21:14:16 2021 +0200

    tdf#93664 sc: fix filtering clicking on cells merged horizontally
    
    Click on the filter button of cells merged horizontally
    showed the "Empty" entry instead of the filter list.
    
    Pressing Alt-Down (.uno:DataSelect) worked correctly here,
    so only mouse handling was broken. This was a regression
    from commit aaab3a79dfd762a64fa4c1d19dd29ae46c0b9dd0
    "Resolves: #i120017, filter button is not shown in merged cell"
    (which fixed filtering clicking on cells merged vertically).
    Partial revert of that commit sets the correct
    first column in the merged range again instead of the last one.
    
    Change-Id: I83724f18580134868867bc829cad0739f0932733
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114050
    Tested-by: László Németh <nem...@numbertext.org>
    Reviewed-by: László Németh <nem...@numbertext.org>
    (cherry picked from commit b7d8ee083230964de2e1580c4639ee4cd307207f)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114353
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index cf781d0319b4..d794e1c9bcdb 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -1734,14 +1734,17 @@ void ScGridWindow::HandleMouseButtonDown( const 
MouseEvent& rMEvt, MouseEventSta
         SCCOL nRealPosX;
         SCROW nRealPosY;
         mrViewData.GetPosFromPixel( aPos.X(), aPos.Y(), eWhich, nRealPosX, 
nRealPosY, false );//the real row/col
-        const ScMergeFlagAttr* pRealPosAttr = rDoc.GetAttr( nRealPosX, 
nRealPosY, nTab, ATTR_MERGE_FLAG );
-        const ScMergeFlagAttr* pAttr = rDoc.GetAttr( nPosX, nPosY, nTab, 
ATTR_MERGE_FLAG );
+
+        // show in the merged cells the filter of the first cell (nPosX 
instead of nRealPosX)
+        const ScMergeFlagAttr* pRealPosAttr = rDoc.GetAttr(nPosX, nRealPosY, 
nTab, ATTR_MERGE_FLAG);
         if( pRealPosAttr->HasAutoFilter() )
         {
             SC_MOD()->InputEnterHandler();
-            if (DoAutoFilterButton( nRealPosX, nRealPosY, rMEvt))
+            if (DoAutoFilterButton(nPosX, nRealPosY, rMEvt))
                 return;
         }
+
+        const ScMergeFlagAttr* pAttr = rDoc.GetAttr(nPosX, nPosY, nTab, 
ATTR_MERGE_FLAG);
         if (pAttr->HasAutoFilter())
         {
             if (DoAutoFilterButton(nPosX, nPosY, rMEvt))
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to