summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2021-10-12 11:00:10 +0200
committerSzymon Kłos <szymon.klos@collabora.com>2021-10-12 13:35:42 +0200
commit2ed4102a56981e5524a9992ef95e2c980db197fd (patch)
tree4e1d9e4377114981404cbffb60b4170abb2edb24
parentd968425f009598bca3d10964c64f093b8d785c86 (diff)
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.klos@collabora.com>
-rw-r--r--sc/source/ui/view/gridwin4.cxx6
1 files changed, 6 insertions, 0 deletions
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);