[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: textview / test storage string copy problem
From: |
Riccardo Mottola |
Subject: |
Re: textview / test storage string copy problem |
Date: |
Wed, 18 Jan 2012 11:11:44 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux i686; rv:8.0) Gecko/20120104 Icedove/8.0 |
Hi,
I commited the patch attached below to SWK.
You can now use search engines like Google or Bing and make a search!
Cool :)
Thank you,
Riccardo
Index: Sources/DOMHTML.m
===================================================================
--- Sources/DOMHTML.m (revision 33698)
+++ Sources/DOMHTML.m (working copy)
@@ -2679,7 +2679,7 @@
- (void) textDidEndEditing:(NSNotification *)aNotification
{
NSNumber *code = [[aNotification userInfo]
objectForKey:@"NSTextMovement"];
- [cell setStringValue:[[aNotification object] string]]; // copy
value to cell
+ [cell setStringValue:[NSString stringWithString: [[aNotification
object] string]]]; // copy value to cell
[cell endEditing:[aNotification object]];
switch([code intValue])
{
@@ -2963,7 +2963,7 @@
- (void) textDidEndEditing:(NSNotification *)aNotification
{
- [cell setStringValue:[[aNotification object] string]]; // copy
value to cell
+ [cell setStringValue:[NSString stringWithString:[[aNotification
object] string]]]; // copy value to cell
[cell endEditing:[aNotification object]];
}
On 01/18/2012 10:54 AM, Dr. H. Nikolaus Schaller wrote:
Just a short thought, because I am not following this topic intensively.
I would have been astonished if NSTextStorage would return a copy.
I rather think the NS(Attachment)Cell should make a copy on setStringValue:
[cell setStringValue:[[aNotification object] string]]; // copy value to cell
BR,
Nikolaus
Am 18.01.2012 um 10:45 schrieb Wolfgang Lux:
Riccardo Mottola wrote:
while debugging SWK on gnustep, Fred found out that we have a problem that the
string returned by the textview is not a copy.
On cocoa it works, it would be nice if somebody can confirm that Cocoa returns
a copy.
No. Cocoa doesn't return a copy of the string.
Test program attached below. The output is the same on GNUstep:
2012-01-18 10:41:31.294 test[43670] string (1) = This is the first string
2012-01-18 10:41:31.294 test[43670] string (2) = This is the second string
2012-01-18 10:41:31.294 test[43670] string (3) = This is the second string
No copy
and on Cocoa:
2012-01-18 10:42:33.089 test[43687:903] string (1) = This is the first string
2012-01-18 10:42:33.114 test[43687:903] string (2) = This is the second string
2012-01-18 10:42:33.115 test[43687:903] string (3) = This is the second string
No copy
Wolfgang
<test.m>_______________________________________________
Gnustep-dev mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/gnustep-dev