sc/source/ui/view/gridwin4.cxx |    6 ++++++
 1 file changed, 6 insertions(+)

New commits:
commit 2ed4102a56981e5524a9992ef95e2c980db197fd
Author:     Szymon Kłos <szymon.k...@collabora.com>
AuthorDate: Tue Oct 12 11:00:10 2021 +0200
Commit:     Szymon Kłos <szymon.k...@collabora.com>
CommitDate: Tue Oct 12 13:35:42 2021 +0200

    tdf#145016 calc: don't show selection from other split panes
    
    Change-Id: I636d98b5b95bb7ad51b39c6328440686f0bfd030
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123442
    Tested-by: Jenkins
    Reviewed-by: Szymon Kłos <szymon.k...@collabora.com>

diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index e37949f7ef23..9ee886d1ad50 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -2143,6 +2143,12 @@ void ScGridWindow::GetRectsAnyFor(const ScMarkData 
&rMarkData,
         PutInOrder( nX1, nX2 );
         PutInOrder( nY1, nY2 );
 
+        SCCOL nPosX = mrViewData.GetPosX( eHWhich );
+        SCROW nPosY = mrViewData.GetPosY( eVWhich );
+        // is the selection visible at all?
+        if (nX2 < nPosX || nY2 < nPosY)
+            return;
+
         Point aScrStartPos = bInPrintTwips ? mrViewData.GetPrintTwipsPos(nX1, 
nY1) :
             mrViewData.GetScrPos(nX1, nY1, eWhich);
 

Reply via email to