From edb3d426310169159f4747e405f0c0d3a540515e Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Fri, 19 Mar 2004 23:03:57 +0000 Subject: [PATCH] 2004-03-20 Mark Wielaard * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c (Java_gnu_java_awt_peer_gtk_GtkTextAreaPeer_getVScrollbarWidth): Don't access ws when it is null. (Java_gnu_java_awt_peer_gtk_GtkTextAreaPeer_getHScrollbarHeight): Likewise. From-SVN: r79708 --- libjava/ChangeLog | 8 ++++++++ .../gnu_java_awt_peer_gtk_GtkTextAreaPeer.c | 18 ++++++++++++------ 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 2d99dca87c26..27fbd6037f6e 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,11 @@ +2004-03-20 Mark Wielaard + + * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c + (Java_gnu_java_awt_peer_gtk_GtkTextAreaPeer_getVScrollbarWidth): + Don't access ws when it is null. + (Java_gnu_java_awt_peer_gtk_GtkTextAreaPeer_getHScrollbarHeight): + Likewise. + 2004-03-19 Jeroen Frijters * java/lang/ThreadGroup.java (list): Changed print to println. diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c index ed9ced653da8..704273c08a39 100644 --- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c +++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c @@ -188,9 +188,12 @@ Java_gnu_java_awt_peer_gtk_GtkTextAreaPeer_getHScrollbarHeight gdk_threads_enter (); sw = GTK_SCROLLED_WINDOW (ptr); - gtk_widget_size_request (sw->hscrollbar, &requisition); - gtk_widget_style_get (GTK_WIDGET (sw), "scrollbar_spacing", &spacing, NULL); - height = requisition.height + spacing; + if (sw) + { + gtk_widget_size_request (sw->hscrollbar, &requisition); + gtk_widget_style_get (GTK_WIDGET (sw), "scrollbar_spacing", &spacing, NULL); + height = requisition.height + spacing; + } gdk_threads_leave (); @@ -212,9 +215,12 @@ Java_gnu_java_awt_peer_gtk_GtkTextAreaPeer_getVScrollbarWidth gdk_threads_enter (); sw = GTK_SCROLLED_WINDOW (ptr); - gtk_widget_size_request (sw->vscrollbar, &requisition); - gtk_widget_style_get (GTK_WIDGET (sw), "scrollbar_spacing", &spacing, NULL); - width = requisition.width + spacing; + if (sw) + { + gtk_widget_size_request (sw->vscrollbar, &requisition); + gtk_widget_style_get (GTK_WIDGET (sw), "scrollbar_spacing", &spacing, NULL); + width = requisition.width + spacing; + } gdk_threads_leave ();