diff src/graphics.cc @ 7056:2002804df782

[project @ 2007-10-24 00:32:44 by jwe]
author jwe
date Wed, 24 Oct 2007 00:32:44 +0000
parents bdcea6ede1cd
children 8d57f66e35b8
line wrap: on
line diff
--- a/src/graphics.cc
+++ b/src/graphics.cc
@@ -461,7 +461,7 @@
 void
 gh_manager::do_free (const graphics_handle& h)
 {
-  if (h)
+  if (h.ok ())
     {
       if (h.value () != 0)
 	{
@@ -523,7 +523,7 @@
     {
       h = gh_manager::lookup (val);
 
-      if (h)
+      if (h.ok ())
 	{
 	  graphics_object obj = gh_manager::get_object (h);
 	  
@@ -576,6 +576,12 @@
 }
 
 static bool
+is_handle (const graphics_handle& h)
+{
+  return h.ok ();
+}
+
+static bool
 is_handle (double val)
 {
   graphics_handle h = gh_manager::lookup (val);
@@ -709,7 +715,7 @@
     {
       new_parent = gh_manager::lookup (tmp);
 
-      if (new_parent)
+      if (new_parent.ok ())
 	{
 	  graphics_object parent_obj = gh_manager::get_object (parent);
 
@@ -1374,7 +1380,7 @@
 graphics_handle
 axes::properties::get_title (void) const
 {
-  if (! title)
+  if (! title.ok ())
     title = gh_manager::make_graphics_handle ("text", __myhandle__);
 
   return title;
@@ -1383,7 +1389,7 @@
 graphics_handle
 axes::properties::get_xlabel (void) const
 {
-  if (! xlabel)
+  if (! xlabel.ok ())
     xlabel = gh_manager::make_graphics_handle ("text", __myhandle__);
 
   return xlabel;
@@ -1392,7 +1398,7 @@
 graphics_handle
 axes::properties::get_ylabel (void) const
 {
-  if (! ylabel)
+  if (! ylabel.ok ())
     ylabel = gh_manager::make_graphics_handle ("text", __myhandle__);
 
   return ylabel;
@@ -1401,7 +1407,7 @@
 graphics_handle
 axes::properties::get_zlabel (void) const
 {
-  if (! zlabel)
+  if (! zlabel.ok ())
     zlabel = gh_manager::make_graphics_handle ("text", __myhandle__);
 
   return zlabel;
@@ -1592,13 +1598,13 @@
 void
 axes::properties::remove_child (const graphics_handle& h)
 {
-  if (title && h == title)
+  if (title.ok () && h == title)
     title = gh_manager::make_graphics_handle ("text", __myhandle__);
-  else if (xlabel && h == xlabel)
+  else if (xlabel.ok () && h == xlabel)
     xlabel = gh_manager::make_graphics_handle ("text", __myhandle__);
-  else if (ylabel && h == ylabel)
+  else if (ylabel.ok () && h == ylabel)
     ylabel = gh_manager::make_graphics_handle ("text", __myhandle__);
-  else if (zlabel && h == zlabel)
+  else if (zlabel.ok () && h == zlabel)
     zlabel = gh_manager::make_graphics_handle ("text", __myhandle__);
   else
     base_properties::remove_child (h);
@@ -2651,7 +2657,7 @@
     {
       graphics_handle parent = gh_manager::lookup (val);
 
-      if (parent)
+      if (parent.ok ())
 	{
 	  graphics_handle h
 	    = gh_manager::make_graphics_handle (go_name, parent);
@@ -2710,7 +2716,7 @@
 	      else
 		error ("__go_figure__: invalid figure number");
 
-	      if (! error_state && h)
+	      if (! error_state && h.ok ())
 		{
 		  adopt (0, h);
 
@@ -2813,7 +2819,7 @@
 	{
 	  h = gh_manager::lookup (val);
 
-	  if (h)
+	  if (h.ok ())
 	    {
 	      graphics_object obj = gh_manager::get_object (h);
 
@@ -2867,7 +2873,7 @@
 	{
 	  h = gh_manager::lookup (val);
 
-	  if (h)
+	  if (h.ok ())
 	    {
 	      graphics_object obj = gh_manager::get_object (h);