octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #52798] set (h, "boolean_property") does not d


From: Sahil Yadav
Subject: [Octave-bug-tracker] [bug #52798] set (h, "boolean_property") does not display default correctly
Date: Mon, 22 Jan 2018 09:09:46 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.108 Safari/537.36

Follow-up Comment #1, bug #52798 (project octave):

I was trying to do something else when I got stuck on this very problem.

The problem was in ./libinterp/corefcn/graphics.in.h where the bool property
were initialised using this :


bool_property beingdeleted , "off"


which called this constructor:

  bool_property (const std::string& nm, const graphics_handle& h,
                 const char *val)
      : radio_property (nm, h, radio_values ("on|off"), val)


due to which, while evaluating the property in this :
https://hg.savannah.gnu.org/hgweb/octave/file/bccb203494f6/libinterp/corefcn/graphics.cc#l1206
always the 'else if' part was being executed because our string was "on|off".

Now, I have changed the initialising macros to the other type which require a
bool type of argument and so the string that is passed is based on the 'val'
of the bool argument as:

  bool_property (const std::string& nm, const graphics_handle& h,
                 bool val)
    : radio_property (nm, h, radio_values (val ? "{on}|off" : "on|{off}")


Hence, the patch serves the goal. Hope it will help.

(file #43019)
    _______________________________________________________

Additional Item Attachment:

File name: 52798.diff                     Size:14 KB


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?52798>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]