Blame SOURCES/0082-bnc-862514-Handle-corner-case-in-slide-sorter-correc.patch

f085be
From a4a5fe4c66fe35c432127c28be7d52dc52fb4f58 Mon Sep 17 00:00:00 2001
f085be
From: Jan Holesovsky <kendy@collabora.com>
f085be
Date: Fri, 1 Aug 2014 21:10:22 +0200
f085be
Subject: [PATCH 082/137] bnc#862514: Handle corner case in slide sorter
f085be
 correctly.
f085be
MIME-Version: 1.0
f085be
Content-Type: text/plain; charset=UTF-8
f085be
Content-Transfer-Encoding: 8bit
f085be
f085be
We should never return -1 when bIncludeBordersAndGaps is true; but that could
f085be
have happened in a corner case:
f085be
f085be
* export SAL_USE_VCLPLUGIN=gen
f085be
* start LibreOffice
f085be
* open a presentation with many slides
f085be
* resize the window so that it shows the slides _exactly_, no slide is cut
f085be
  off in the slide sorter
f085be
* point the mouse pointer into the left "Slides" sidebar (slide sorter) so
f085be
  that it does not cause any mouse-over effect (somehow between the left
f085be
  border, and the slides - there is space that can do this)
f085be
* turn the mouse wheel all the way down so that the last slide is at the
f085be
  bottom
f085be
* turn the mouse wheel up _once_
f085be
* turn the mouse wheel down _once_ - it will look like the view does not
f085be
  change (the last but one is still at the bottom), but you can see the
f085be
  scrollbar jump to the top
f085be
* and now you can again start turning the wheel all the way down to repeat
f085be
  the procedure :-)
f085be
f085be
Reviewed-on: https://gerrit.libreoffice.org/10683
f085be
Reviewed-by: David Tardon <dtardon@redhat.com>
f085be
Tested-by: David Tardon <dtardon@redhat.com>
f085be
(cherry picked from commit 48272a9a720039e79c6a684f1f037811ea42ed0c)
f085be
f085be
Change-Id: I0253c89513222a1f2eb3263068997d10eea0f130
f085be
Signed-off-by: Matúš Kukan <matus.kukan@collabora.com>
f085be
---
f085be
 sd/source/ui/slidesorter/view/SlsLayouter.cxx | 12 ++++++++++--
f085be
 1 file changed, 10 insertions(+), 2 deletions(-)
f085be
f085be
diff --git a/sd/source/ui/slidesorter/view/SlsLayouter.cxx b/sd/source/ui/slidesorter/view/SlsLayouter.cxx
f085be
index c4b6ae2..5c9ec8e 100644
f085be
--- a/sd/source/ui/slidesorter/view/SlsLayouter.cxx
f085be
+++ b/sd/source/ui/slidesorter/view/SlsLayouter.cxx
f085be
@@ -627,11 +627,15 @@ sal_Int32 Layouter::Implementation::GetRowAtPosition (
f085be
         // When inside the gap below then nYPosition is not over a page
f085be
         // object.
f085be
         if (nDistanceIntoGap > 0)
f085be
-            nRow = ResolvePositionInGap (
f085be
+        {
f085be
+            sal_Int32 nResolvedRow = ResolvePositionInGap(
f085be
                 nDistanceIntoGap,
f085be
                 eGapMembership,
f085be
                 nRow,
f085be
                 mnVerticalGap);
f085be
+            if (!bIncludeBordersAndGaps || nResolvedRow != -1)
f085be
+                nRow = nResolvedRow;
f085be
+        }
f085be
     }
f085be
     else if (bIncludeBordersAndGaps)
f085be
     {
f085be
@@ -670,11 +674,15 @@ sal_Int32 Layouter::Implementation::GetColumnAtPosition (
f085be
         // When inside the gap at the right then nXPosition is not over a
f085be
         // page object.
f085be
         if (nDistanceIntoGap > 0)
f085be
-            nColumn = ResolvePositionInGap (
f085be
+        {
f085be
+            sal_Int32 nResolvedColumn = ResolvePositionInGap(
f085be
                 nDistanceIntoGap,
f085be
                 eGapMembership,
f085be
                 nColumn,
f085be
                 mnHorizontalGap);
f085be
+            if (!bIncludeBordersAndGaps || nResolvedColumn != -1)
f085be
+                nColumn = nResolvedColumn;
f085be
+        }
f085be
     }
f085be
     else if (bIncludeBordersAndGaps)
f085be
     {
f085be
-- 
f085be
1.9.3
f085be