aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3>2010-03-10 13:06:00 +0000
committerGravatar gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3>2010-03-10 13:06:00 +0000
commit13b87870c8cf9d5445a1da6d20d142d43ac9c2e8 (patch)
tree7a2bb456d28219dd23a4eb2302d20e0851353a2e
parenta04d6910cfb3faef62b09bd2c2e621b1ce2a6efd (diff)
[Author: thomasvl]
Don't trim the whitespace off the string when doing test sizing... TextField does some odd stuff with whitespace when it does wrap things, if you don't include the white space, then when you use the real string (to wrap), it moves the last word down a line because of lack of space for the whitespace (go figure). Oh, and fix the leak. R=dmaclach DELTA=6 (0 added, 1 deleted, 5 changed)
-rw-r--r--AppKit/GTMUILocalizerAndLayoutTweaker.m5
-rw-r--r--AppKit/TestData/GTMUILocalizerAndLayoutTweakerTest7-Min-3.tiffbin22596 -> 22572 bytes
-rw-r--r--AppKit/TestData/GTMUILocalizerAndLayoutTweakerTest7-NoMin-1.tiffbin12842 -> 13082 bytes
-rw-r--r--AppKit/TestData/GTMUILocalizerAndLayoutTweakerTest7-NoMin-3.tiffbin22904 -> 22880 bytes
4 files changed, 2 insertions, 3 deletions
diff --git a/AppKit/GTMUILocalizerAndLayoutTweaker.m b/AppKit/GTMUILocalizerAndLayoutTweaker.m
index 771df9d..698fb91 100644
--- a/AppKit/GTMUILocalizerAndLayoutTweaker.m
+++ b/AppKit/GTMUILocalizerAndLayoutTweaker.m
@@ -290,8 +290,7 @@ static BOOL IsRightAnchored(NSView *view);
_GTMDevAssert(tokenizer, @"failed to get a tokenizer");
return 0.0;
}
- NSCell *workerCell = [cell copy];
- NSCharacterSet *whiteSpaceSet = [NSCharacterSet whitespaceCharacterSet];
+ NSCell *workerCell = [[cell copy] autorelease];
// Loop trying line break points until the height fits.
while (1) {
@@ -308,7 +307,7 @@ static BOOL IsRightAnchored(NSView *view);
NSRange subStringRange =
NSMakeRange(0, tokenRange.location + tokenRange.length);
NSString *subString = [str substringWithRange:subStringRange];
- subString = [subString stringByTrimmingCharactersInSet:whiteSpaceSet];
+ //subString = [subString stringByTrimmingCharactersInSet:whiteSpaceSet];
// Find how wide the cell would be for this sub string.
[workerCell setStringValue:subString];
diff --git a/AppKit/TestData/GTMUILocalizerAndLayoutTweakerTest7-Min-3.tiff b/AppKit/TestData/GTMUILocalizerAndLayoutTweakerTest7-Min-3.tiff
index 018b225..ed584fe 100644
--- a/AppKit/TestData/GTMUILocalizerAndLayoutTweakerTest7-Min-3.tiff
+++ b/AppKit/TestData/GTMUILocalizerAndLayoutTweakerTest7-Min-3.tiff
Binary files differ
diff --git a/AppKit/TestData/GTMUILocalizerAndLayoutTweakerTest7-NoMin-1.tiff b/AppKit/TestData/GTMUILocalizerAndLayoutTweakerTest7-NoMin-1.tiff
index 5875e42..b12cad0 100644
--- a/AppKit/TestData/GTMUILocalizerAndLayoutTweakerTest7-NoMin-1.tiff
+++ b/AppKit/TestData/GTMUILocalizerAndLayoutTweakerTest7-NoMin-1.tiff
Binary files differ
diff --git a/AppKit/TestData/GTMUILocalizerAndLayoutTweakerTest7-NoMin-3.tiff b/AppKit/TestData/GTMUILocalizerAndLayoutTweakerTest7-NoMin-3.tiff
index 61cefe0..972271b 100644
--- a/AppKit/TestData/GTMUILocalizerAndLayoutTweakerTest7-NoMin-3.tiff
+++ b/AppKit/TestData/GTMUILocalizerAndLayoutTweakerTest7-NoMin-3.tiff
Binary files differ