bugGNU Octave - Bugs: bug #52798, set (h,...


bug #52798: set (h, "boolean_property") does not display default correctly

Submitted by:  Rik <rik5>
Submitted on:  Wed 03 Jan 2018 07:22:16 PM UTC  
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  Closed
Release:  dev Operating System:  Any

Add a New Comment(Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


Tue 23 Jan 2018 07:30:12 PM UTC, comment #4:

I checked in the changeset here (http://hg.savannah.gnu.org/hgweb/octave/rev/b708857d634e). Thanks Sahil. I know you have another patch out for xor, but it will take me a while to review that because I've got other work responsibilities at the moment.

Marking as fixed and closing report.

Rik <rik5>
Project Administrator
Tue 23 Jan 2018 11:19:52 AM UTC, comment #3:

I think the new constructor (v2.1) that you made looks like the one just above it (constructor v1.0):

I thought that this constructor(v2.0) might be used by any other macro as well which may need to call v2.0 (i.e, in its earlier form).

Anyway, if you feel this is better, then I am happy with that too.

Btw, thanks for correcting the commit message as well (I had written some real crap) and yes, my first name is Sahil. :-)

Sahil <batterylow>
Tue 23 Jan 2018 09:55:01 AM UTC, comment #2:

@Sahil: based on your analysis I wrote a simpler patch that fixes the property constructor instead of using another one. Just to be sure, is Sahil your first name (so that your are added at the right place in the contributors)?

(file #43032)

Pantxo Diribarne <pantxo>
Project Member
Mon 22 Jan 2018 02:09:46 PM UTC, comment #1:

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 :

which called this constructor:

due to which, while evaluating the property in this :
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:

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

(file #43019)

Sahil <batterylow>
Wed 03 Jan 2018 07:22:16 PM UTC, original submission:

Boolean graphics properties take the value of "on" or "off". The set (graphic_handle, "property_name") is supposed to list all of the possible values the property can take along with the default value wrapped in '{}'.

For boolean properties, it always wraps the second value of "on" with "{}". Sample code with property "beingdeleted" which has a default of "off" and "clipping" which has a default of "on".

Interestingly, the documentation in the Octave manual gets this right.

Rik <rik5>
Project Administrator


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

Attached Files
file #43032:  boolprop_default.patch added by pantxo (1KiB - text/x-patch)
file #43019:  52798.diff added by batterylow (14KiB - text/x-patch)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by pantxo (Updated the item)
  • -email is unavailable- added by batterylow (Updated the item)
  • -email is unavailable- added by rik5 (Submitted the item)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.




    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-01-23 rik5 StatusPatch Submitted => Fixed
        Open/ClosedOpen => Closed
    2018-01-23 pantxo Attached File- => Added boolprop_default.patch, #43032
        StatusNone => Patch Submitted
    2018-01-22 batterylow Attached File- => Added 52798.diff, #43019

    Back to the top

    Powered by Savane 3.4