From ab62501d38b50c04d9cd2e4bb00782254e675aa8 Mon Sep 17 00:00:00 2001 From: rowanbeentje Date: Tue, 14 Sep 2010 23:41:22 +0000 Subject: - Fix row count tracking when deleting table rows; this fixes Issue #819 --- Source/SPTableContent.m | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Source/SPTableContent.m b/Source/SPTableContent.m index 92b9ad15..90e7262a 100644 --- a/Source/SPTableContent.m +++ b/Source/SPTableContent.m @@ -1708,7 +1708,7 @@ // If no PRIMARY KEY is found and numberOfSelectedRows > 3 then // check for uniqueness of rows via combining all column values; // if unique then use the all columns as 'primary keys' - if([selectedRows count] >3 && primaryKeyFieldNames == nil) { + if([selectedRows count] > 3 && primaryKeyFieldNames == nil) { primaryKeyFieldNames = [tableDataInstance columnNames]; NSInteger numberOfRows = 0; @@ -1843,10 +1843,6 @@ // Restore Console Log window's updating bahaviour [[SPQueryController sharedQueryController] setAllowConsoleUpdate:consoleUpdateStatus]; - maxNumRows -= affectedRows; - tableRowsCount -= affectedRows; - [self updateCountText]; - if (errors) { NSArray *message; //TODO: The following three messages are NOT localisable! @@ -1881,6 +1877,10 @@ } tableRowsCount = [tableValues count]; [tableContentView reloadData]; + + // Update the maximum number of rows and the count text + maxNumRows -= affectedRows; + [self updateCountText]; } [tableContentView deselectAll:self]; } else { -- cgit v1.2.3