From deceb4635c0688121ef68962196d5f0fb221abff Mon Sep 17 00:00:00 2001 From: Bibiko Date: Fri, 17 Jul 2009 13:48:05 +0000 Subject: =?UTF-8?q?=E2=80=A2=20fixed=20inField=20Editor=20Sheet:=20-=20if?= =?UTF-8?q?=20textView=20was=20changed=20update=20hexView=20(if=20demanded?= =?UTF-8?q?)=20according=20to=20the=20correct=20data=20type?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Source/SPFieldEditorController.m | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Source/SPFieldEditorController.m b/Source/SPFieldEditorController.m index 2f169ebd..12fcb6a5 100644 --- a/Source/SPFieldEditorController.m +++ b/Source/SPFieldEditorController.m @@ -271,7 +271,11 @@ case 2: // hex - load on demand if([sheetEditData length] && [[hexTextView string] isEqualToString:@""]) { [editSheetProgressBar startAnimation:self]; - [hexTextView setString:[sheetEditData dataToFormattedHexString]]; + if([sheetEditData isKindOfClass:[NSData class]]) { + [hexTextView setString:[sheetEditData dataToFormattedHexString]]; + } else { + [hexTextView setString:[[sheetEditData dataUsingEncoding:encoding allowLossyConversion:YES] dataToFormattedHexString]]; + } [editSheetProgressBar stopAnimation:self]; } [editTextView setHidden:YES]; @@ -561,7 +565,7 @@ } // set edit data to text - sheetEditData = [[editTextView string] retain]; + sheetEditData = [[NSString stringWithString:[editTextView string]] retain]; } -- cgit v1.2.3