bugGNU Octave - Bugs: bug #33068, Radio property values are not case...

 
 

bug #33068: Radio property values are not case insensitive

Submitted by:  David Bateman <dbateman>
Submitted on:  Wed 13 Apr 2011 08:18:12 PM UTC  
 
Category: PlottingSeverity: 3 - Normal
Priority: 5 - NormalItem Group: None
Status: FixedAssigned to: David Bateman <dbateman>
Originator Name: David BatemanOpen/Closed: Closed
Release: 3.4.0Operating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

(Jump to the original submission Jump to the original submission)

Wed 11 May 2011 08:12:55 PM UTC, comment #7:

Well as no one complained about this patch I push it

David

David Bateman <dbateman>
Project MemberIn charge of this item.
Thu 14 Apr 2011 01:52:14 PM UTC, comment #6:

I did a couple of quick tests with David's changeset. It works for me as well.

Ben Abbott <bpabbott>
Project Member
Thu 14 Apr 2011 12:59:03 PM UTC, comment #5:

Ok the attached changeset appears to fix the issue for me

D.

(file #23240)

David Bateman <dbateman>
Project MemberIn charge of this item.
Thu 14 Apr 2011 12:00:03 PM UTC, comment #4:

Do we need to specialise the std::less<caseless_str> function? The standard version just calls the "<" operator for caseless_str, so adding the

bool operator < (const std::string& s) const

to the caseless_str class and specialising it for case insensitive searches should be enough. I'll try it and report back

D.

David Bateman <dbateman>
Project MemberIn charge of this item.
Thu 14 Apr 2011 05:51:03 AM UTC, comment #3:

The problem seems to be that radio_values::validate calls radio_values::contains and that calls possible_vals.find. The data member possible_vals is a std::set<caseless_str> object, but the find fails because there is no specialized operator to replace the std::less function for comparison in the set find function.

I'm not sure what the proper way is to write the comparison function for a caseless_str object.

Note that we don't want to just convert all these strings to lower case when comparing. The fix needs to be in caseless_str, adding a comparison function that will work with STL functions. Otherwise, what is the point of having a caseless_str object? We would always have to remember that to compare, we need to downcase/upcase the strings we are comparing.

John W. Eaton <jwe>
Project Administrator
Thu 14 Apr 2011 01:59:15 AM UTC, comment #2:

For Matlab, the follow all work

>> set (gca, 'XtickLabelMode', 'auto');
>> set (gca, 'xticklabelmode', 'auto');
>> set (gca, 'xticklabelmode', 'Auto');
>> get (gca, 'xticklabelMode')

ans = auto

With Octave ...

octave:1> set (gca, 'xticklabelmode', 'Auto')
error: invalid value = Auto
error: set: invalid value for radio property "xticklabelmode" (value = Auto)
octave:1> set (gca, 'xticklabelmode', 'auto')

Ben Abbott <bpabbott>
Project Member
Wed 13 Apr 2011 10:58:27 PM UTC, comment #1:

I can't get the command to work at all with version 3.0.5, but both version 3.2.3 and 3.2.4 error out the same way as 3.4.0. This suggests that the behavior has been this way for a long time.

Do you want to convert this to a Feature Request item or close it?

Rik <rik5>
Project Administrator
Wed 13 Apr 2011 08:18:12 PM UTC, original submission:

Radio property key values can be used in a case insensitive manner, like

set (gcf,"renderer","painters")

or

set (gcf,"Renderer","painters")

but the values can't as

set(gcf,"Renderer","Painters")

fails. I seem to remember this working with older versions of octave.

D.

David Bateman <dbateman>
Project MemberIn charge of this item.

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #23240:  changeset added by dbateman (2KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by siko1056 (Updated the item)
  • -unavailable- added by jwe (Posted a comment)
  • -unavailable- added by bpabbott (Posted a comment)
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by dbateman (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 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 28 Sep 2015 02:42:10 PM UTCsiko1056StatusPatch Submitted=>Fixed
    Wed 11 May 2011 08:12:55 PM UTCdbatemanOpen/ClosedOpen=>Closed
    Thu 14 Apr 2011 12:59:03 PM UTCdbatemanAttached File-=>Added changeset, #23240
      StatusNeed Info=>Patch Submitted
      Assigned toNone=>dbateman
    Wed 13 Apr 2011 10:58:27 PM UTCrik5StatusNone=>Need Info

    Back to the top


    Powered by Savane 3.1-cleanup1