summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Luth <justin.luth@collabora.com>2018-06-01 08:55:26 +0300
committerJustin Luth <justin_luth@sil.org>2018-06-06 20:12:25 +0200
commit13328a36d68c4141219d9cc549e6d76e108e6076 (patch)
tree42c5ab1fd7bb702a209c1c48a27bdd5136f9345f
parent09cc173d59c0b79dca1ea11b37c858e8716062d3 (diff)
tdf#109190 sd MakeVisible: fix flattened loop logic error
There is a bug in the conversion from while(rRect.Bottom() > aNewPos.Y() + aVisAreaSize.Height()) to const long distBottom(rRect.Bottom() - aNewPos.Y() + aVisAreaSize.Height()); While the bottom of the object is lower on the page than the visual Top position plus the height of the screen, (in other words, it isn't in the visible range of the screen), move the screen down by the size of the object and try again. The loop could first be finished when the shape bottom is exactly at the bottom of the screen: rRect.Bottom() = aNewPos.Y() + screen Height. or rRect.Bottom() - (aNewPos.Y() + aVisAreaSize.Height()) = 0 or rRect.Bottom() - aNewPos.Y() - aVisAreaSize.Height() = 0 Change-Id: I762a39df3cdcd5689c8f6742797a9f7b38ddb384 Reviewed-on: https://gerrit.libreoffice.org/55156 Reviewed-by: Justin Luth <justin_luth@sil.org> Tested-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Armin Le Grand <Armin.Le.Grand@cib.de>
-rw-r--r--sd/source/ui/view/drviewsh.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/sd/source/ui/view/drviewsh.cxx b/sd/source/ui/view/drviewsh.cxx
index e8b4d3185a58..40454bc331c6 100644
--- a/sd/source/ui/view/drviewsh.cxx
+++ b/sd/source/ui/view/drviewsh.cxx
@@ -133,7 +133,7 @@ void DrawViewShell::MakeVisible(const ::tools::Rectangle& rRect, vcl::Window& rW
}
else
{
- const long distRight(rRect.Right() - aNewPos.X() + aVisAreaSize.Width());
+ const long distRight(rRect.Right() - aNewPos.X() - aVisAreaSize.Width());
if(distRight > 0)
{
@@ -178,7 +178,7 @@ void DrawViewShell::MakeVisible(const ::tools::Rectangle& rRect, vcl::Window& rW
}
else
{
- const long distBottom(rRect.Bottom() - aNewPos.Y() + aVisAreaSize.Height());
+ const long distBottom(rRect.Bottom() - aNewPos.Y() - aVisAreaSize.Height());
if(distBottom > 0)
{