vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 1cf3e446744ae679bc89b39dcbbcf6b4e9821f3a
Author: Lucas Baudin <[email protected]>
Date:   Sat Mar 3 15:44:54 2012 +0100

    gtk3: Avoid crash with some themes (unico based)
    
    We didn't check wether the window was big enough to draw all the widgets. 
Sometimes, when the window was displaying, it was too small and drawing outside 
of the window caused a crash, we didn't take into account that the root point 
for drawing gtk3 widgets wasn't always (0,0).

diff --git a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx 
b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx
index 95aa313..6bfad00 100644
--- a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx
@@ -1002,8 +1002,10 @@ void GtkSalGraphics::renderAreaToPix( cairo_t *cr,
 
     unsigned char *src = data.get();
     src += (int)ay * nStride + (int)ax * 3;
+    awidth = MIN (region->width, size.getX() - ax);
+    aheight = MIN (region->height, size.getY() - ay);
 
-    for (int y = 0; y < size.getY(); ++y)
+    for (int y = 0; y < aheight; ++y)
     {
         for (int x = 0; x < awidth && y < aheight; ++x)
         {
_______________________________________________
Libreoffice-commits mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to