Skip to content

Commit

Permalink
Fix an issue with resetting auto_increment values (caused by previous…
Browse files Browse the repository at this point in the history
… commit)
  • Loading branch information
dmoagx committed Feb 15, 2016
1 parent 8795dcb commit 7374c4a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Source/SPExtendedTableInfo.m
Expand Up @@ -224,14 +224,19 @@ - (IBAction)tableRowAutoIncrementWasEdited:(id)sender
{
[tableRowAutoIncrement setEditable:NO];

[tableSourceInstance takeAutoIncrementFrom:tableRowAutoIncrement];
NSNumberFormatter *fmt = [[[NSNumberFormatter alloc] init] autorelease];
[fmt setNumberStyle:NSNumberFormatterDecimalStyle];
NSNumber *value = [fmt numberFromString:[tableRowAutoIncrement stringValue]];

[tableSourceInstance setAutoIncrementTo:value];
}

- (BOOL)control:(NSControl *)control textView:(NSTextView *)textView doCommandBySelector:(SEL)command
{
// Listen to ESC to abort editing of auto increment input field
if (command == @selector(cancelOperation:) && control == tableRowAutoIncrement) {
[tableRowAutoIncrement abortEditing];
[tableRowAutoIncrement setEditable:NO];
return YES;
}

Expand Down

0 comments on commit 7374c4a

Please sign in to comment.