aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorstuconnolly <stuart02@gmail.com>2010-05-03 19:10:14 +0000
committerstuconnolly <stuart02@gmail.com>2010-05-03 19:10:14 +0000
commit526230dfeadf7aed85e3b05bbb7f0cea0829f6f6 (patch)
tree4aeeb4c9bade47dc2bb91bb01137fbc984726718
parent77afbf92a968609371a41c84f1114747bd0d9629 (diff)
downloadsequelpro-526230dfeadf7aed85e3b05bbb7f0cea0829f6f6.tar.gz
sequelpro-526230dfeadf7aed85e3b05bbb7f0cea0829f6f6.tar.bz2
sequelpro-526230dfeadf7aed85e3b05bbb7f0cea0829f6f6.zip
Trim whitespace and newline characters from a table's comment returned by SPTableData to ensure that it erroneously changed because of a failed string comparison.
-rw-r--r--Source/SPExtendedTableInfo.m3
1 files changed, 2 insertions, 1 deletions
diff --git a/Source/SPExtendedTableInfo.m b/Source/SPExtendedTableInfo.m
index 98994acf..f272a3e5 100644
--- a/Source/SPExtendedTableInfo.m
+++ b/Source/SPExtendedTableInfo.m
@@ -436,9 +436,10 @@
- (void)textDidEndEditing:(NSNotification *)notification
{
id object = [notification object];
+
if ((object == tableCommentsTextView) && ([object isEditable]) && ([selectedTable length] > 0)) {
- NSString *currentComment = [tableDataInstance statusValueForKey:@"Comment"];
+ NSString *currentComment = [[tableDataInstance statusValueForKey:@"Comment"] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
NSString *newComment = [[tableCommentsTextView string] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
// Check that the user actually changed the tables comment