[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

sullivan sullivan at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:09:16 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit f03776c93d12ed4c9be27b17558a66b38c3d6c71
Author: sullivan <sullivan at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Nov 5 00:31:18 2003 +0000

    WebKit:
    
            - a little optimization I noticed when looking at 3125137
    
            Reviewed by Chris.
    
            * Misc.subproj/WebStringTruncator.m:
            (truncateString):
            if incoming string has length 0, bail out right away
    
    WebBrowser:
    
            - fixed <rdar://problem/3125137>: long URL in bookmark bar
            toolbar popup takes over whole screen
    
            Reviewed by Chris.
    
            * BookmarksController.m:
            (-[BookmarksController addMenuItemForBookmark:toMenu:]):
            truncate the titles of menu items created for bookmarks
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@5385 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index b19514d..abc1cf4 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,13 @@
+2003-11-04  John Sullivan  <sullivan at apple.com>
+
+        - a little optimization I noticed when looking at 3125137
+
+        Reviewed by Chris.
+
+        * Misc.subproj/WebStringTruncator.m:
+        (truncateString):
+        if incoming string has length 0, bail out right away
+
 2003-11-04  Chris Blumenberg  <cblu at apple.com>
 
 	Fixed:
diff --git a/WebKit/Misc.subproj/WebStringTruncator.m b/WebKit/Misc.subproj/WebStringTruncator.m
index 7686332..60b032c 100644
--- a/WebKit/Misc.subproj/WebStringTruncator.m
+++ b/WebKit/Misc.subproj/WebStringTruncator.m
@@ -68,8 +68,12 @@ static float stringWidth(WebTextRenderer *renderer, const unichar *characters, u
 
 static NSString *truncateString(NSString *string, float maxWidth, NSFont *font, TruncationFunction truncateToBuffer)
 {
+    unsigned length = [string length];
+    if (length == 0) {
+        return string;
+    }
+
     unichar stringBuffer[STRING_BUFFER_SIZE];
-    unsigned length;
     unsigned keepCount;
     unsigned truncatedLength;
     float width;
@@ -93,7 +97,6 @@ static NSString *truncateString(NSString *string, float maxWidth, NSFont *font,
     
     ASSERT(currentRenderer);
 
-    length = [string length];
     if (length > STRING_BUFFER_SIZE) {
         keepCount = STRING_BUFFER_SIZE - 1; // need 1 character for the ellipsis
         truncatedLength = centerTruncateToBuffer(string, length, keepCount, stringBuffer);

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list