aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPTableContent.m
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2011-01-24 11:55:00 +0000
committerBibiko <bibiko@eva.mpg.de>2011-01-24 11:55:00 +0000
commitf1b7ccbcdd139a040adb8caae3366f998b2df75a (patch)
tree9edde6fe5060508c87ff1a300a37db83d962c8dc /Source/SPTableContent.m
parent0c5422bb4e45e5890ce647001758371307a445d0 (diff)
downloadsequelpro-f1b7ccbcdd139a040adb8caae3366f998b2df75a.tar.gz
sequelpro-f1b7ccbcdd139a040adb8caae3366f998b2df75a.tar.bz2
sequelpro-f1b7ccbcdd139a040adb8caae3366f998b2df75a.zip
• fixed minor issue for filterTable approach in Content
- prepared some stuff for table state history
Diffstat (limited to 'Source/SPTableContent.m')
-rw-r--r--Source/SPTableContent.m26
1 files changed, 24 insertions, 2 deletions
diff --git a/Source/SPTableContent.m b/Source/SPTableContent.m
index 064b08f1..b136d90a 100644
--- a/Source/SPTableContent.m
+++ b/Source/SPTableContent.m
@@ -3297,6 +3297,25 @@
[self setFiltersToRestore:nil];
}
+- (void) setFilterTableData:(NSData*)arcData
+{
+ if(!arcData) return;
+ NSDictionary *filterData = [NSUnarchiver unarchiveObjectWithData:arcData];
+ [filterTableData removeAllObjects];
+ [filterTableData addEntriesFromDictionary:filterData];
+ [filterTableWindow makeKeyAndOrderFront:nil];
+ // [filterTableView reloadData];
+}
+
+- (NSData*) filterTableData
+{
+ if(![filterTableWindow isVisible]) return nil;
+
+ [filterTableView deselectAll:nil];
+
+ return [NSArchiver archivedDataWithRootObject:filterTableData];
+}
+
#pragma mark -
#pragma mark Table drawing and editing
@@ -3513,8 +3532,9 @@
return c;
} else
return NSArrayObjectAtIndex([[filterTableData objectForKey:[NSNumber numberWithInteger:rowIndex]] objectForKey:@"filter"], [[aTableColumn identifier] integerValue]-1);
- else
+ else {
return NSArrayObjectAtIndex([[filterTableData objectForKey:[aTableColumn identifier]] objectForKey:@"filter"], rowIndex);
+ }
}
else if(aTableView == tableContentView) {
@@ -4470,6 +4490,8 @@
NSString *re1 = @"^\\s*(<[=>]?|>=?|!?=|≠|≤|≥)\\s*(.*?)\\s*$";
NSString *re2 = @"^\\s*(.*)\\s+(.*?)\\s*$";
NSCharacterSet *whiteSpaceCharSet = [NSCharacterSet whitespaceAndNewlineCharacterSet];
+ NSInteger editedRow = [filterTableView editedRow];
+
if(currentValue == filterTableGearLookAllFields) {
numberOfRows = 1;
@@ -4503,7 +4525,7 @@
}
// Take value from currently edited table cell
} else if([currentValue isKindOfClass:[NSString class]]){
- if(index == [filterTableView editedColumn] && i == [filterTableView editedRow])
+ if(i == editedRow && index == [[NSArrayObjectAtIndex([filterTableView tableColumns], [filterTableView editedColumn]) identifier] integerValue])
filterCell = (NSString*)currentValue;
else
filterCell = NSArrayObjectAtIndex([filterCellData objectForKey:@"filter"], i);