Editing patches partly by Andreas Höschler <ahoesch@smartsoft.de>.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@25426 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Fred Kiefer 2007-08-31 10:52:52 +00:00
parent d33b2e8dd0
commit b3dc35f126
5 changed files with 140 additions and 111 deletions

View file

@ -3158,50 +3158,64 @@ byExtendingSelection: (BOOL)flag
BOOL validatedOK = YES;
formatter = [_editedCell formatter];
string = AUTORELEASE ([[_textObject text] copy]);
string = AUTORELEASE([[_textObject text] copy]);
if (formatter == nil)
{
newObjectValue = string;
}
{
newObjectValue = string;
}
else
{
NSString *error;
{
NSString *error;
if ([formatter getObjectValue: &newObjectValue
forString: string
errorDescription: &error] == NO)
{
if ([_delegate control: self
didFailToFormatString: string
errorDescription: error] == NO)
{
validatedOK = NO;
}
else
{
newObjectValue = string;
}
}
}
if (validatedOK == YES)
{
[_editedCell setObjectValue: newObjectValue];
if (_dataSource_editable)
{
NSTableColumn *tb;
tb = [_tableColumns objectAtIndex: _editedColumn];
[self _setObjectValue: newObjectValue
forTableColumn: tb
row: _editedRow];
if ([formatter getObjectValue: &newObjectValue
forString: string
errorDescription: &error] == NO)
{
if ([_delegate respondsToSelector:
@selector(control:didFailToFormatString:errorDescription:)])
{
if ([_delegate control: self
didFailToFormatString: string
errorDescription: error] == NO)
//[_dataSource tableView: self setObjectValue: newObjectValue
// forTableColumn: tb row: _editedRow];
}
}
{
validatedOK = NO;
}
else
{
newObjectValue = string;
}
}
// Allow an empty string to fall through
else if ([string isEqualToString: @""])
{
newObjectValue = string;
}
else
{
validatedOK = NO;
}
}
}
if (validatedOK == YES)
{
[_editedCell setObjectValue: newObjectValue];
if (_dataSource_editable)
{
NSTableColumn *tb;
tb = [_tableColumns objectAtIndex: _editedColumn];
[self _setObjectValue: newObjectValue
forTableColumn: tb
row: _editedRow];
//[_dataSource tableView: self setObjectValue: newObjectValue
// forTableColumn: tb row: _editedRow];
}
}
}
}