discuss-gnustep
[Top][All Lists]
Advanced

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

Re: NSTableView bug fix


From: Fred Kiefer
Subject: Re: NSTableView bug fix
Date: Mon, 19 Oct 2020 08:28:17 +0200

Hi Andreas,

thank you for this patch. I already committed it, this was well spotted.

There is another issue though. As I already wrote you, I never get the mails 
that you send to this mailing list. And this was also the case for these two 
mails, without Gregory replying, the whole issue would have passed unnoticed by 
me. I checked all the spam folders that I am aware of and none contained your 
mails. I really don’t have an idea where they get filtered. Please add me 
directly as recipient to your mails to the mailing list when you think that a 
mail should be addressed by me.

Cheers,
Fred

> Am 17.10.2020 um 13:18 schrieb Gregory Casamento <greg.casamento@gmail.com>:
> 
> 
> Andreas,
> 
> For future reference, it is usually best to clone the repository and create a 
> branch, then create a PR for consideration by the maintainer of that repo, in 
> this case, Fred Kiefer.  This is not a hard and fast rule, but it allows us 
> to keep all contributions tracked in one place.
> 
> Your change looks okay to me, but Fred has primary responsibility for 
> libs-gui, so I defer to his judgment.
> 
> Yours, GC
> 
> On Sat, Oct 17, 2020 at 5:22 AM Andreas Höschler via Discussion list for the 
> GNUstep programming environment <discuss-gnustep@gnu.org> wrote:
> Hi all,
> 
> I sent the below fix to the group a while ago. Has this already been 
> integrated into the repository (by someone with write privileges)? I haven't 
> seen any feedback on this and just want to make sure it does not get lost. 
> 
> Thanks,
> 
>  Andreas
> 
> ***
> 
> 
> > On 11 Oct 2020, at 19:54, Andreas Höschler via Discussion list for the 
> > GNUstep programming environment <discuss-gnustep@gnu.org> wrote:
> > 
> > Hi Fred,
> > 
> > I just hunted down a bug in NSTableView. A test app would be an application 
> > with a tableview with a couple of columns with formatters. Entering data 
> > stops working once a cell with a formatter was hit. This is due to
> > 
> > NSTableView.m         - (void) validateEditing
> > 
> > existing without setting _isValidating back to NO.
> > 
> > The following fix (see the line marked with  // <-------) does the trick. 
> > Could anyone please integrate this fix into the repository? :-)
> > 
> > Thanks a lot,
> > 
> > Andreas
> > 
> > ***
> > 
> > - (void) validateEditing
> > {
> >   if (_textObject && (_isValidating == NO))
> >     {
> >      NSFormatter *formatter;
> >      NSString *string;
> >      id newObjectValue = nil;
> >      BOOL validatedOK = YES;
> > 
> >      // Avoid potential recursive sequences...
> >      _isValidating = YES;
> > 
> >      formatter = [_editedCell formatter];
> >      string = AUTORELEASE([[_textObject text] copy]);
> > 
> >      if (formatter != nil)
> >        {
> >         NSString *error;
> > 
> >         if ([formatter getObjectValue: &newObjectValue forString: string 
> > errorDescription: &error] == YES)
> >           {
> >            [_editedCell setObjectValue: newObjectValue];
> > 
> >            if (_dataSource_editable)
> >              {
> >               NSTableColumn *tb;
> > 
> >               tb = [_tableColumns objectAtIndex: _editedColumn];
> > 
> >               [self _setObjectValue: newObjectValue
> >               forTableColumn: tb
> >               row: _editedRow];
> >              }
> >            _isValidating = NO; return; // <-------
> >           }
> >         else
> >           {
> >            SEL sel = 
> > @selector(control:didFailToFormatString:errorDescription:);
> > 
> >            if ([_delegate respondsToSelector: sel])
> >              {
> >               validatedOK = [_delegate control: self 
> >               didFailToFormatString: string 
> >               errorDescription: error];
> >              }
> >            // Allow an empty string to fall through
> >            else if (![string isEqualToString: @""])
> >              {
> >               validatedOK = NO;
> >              }
> >           }
> >        }
> > 
> >      if (validatedOK)
> >        {
> >         [_editedCell setStringValue: string];
> > 
> >         if (_dataSource_editable)
> >           {
> >            NSTableColumn *tb;
> > 
> >            tb = [_tableColumns objectAtIndex: _editedColumn];
> > 
> >            [self _setObjectValue: string forTableColumn: tb row: 
> > _editedRow];
> >           }
> >        }
> > 
> >      // Avoid potential recursive sequences...
> >      _isValidating = NO;
> >     }
> > }
> > 
> > 
> 
> 
> 
> 
> 
> -- 
> Gregory Casamento
> GNUstep Lead Developer / OLC, Principal Consultant
> http://www.gnustep.org - http://heronsperch.blogspot.com
> https://www.patreon.com/bePatron?u=352392 - Become a Patron
> https://gf.me/u/x8m3sx - My GNUstep GoFundMe
> https://teespring.com/stores/gnustep - Store
> 




reply via email to

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