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

darin darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:06:56 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 0c84f1b515e975c941cf050f625ee1cfbc537a0d
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Oct 29 06:31:11 2003 +0000

            Reviewed by Maciej.
    
            - fixed 3465504 -- REGRESSION (100-111): text areas with Chinese text in them are wider than ones without
    
            * kwq/KWQTextArea.h: Add _font field.
            * kwq/KWQTextArea.mm:
            (-[KWQTextArea dealloc]): Release _font.
            (-[KWQTextArea setFont:]): Store font in _font as well as setting it in the text view.
            (-[KWQTextArea sizeWithColumns:rows:]): Use _font rather than asking the text view for the font.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@5297 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 8776130..78a11c9 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -2,6 +2,18 @@
 
         Reviewed by Maciej.
 
+        - fixed 3465504 -- REGRESSION (100-111): text areas with Chinese text in them are wider than ones without
+
+        * kwq/KWQTextArea.h: Add _font field.
+        * kwq/KWQTextArea.mm:
+        (-[KWQTextArea dealloc]): Release _font.
+        (-[KWQTextArea setFont:]): Store font in _font as well as setting it in the text view.
+        (-[KWQTextArea sizeWithColumns:rows:]): Use _font rather than asking the text view for the font.
+
+2003-10-28  Darin Adler  <darin at apple.com>
+
+        Reviewed by Maciej.
+
         - fixed 3464702 -- node.item(x) is not implemented (dynamic menus not filled out at techcu.com)
 
         * khtml/ecma/kjs_dom.cpp: (DOMNodeProtoFunc::tryCall): Add implementation of item function.
diff --git a/WebCore/kwq/KWQTextArea.h b/WebCore/kwq/KWQTextArea.h
index aece2a7..4f42ae5 100644
--- a/WebCore/kwq/KWQTextArea.h
+++ b/WebCore/kwq/KWQTextArea.h
@@ -33,6 +33,7 @@ class QTextEdit;
 {
     KWQTextAreaTextView *textView;
     QTextEdit *widget;
+    NSFont *_font;
     BOOL wrap;
     BOOL inNextValidKeyView;
     BOOL inDrawingMachinery;
diff --git a/WebCore/kwq/KWQTextArea.mm b/WebCore/kwq/KWQTextArea.mm
index 56edb59..47257e3 100644
--- a/WebCore/kwq/KWQTextArea.mm
+++ b/WebCore/kwq/KWQTextArea.mm
@@ -146,6 +146,7 @@ const float LargeNumberForText = 1.0e7;
 - (void)dealloc
 {
     [textView release];
+    [_font release];
     
     [super dealloc];
 }
@@ -395,6 +396,9 @@ static NSRange RangeOfParagraph(NSString *text, int paragraph)
 - (void)setFont:(NSFont *)font
 {
     //NSLog(@"extraLineFragmentTextContainer before setFont: is %@", [[textView layoutManager] extraLineFragmentTextContainer]);
+    [font retain];
+    [_font release];
+    _font = font;
     [textView setFont:font];
     //NSLog(@"extraLineFragmentTextContainer after setFont: is %@", [[textView layoutManager] extraLineFragmentTextContainer]);
 }
@@ -532,8 +536,12 @@ static NSRange RangeOfParagraph(NSString *text, int paragraph)
 
 - (NSSize)sizeWithColumns:(int)numColumns rows:(int)numRows
 {
-    NSFont *font = [textView font];
-    NSSize textSize = NSMakeSize(ceil(numColumns * [font widthOfString:@"0"]), numRows * [font defaultLineHeightForFont]);
+    // Must use font from _font field rather than from the text view's font method,
+    // because the text view will return a substituted font if the first character in
+    // the text view requires font substitution, and we don't want the size to depend on
+    // the text in the text view.
+    
+    NSSize textSize = NSMakeSize(ceil(numColumns * [_font widthOfString:@"0"]), numRows * [_font defaultLineHeightForFont]);
     NSSize textContainerSize = NSMakeSize(textSize.width + [[textView textContainer] lineFragmentPadding] * 2, textSize.height);
     NSSize textContainerInset = [textView textContainerInset];
     NSSize textViewSize = NSMakeSize(textContainerSize.width + textContainerInset.width, textContainerSize.height + textContainerInset.height); 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list