dia r4279 - in trunk: . app objects/standard



Author: hans
Date: Sun Feb 15 14:48:20 2009
New Revision: 4279
URL: http://svn.gnome.org/viewvc/dia?rev=4279&view=rev

Log:
2009-02-15  Hans Breuer  <hans breuer org>

	* app/disp_callbacks.c : allow obj->ops->get_object_menu() return NULL
	  objects/standard/outline.c : use it for outline_get_object_menu



Modified:
   trunk/ChangeLog
   trunk/app/disp_callbacks.c
   trunk/objects/standard/outline.c

Modified: trunk/app/disp_callbacks.c
==============================================================================
--- trunk/app/disp_callbacks.c	(original)
+++ trunk/app/disp_callbacks.c	Sun Feb 15 14:48:20 2009
@@ -236,7 +236,7 @@
   /* Possibly react differently at a handle? */
 
   /* Get its menu, and remember the # of object-generated items */
-  if (obj->ops->get_object_menu == NULL) {
+  if (obj->ops->get_object_menu == NULL || (obj->ops->get_object_menu)(obj, &object_menu_clicked_point) == NULL) {
     dia_menu = &empty_menu;
     if (dia_menu->title &&
 	(0 != strcmp(dia_menu->title,obj->type->name))) {

Modified: trunk/objects/standard/outline.c
==============================================================================
--- trunk/objects/standard/outline.c	(original)
+++ trunk/objects/standard/outline.c	Sun Feb 15 14:48:20 2009
@@ -33,7 +33,7 @@
 #include "boundingbox.h"
 
 #include "tool-icons.h"
-
+
 #include <cairo.h>
 #ifdef CAIRO_HAS_SVG_SURFACE 
 #include <cairo-svg.h>
@@ -128,7 +128,7 @@
   (MoveHandleFunc)      outline_move_handle,
   (GetPropertiesFunc)   object_create_props_dialog,
   (ApplyPropertiesDialogFunc) object_apply_props_from_dialog,
-  (ObjectMenuFunc)      NULL, /* outline_get_object_menu, */
+  (ObjectMenuFunc)      outline_get_object_menu,
   (DescribePropsFunc)   outline_describe_props,
   (GetPropsFunc)        outline_get_props,
   (SetPropsFunc)        outline_set_props,
@@ -424,13 +424,13 @@
   if (i - n - 1 > 0)
     DIA_RENDERER_GET_CLASS (renderer)->draw_bezier (renderer, &pts[n], i - n - 1, &outline->line_color);
 }
-#if 0 /* returning NULL crashes Dia, the method must be NULL if there is nothing to do */
+/* returning used to crash Dia, the method needed to be NULL if there is nothing to do */
 static DiaMenu *
 outline_get_object_menu(Outline *outline, Point *clickedpoint)
 {
   return NULL;
 }
-#endif
+
 /*! A standard props compliant object needs to describe its parameters */
 static PropDescription *
 outline_describe_props (Outline *outline)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]