dia r4311 - in trunk: . app



Author: hans
Date: Sun Mar  8 16:56:51 2009
New Revision: 4311
URL: http://svn.gnome.org/viewvc/dia?rev=4311&view=rev

Log:
2009-03-08  Hans Breuer  <hans breuer org>

	* app/menus.c : don't pass diagram and filename to plug-ins called from
	the toolbox-menu, otherwise the pydia help series could unintentinally
	modify unrelated open diagrams



Modified:
   trunk/ChangeLog
   trunk/app/menus.c

Modified: trunk/app/menus.c
==============================================================================
--- trunk/app/menus.c	(original)
+++ trunk/app/menus.c	Sun Mar  8 16:56:51 2009
@@ -1213,8 +1213,13 @@
 
   /* and finally invoke it */
   if (cbf->callback) {
-    DDisplay *ddisp = ddisplay_active();
-    DiagramData* diadata = ddisp ? ddisp->diagram->data : NULL;
+    DDisplay *ddisp = NULL;
+    DiagramData* diadata = NULL;
+    /* stuff from the toolbox menu should never get a diagram to modify */
+    if (strncmp (cbf->menupath, TOOLBOX_MENU, strlen (TOOLBOX_MENU)) != 0) {
+      ddisp = ddisplay_active();
+      diadata = ddisp ? ddisp->diagram->data : NULL;
+    }
     cbf->callback (diadata, ddisp ? ddisp->diagram->filename : NULL, 0, cbf->user_data);
   }
 }



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