changeset 26012:227e02c26617

Deprecate C++ is_figure in favor of isfigure for readability. * NEWS: Announce deprecation and replacement. * graphics.cc (isfigure): New function which check whether input is a figure handle. * graphics.cc (is_figure): Add OCTAVE_DEPRECATED decoration to function. * graphics.cc (xcreatefcn): Replace call to "is_figure" with "isfigure".
author Rik <rik@octave.org>
date Fri, 02 Nov 2018 11:14:32 -0700
parents fbc23950b00a
children 1d366a105f18
files NEWS libinterp/corefcn/graphics.cc
diffstat 2 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/NEWS	Fri Nov 02 10:03:10 2018 -0700
+++ b/NEWS	Fri Nov 02 11:14:32 2018 -0700
@@ -168,6 +168,7 @@
 
       Function             | Replacement
       ---------------------|------------------
+      is_figure            | isfigure
       is_hghandle          | ishghandle
 
 ---------------------------------------------------------
--- a/libinterp/corefcn/graphics.cc	Fri Nov 02 10:03:10 2018 -0700
+++ b/libinterp/corefcn/graphics.cc	Fri Nov 02 11:14:32 2018 -0700
@@ -3015,13 +3015,17 @@
 { return ishghandle (val); }
 
 static bool
-is_figure (double val)
+isfigure (double val)
 {
   graphics_object go = gh_manager::get_object (val);
 
   return go && go.isa ("figure");
 }
 
+OCTAVE_DEPRECATED (5.0, "use 'isfigure' instead")
+static bool is_figure (double val)
+{ return isfigure (val); }
+
 static void
 xcreatefcn (const graphics_handle& h)
 {
@@ -12086,7 +12090,7 @@
 
   octave_value retval;
 
-  if (is_figure (val))
+  if (isfigure (val))
     {
       graphics_handle h = gh_manager::lookup (val);