changeset 19144:fa48651fbb8a

isstruct for classdef objects should not return true. * ov.h (octave_value::is_classdef_object): New method. * ov-base.h (octave_base_value::is_classdef_object): Likewise. * ov-classdef.h (octave_classdef::is_classdef_object): Likewise. (octave_classdef::is_map): Return false. * variables.cc (generate_struct_completions): Do auto-completion for classdef objects too.
author Michael Goffioul <michael.goffioul@gmail.com>
date Sat, 20 Sep 2014 17:16:56 -0400
parents e90bfaadb489
children d4a920d28242
files libinterp/corefcn/variables.cc libinterp/octave-value/ov-base.h libinterp/octave-value/ov-classdef.h libinterp/octave-value/ov.h
diffstat 4 files changed, 10 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/variables.cc	Sat Sep 20 12:56:47 2014 -0700
+++ b/libinterp/corefcn/variables.cc	Sat Sep 20 17:16:56 2014 -0400
@@ -283,7 +283,8 @@
 
           frame.run ();
 
-          if (tmp.is_defined () && (tmp.is_map () || tmp.is_java ()))
+          if (tmp.is_defined () &&
+              (tmp.is_map () || tmp.is_java () || tmp.is_classdef_object ()))
             names = tmp.map_keys ();
         }
     }
--- a/libinterp/octave-value/ov-base.h	Sat Sep 20 12:56:47 2014 -0700
+++ b/libinterp/octave-value/ov-base.h	Sat Sep 20 17:16:56 2014 -0400
@@ -366,6 +366,8 @@
 
   virtual bool is_object (void) const { return false; }
 
+  virtual bool is_classdef_object (void) const { return false; }
+
   virtual bool is_java (void) const { return false; }
 
   virtual bool is_cs_list (void) const { return false; }
--- a/libinterp/octave-value/ov-classdef.h	Sat Sep 20 12:56:47 2014 -0700
+++ b/libinterp/octave-value/ov-classdef.h	Sat Sep 20 17:16:56 2014 -0400
@@ -1409,10 +1409,12 @@
 
   bool is_defined (void) const { return true; }
 
-  bool is_map (void) const { return true; }
+  bool is_map (void) const { return false; }
 
   bool is_object (void) const { return true; }
 
+  bool is_classdef_object (void) const { return true; }
+
   void print (std::ostream& os, bool pr_as_read_syntax = false);
 
   void print_raw (std::ostream& os, bool pr_as_read_syntax = false) const;
--- a/libinterp/octave-value/ov.h	Sat Sep 20 12:56:47 2014 -0700
+++ b/libinterp/octave-value/ov.h	Sat Sep 20 17:16:56 2014 -0400
@@ -572,6 +572,9 @@
   bool is_object (void) const
   { return rep->is_object (); }
 
+  bool is_classdef_object (void) const
+  { return rep->is_classdef_object (); }
+
   bool is_java (void) const
   { return rep->is_java (); }