[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - sc/source

Henry Castro hcastro at collabora.com
Tue Mar 24 01:39:03 PDT 2015


 sc/source/ui/view/gridwin.cxx |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit c2596244325bb566dd460ada29207d0c05b83293
Author: Henry Castro <hcastro at collabora.com>
Date:   Sun Mar 22 20:13:29 2015 -0400

    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

diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 3bbe8b8..a89d4e1 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)


More information about the Libreoffice-commits mailing list