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 FunctionSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: FixedAssigned to: None
Originator Name: Open/Closed: Closed
Release: devOperating 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):
https://hg.savannah.gnu.org/hgweb/octave/file/bccb203494f6/libinterp/corefcn/graphics.in.h#l1585

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 Yadav <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 :
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:

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

(file #43019)

Sahil Yadav <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 File(s):
   
   
Comment:
   

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
  • -unavailable- added by pantxo (Updated the item)
  • -unavailable- added by batterylow (Updated the item)
  • -unavailable- added by rik5 (Submitted the item)
  •  

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

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 23 Jan 2018 07:30:12 PM UTCrik5StatusPatch Submitted=>Fixed
      Open/ClosedOpen=>Closed
    Tue 23 Jan 2018 09:55:01 AM UTCpantxoAttached File-=>Added boolprop_default.patch, #43032
      StatusNone=>Patch Submitted
    Mon 22 Jan 2018 02:09:46 PM UTCbatterylowAttached File-=>Added 52798.diff, #43019

    Back to the top


    Powered by Savane 3.1-cleanup1