bugGNUstep - Bugs: bug #20434, NSTextfield setStringValue: problem

Group
 
 

bug #20434: NSTextfield setStringValue: problem

Submitter:  Lubo Zavacky <luboz>
Submitted:  Tue 10 Jul 2007 09:13:37 AM UTC
   
 
Category:  Gui/AppKit Severity:  3 - Normal
Item Group:  Change Request Status:  Wont Fix
Privacy:  Public Assigned to:  FredKiefer
Open/Closed:  Declined
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 10 Jul 2007 12:18:30 PM UTC, comment #4: 

Of cource I fix this bug in may application using  [txt setStringValue: [arr description]], but I thing, crashing object on invalid input is not good.

Lubo Zavacky <luboz>
Tue 10 Jul 2007 11:31:38 AM UTC, comment #3: 

I just tested and both of these lines work perfectly:

   [txt setStringValue: [arr description]];
   [txt setObjectValue: arr];

I will decline this bug report. What is strange is that GNUstep is not able to report properly what is going wrong. When trying to show an alert panel with the doesNotRecognizeSelector: message the text cell falls over as the arguments cannot be handled as text. This leads to a very strange output. But this is an unrelated issue:

Array2TxtFld.app/Array2TxtFld: Uncaught exception NSGenericException, reason: Glyph generation was triggered for a layout manager while the text storage it was attached to had unprocessed editing. This is not allowed. Glyph generation may be triggered only at points where calls to -beginEditing and -endEditing are balanced.

Program received signal SIGABRT, Aborted.
[Switching to Thread -1222420800 (LWP 20612)]
0xb7ee8410 in ?? ()
(gdb) bt
#0  0xb7ee8410 in ?? ()
#1  0xbf89ee18 in ?? ()
#2  0x00000006 in ?? ()
#3  0x00005084 in ?? ()
#4  0xb7639060 in raise () from /lib/libc.so.6
#5  0xb763a801 in abort () from /lib/libc.so.6
#6  0xb78d0b66 in _terminate () at NSException.m:686
#7  0xb78d0d3b in _NSFoundationUncaughtExceptionHandler (exception=0x8220ce0)
    at NSException.m:710
#8  0xb78d14a2 in -[NSException raise] (self=0x8220ce0, _cmd=0xb7ed23e8)
    at NSException.m:841
#9  0xb7dd5842 in -[GSHorizontalTypesetter layoutGlyphsInLayoutManager:inTextContainer:startingAtGlyphIndex:previousLineFragmentRect:nextGlyphIndex:numberOfLineFragments:] (self=0xa108c30, _cmd=0xb7ed0a28, layoutManager=0xa10b190,
    textContainer=0xa10b330, glyphIndex=0, previousLineFragRect=
        {origin = {x = 0, y = 0}, size = {width = 0, height = 0}},
    nextGlyphIndex=0xbf89f18c, howMany=0) at GSHorizontalTypesetter.m:1258
#10 0xb7dce45b in -[GSLayoutManager(LayoutHelpers) _doLayout] (
    self=0xa10b190, _cmd=0xb7ed0a38) at GSLayoutManager.m:1596
#11 0xb7dce67a in -[GSLayoutManager(LayoutHelpers) _doLayoutToContainer:] (
---Type <return> to continue, or q <return> to quit---
    self=0xa10b190, _cmd=0xb7ed0a48, cindex=0) at GSLayoutManager.m:1660
#12 0xb7dd004c in -[GSLayoutManager(layout) usedRectForTextContainer:] (
    self=0xa10b190, _cmd=0xb7e945c0, container=0xa10b330)
    at GSLayoutManager.m:2200
#13 0xb7d2288d in cache_lookup_attributed_string (string=0x8127438,
    hasSize=0, size={width = 0, height = 0}, useScreenFonts=1)
    at NSStringDrawing.m:345
#14 0xb7d232b0 in -[NSAttributedString(NSStringDrawing) size] (
    self=0x8127438, _cmd=0xb7e34c20) at NSStringDrawing.m:500
#15 0xb7c33956 in -[NSCell cellSize] (self=0x81147c8, _cmd=0xb7e2a588)
    at NSCell.m:1796
#16 0xb7c197e5 in -[NSBox(Private) calcSizesAllowingNegative:] (
    self=0x81bf730, _cmd=0xb7e2a4b0, aFlag=0 '\000') at NSBox.m:669
#17 0xb7c168ba in -[NSBox setContentView:] (self=0x81bf730, _cmd=0xb7e2a490,
    aView=0x827aa80) at NSBox.m:254
#18 0xb7c16104 in -[NSBox initWithFrame:] (self=0x81bf730, _cmd=0xb7e1bbd8,
    frameRect={origin = {x = 0, y = 95}, size = {width = 362, height = 2}})
    at NSBox.m:90
#19 0xb7be5854 in -[GSAlertPanel _initWithoutGModel] (self=0x810ba60,
    _cmd=0xb7e1bba8) at NSAlert.m:392
---Type <return> to continue, or q <return> to quit---
#20 0xb7be488d in -[GSAlertPanel init] (self=0x810ba60, _cmd=0xb7e1bfd0)
    at NSAlert.m:245
#21 0xb7bea6b1 in -[GSExceptionPanel init] (self=0x810ba60, _cmd=0xb7e1bed0)
    at NSAlert.m:1710
#22 0xb7bea3ee in GSRunExceptionPanel (title=0xa17c0c0, exception=0xa17c110,
    defaultButton=0x81644b8, alternateButton=0x0, otherButton=0x81097a8)
    at NSAlert.m:1676
#23 0xb7bf6b98 in _NSAppKitUncaughtExceptionHandler (exception=0xa17c110)
    at NSApplication.m:122
#24 0xb78d1497 in -[NSException raise] (self=0xa17c110, _cmd=0xb7af7b98)
    at NSException.m:832
#25 0xb78d0f60 in +[NSException raise:format:arguments:] (self=0xb7af7640,
    _cmd=0xb7af7b80, name=0xb7af73bc, format=0xb7b08f2c,
    argList=0xbf89f80c "h\023��R櫷�d��@v��A\016\215��d��R櫷�����\221\020\bX\n\022\bd�\211�U�\220�X\n\022\b�\231��\210׭�wI\233��\031")
    at NSException.m:753
#26 0xb78d0e98 in +[NSException raise:format:] (self=0xb7af7640,
    _cmd=0xb7b098f0, name=0xb7af73bc, format=0xb7b08f2c) at NSException.m:739
#27 0xb790f379 in -[NSObject doesNotRecognizeSelector:] (self=0x8120a58,
    _cmd=0xb7b099e8, aSelector=0xb7add788) at NSObject.m:1672

Fred Kiefer <FredKiefer>
Group Member
Tue 10 Jul 2007 11:15:04 AM UTC, comment #2: 

I'm not sure if we should follow OpenStep here. The method setStringValue: is clearly defined to take an NSString parameter. Putting anything else in there is wrong.

If you want to get this specific string displayed, why don't you use description on the array or set the array as the object value via setObjectValue:? If GNUstep has a problem with any of these two ways to do it, I am willing to fix that. But adding the requested feature doesn't look like a good idea.

Fred Kiefer <FredKiefer>
Group Member
Tue 10 Jul 2007 11:02:57 AM UTC, comment #1: 

Sorry I forgot to write a version of GNUstep.
There it is:
gnustep-back-0.12.0
gnustep-base-1.14.0
gnustep-gui-0.12.0
gnustep-make-2.0.0

Downloaded: 06/04/2007

Lubo Zavacky <luboz>
Tue 10 Jul 2007 09:13:37 AM UTC, original submission:  

I have an OpenStep application ported to GNUstep. During port I found a bug in setStringValue: method of NSTextField.
Example:

id arr = [[NSArray alloc] initWithObjects: @"a", @"b", nil];
id txt = [[NSTextField alloc] initWithFrame: NSMakeRect(5, 37, 200, 28)];

[txt setStringValue: arr];

This crash on NSException, but in OpenStep it shows "(a, b)" string in NSTextField. I have attached some example.

Lubo Zavacky <luboz>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #13280:  Array2TxtFld.m added by luboz (3KiB - application/octet-stream)
file #13281:  GNUmakefile added by luboz (155B - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by FredKiefer (Posted a comment)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 8 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2007-08-09 luboz Carbon-CopyRemoved 58467 -
    2007-07-10 FredKiefer StatusNone Wont Fix
        Assigned toNone FredKiefer
        Open/ClosedOpen Declined
    2007-07-10 FredKiefer Item GroupNone Change Request
    2007-07-10 luboz Attached File- Added Array2TxtFld.m, #13280
        Attached File- Added GNUmakefile, #13281
        Carbon-Copy- Added -email is unavailable-

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code