aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPFieldEditorController.m
diff options
context:
space:
mode:
authorsqlprodev <sqlprodev@northofthree.com>2011-04-14 19:57:45 +0000
committersqlprodev <sqlprodev@northofthree.com>2011-04-14 19:57:45 +0000
commit8c2e3126426c0c4c9e5bc2392879a850d3373641 (patch)
tree8a6963b5efd578e8586bd808d5f204a81a85c6dc /Source/SPFieldEditorController.m
parentad7328e56541556d23f527303deddaefd4253ef2 (diff)
downloadsequelpro-8c2e3126426c0c4c9e5bc2392879a850d3373641.tar.gz
sequelpro-8c2e3126426c0c4c9e5bc2392879a850d3373641.tar.bz2
sequelpro-8c2e3126426c0c4c9e5bc2392879a850d3373641.zip
SP_REFACTOR: Workaround for naming conflict with postNotificationOnMainThread: which also exists in TCMPortMapper.framework; NSUserDefaults access now permitted in SP_REFACTOR blocks for a few prefs keys
Diffstat (limited to 'Source/SPFieldEditorController.m')
-rw-r--r--Source/SPFieldEditorController.m45
1 files changed, 7 insertions, 38 deletions
diff --git a/Source/SPFieldEditorController.m b/Source/SPFieldEditorController.m
index 83a0c9d7..52a90fcd 100644
--- a/Source/SPFieldEditorController.m
+++ b/Source/SPFieldEditorController.m
@@ -4,7 +4,7 @@
// SPFieldEditorController.m
// sequel-pro
//
-// Created by Hans-Jörg Bibiko on July 16, 2009
+// Created by Hans-Jörg Bibiko on July 16, 2009
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -65,9 +65,8 @@
callerInstance = nil;
doGroupDueToChars = NO;
-#ifndef SP_REFACTOR
prefs = [NSUserDefaults standardUserDefaults];
-#endif
+
// Used for max text length recognition if last typed char is a non-space char
editTextViewWasChanged = NO;
@@ -214,13 +213,7 @@
[bitSheetNULLButton setEnabled:_allowNULL];
// Check for NULL
- if([sheetEditData isEqualToString:
-#ifndef SP_REFACTOR
- [prefs objectForKey:SPNullValue]
-#else
- @"NULL"
-#endif
- ]) {
+ if([sheetEditData isEqualToString:[prefs objectForKey:SPNullValue]]) {
[bitSheetNULLButton setState:NSOnState];
[self setToNull:bitSheetNULLButton];
} else {
@@ -406,13 +399,7 @@
[callerInstance setFieldEditorSelectedRange:NSMakeRange(0,0)];
// If the string content is NULL select NULL for convenience
- if([stringValue isEqualToString:
-#ifndef SP_REFACTOR
- [prefs objectForKey:SPNullValue]
-#else
- @"NULL"
-#endif
- ])
+ if([stringValue isEqualToString:[prefs objectForKey:SPNullValue]])
[editTextView setSelectedRange:NSMakeRange(0,[[editTextView string] length])];
// Set focus
@@ -583,13 +570,7 @@
// - 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 && ![[[editTextView textStorage] string] isEqualToString:
-#ifndef SP_REFACTOR
- [prefs objectForKey:SPNullValue]
-#else
- @"NULL"
-#endif
- ]) {
+ if (maxTextLength > 0 && [[editTextView textStorage] length] > maxTextLength && ![[[editTextView textStorage] string] isEqualToString:[prefs objectForKey:SPNullValue]]) {
[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 %llu.", @"Text is too long. Maximum text length is set to %llu."), maxTextLength]];
@@ -1109,13 +1090,7 @@
[sheetEditData release];
}
- NSString *nullString =
-#ifndef SP_REFACTOR
- [prefs objectForKey:SPNullValue]
-#else
- @"NULL"
-#endif
- ;
+ NSString *nullString = [prefs objectForKey:SPNullValue];
sheetEditData = [[NSString stringWithString:nullString] retain];
[bitSheetIntegerTextField setStringValue:nullString];
[bitSheetHexTextField setStringValue:nullString];
@@ -1316,13 +1291,7 @@
{
if(textView == editTextView && (maxTextLength > 0)
- && ![ [[[editTextView textStorage] string] stringByAppendingString:replacementString] isEqualToString:
-#ifndef SP_REFACTOR
- [prefs objectForKey:SPNullValue]
-#else
- @"NULL"
-#endif
- ]) {
+ && ![ [[[editTextView textStorage] string] stringByAppendingString:replacementString] isEqualToString:[prefs objectForKey:SPNullValue]]) {
NSInteger newLength;