aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--widgets/misc/e-cursors.c11
-rw-r--r--widgets/misc/e-cursors.h11
2 files changed, 18 insertions, 4 deletions
diff --git a/widgets/misc/e-cursors.c b/widgets/misc/e-cursors.c
index b4eb2436ec..d38fe71d0c 100644
--- a/widgets/misc/e-cursors.c
+++ b/widgets/misc/e-cursors.c
@@ -17,9 +17,16 @@ void cursors_init (void);
void cursors_shutdown (void);
#define cursor_set(win,c) \
- gdk_window_set_cursor (win, gnumeric_cursors [c].cursor)
+ do { \
+ if (win) \
+ gdk_window_set_cursor (win, gnumeric_cursors [c].cursor); \
+} while (0)
#define cursor_set_widget(w,c) \
- gdk_window_set_cursor (GTK_WIDGET (w)->window, gnumeric_cursors [c].cursor)
+ do { \
+ if (GTK_WIDGET (w)->window) \
+ gdk_window_set_cursor (GTK_WIDGET (w)->window, gnumeric_cursors [c].cursor); \
+} while (0)
+
#endif /* GNUMERIC_CURSORS_H */
diff --git a/widgets/misc/e-cursors.h b/widgets/misc/e-cursors.h
index b4eb2436ec..d38fe71d0c 100644
--- a/widgets/misc/e-cursors.h
+++ b/widgets/misc/e-cursors.h
@@ -17,9 +17,16 @@ void cursors_init (void);
void cursors_shutdown (void);
#define cursor_set(win,c) \
- gdk_window_set_cursor (win, gnumeric_cursors [c].cursor)
+ do { \
+ if (win) \
+ gdk_window_set_cursor (win, gnumeric_cursors [c].cursor); \
+} while (0)
#define cursor_set_widget(w,c) \
- gdk_window_set_cursor (GTK_WIDGET (w)->window, gnumeric_cursors [c].cursor)
+ do { \
+ if (GTK_WIDGET (w)->window) \
+ gdk_window_set_cursor (GTK_WIDGET (w)->window, gnumeric_cursors [c].cursor); \
+} while (0)
+
#endif /* GNUMERIC_CURSORS_H */