aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPDataCellFormatter.m
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2010-09-15 16:44:36 +0000
committerBibiko <bibiko@eva.mpg.de>2010-09-15 16:44:36 +0000
commit82421b6cacb94aa3d9aaea785e8f333d0a0c82aa (patch)
tree60cac4eb84d15fcecf9fc83eac318380c997f217 /Source/SPDataCellFormatter.m
parent42b58dcdda0c82473bfed4df8211c6f0f343c6fc (diff)
downloadsequelpro-82421b6cacb94aa3d9aaea785e8f333d0a0c82aa.tar.gz
sequelpro-82421b6cacb94aa3d9aaea785e8f333d0a0c82aa.tar.bz2
sequelpro-82421b6cacb94aa3d9aaea785e8f333d0a0c82aa.zip
• added validation for BIT fields while in-cell-editing; only 1 or 0 are allowed to type in
• enabled max length and BIT field validation for CustomQuery
Diffstat (limited to 'Source/SPDataCellFormatter.m')
-rw-r--r--Source/SPDataCellFormatter.m12
1 files changed, 4 insertions, 8 deletions
diff --git a/Source/SPDataCellFormatter.m b/Source/SPDataCellFormatter.m
index 9e7944f8..f82bad1e 100644
--- a/Source/SPDataCellFormatter.m
+++ b/Source/SPDataCellFormatter.m
@@ -94,18 +94,14 @@
// Check for BIT fields whether 1 or 0 are typed
if(fieldType && [fieldType length] && [[fieldType uppercaseString] isEqualToString:@"BIT"]) {
- if(partialString == nil || ![partialString length]) return YES;
+ if([partialString rangeOfCharacterFromSet:[[NSCharacterSet characterSetWithCharactersInString:@"01"] invertedSet]].location != NSNotFound) {
+ [SPTooltip showWithObject:NSLocalizedString(@"For BIT fields only “1” or “0” are allowed.", @"For BIT fields only “1” or “0” are allowed.")];
+ return NO;
+ }
- // TODO HansJB
return YES;
- // if() {
- // [SPTooltip showWithObject:NSLocalizedString(@"For BIT fields only “1” or “0” are allowed.", @"For BIT fields only “1” or “0” are allowed.")];
- // return NO;
- // }
-
}
-
return YES;
}