aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPFieldEditorController.m
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2009-10-16 12:30:38 +0000
committerBibiko <bibiko@eva.mpg.de>2009-10-16 12:30:38 +0000
commit507d0089c6bb73a01129f1e356d1e88ca53afb55 (patch)
tree9b892fb51823de5e7381d70e2330392a418e0f06 /Source/SPFieldEditorController.m
parenta57daba74182b3123c47b44996680efd399a471d (diff)
downloadsequelpro-507d0089c6bb73a01129f1e356d1e88ca53afb55.tar.gz
sequelpro-507d0089c6bb73a01129f1e356d1e88ca53afb55.tar.bz2
sequelpro-507d0089c6bb73a01129f1e356d1e88ca53afb55.zip
• fixed three further typos for: objectForKey:@"NullValue"
• allow to enter the NULL value string even if the cell/field's maximal length is set to less then the actual NULL value string length (eg varchar(3) and NULL value string is @"NULL")
Diffstat (limited to 'Source/SPFieldEditorController.m')
-rw-r--r--Source/SPFieldEditorController.m10
1 files changed, 6 insertions, 4 deletions
diff --git a/Source/SPFieldEditorController.m b/Source/SPFieldEditorController.m
index bdb78726..83a63d6b 100644
--- a/Source/SPFieldEditorController.m
+++ b/Source/SPFieldEditorController.m
@@ -346,10 +346,10 @@
editSheetReturnCode = 0;
// Validate the sheet data before saving them.
- // - for max text length select the part which won't be saved
+ // - for max text length (except for NULL value string) select the part which won't be saved
// and suppress closing the sheet
if(sender == editSheetOkButton) {
- if (maxTextLength > 0 && [[editTextView textStorage] length] > maxTextLength) {
+ if (maxTextLength > 0 && [[editTextView textStorage] length] > maxTextLength && ![[[editTextView textStorage] string] isEqualToString:[prefs objectForKey:@"NullValue"]]) {
[editTextView setSelectedRange:NSMakeRange(maxTextLength, [[editTextView textStorage] length] - maxTextLength)];
[editTextView scrollRangeToVisible:NSMakeRange([editTextView selectedRange].location,0)];
[SPTooltip showWithObject:[NSString stringWithFormat:NSLocalizedString(@"Text is too long. Maximum text length is set to %d.", @"Text is too long. Maximum text length is set to %d."), maxTextLength]];
@@ -833,11 +833,13 @@
#pragma mark Delegates
/*
- Validate editTextView for max text length
+ Validate editTextView for max text length except for NULL value string
*/
- (BOOL)textView:(NSTextView *)textView shouldChangeTextInRange:(NSRange)r replacementString:(NSString *)replacementString
{
- if(textView == editTextView && maxTextLength > 0) {
+
+ if(textView == editTextView && maxTextLength > 0
+ && ![ [[[editTextView textStorage] string] stringByAppendingString:replacementString] isEqualToString:[prefs objectForKey:@"NullValue"]]) {
int newLength;