summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorHenry Castro <hcastro@collabora.com>2015-03-22 20:13:29 -0400
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-03-30 09:23:42 +0200
commite0fd364a3c49650c9cade1933dfdd96627d853a0 (patch)
treeb1fb13f539943ff13760a33c6a10597e5793b362 /sc
parent0e3fc4ae7e532c670ce723433984a971ca0a5804 (diff)
sc tiled editing: Limit the mouse events only to the document size.
From some reason, when clicking outside of the area visible in the gtktiledviewer, the events starts being misplaced. We need to revert & fix later when we will be able to extend the document size in a convenient way. Change-Id: I210705c9f8909598d8d47c15c14c06f96bfc4caa
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/view/gridwin.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index acb6bd2c4459..a4e161847a64 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -2426,7 +2426,11 @@ void ScGridWindow::LogicMouseButtonDown(const MouseEvent& rMouseEvent)
(void)rDoc;
assert(rDoc.GetDrawLayer()->isTiledRendering());
- MouseButtonDown(rMouseEvent);
+ // Don't allow events outside of our viewport size.
+ // FIXME this will likely cause trouble when we allow extending the
+ // document size; but for now this is necessary to workaround a problem
+ if ( rMouseEvent.GetPosPixel().X() < GetOutputSizePixel().Width() && rMouseEvent.GetPosPixel().Y() < GetOutputSizePixel().Height())
+ MouseButtonDown(rMouseEvent);
}
void ScGridWindow::LogicMouseButtonUp(const MouseEvent& rMouseEvent)