[evolution/evolution-3-12] e_day_view_show_popup_menu: Avoid runtime warning from tooltip_get_view_event
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution/evolution-3-12] e_day_view_show_popup_menu: Avoid runtime warning from tooltip_get_view_event
- Date: Mon, 21 Jul 2014 13:57:45 +0000 (UTC)
commit 95801bc4d086fc7af1fcbbfab7ce08e254edb5cc
Author: Milan Crha <mcrha redhat com>
Date: Mon Jul 21 15:53:32 2014 +0200
e_day_view_show_popup_menu: Avoid runtime warning from tooltip_get_view_event
The e_day_view_show_popup_menu() can be called with event_num = -1,
which is when the mouse doesn't hover above any event. The function
tooltip_get_view_event() claims a runtime warning in this case, thus
avoid it by properly testing the passed-in value.
calendar/gui/e-day-view.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c
index 8f09d27..9950da6 100644
--- a/calendar/gui/e-day-view.c
+++ b/calendar/gui/e-day-view.c
@@ -4502,7 +4502,10 @@ e_day_view_show_popup_menu (EDayView *day_view,
gint day,
gint event_num)
{
- EDayViewEvent *pevent = tooltip_get_view_event (day_view, day, event_num);
+ EDayViewEvent *pevent = NULL;
+
+ if (event_num >= 0)
+ pevent = tooltip_get_view_event (day_view, day, event_num);
if (pevent && pevent->canvas_item)
tooltip_destroy (day_view, pevent->canvas_item);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]