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

gramps gramps at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 05:49:32 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 98bfb1ce30ba1c8843511798c0b45289b25c4fa9
Author: gramps <gramps at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Oct 5 18:07:05 2001 +0000

    Implemented fill
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@288 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/kwq/KWQString.mm b/WebCore/kwq/KWQString.mm
index 2aa30de..1c444ea 100644
--- a/WebCore/kwq/KWQString.mm
+++ b/WebCore/kwq/KWQString.mm
@@ -1062,12 +1062,30 @@ void QString::truncate(uint newLen)
     }
 }
 
-void QString::fill(QChar, int)
+void QString::fill(QChar qc, int len)
 {
     flushCache();
-    // FIXME: not yet implemented
-    NSLog(@"WARNING %s:%s:%d (NOT YET IMPLEMENTED)\n", __FILE__, __FUNCTION__,
-            __LINE__);
+    if (s) {
+        if (len < 0) {
+            len = CFStringGetLength(s);
+        }
+        CFRelease(s);
+        s = NULL;
+    }
+    if (len > 0) {
+        UniChar *ucs = CFAllocatorAllocate(kCFAllocatorDefault,
+                len * sizeof (UniChar), 0);
+        if (ucs) {
+            for (int i = 0; i < len; i++) {
+                ucs[i] = qc.c;
+            }
+            s = CFStringCreateMutableWithExternalCharactersNoCopy(
+                    kCFAllocatorDefault, ucs, len, 0, kCFAllocatorDefault);
+            if (!s) {
+                CFAllocatorDeallocate(kCFAllocatorDefault, ucs);
+            }
+        }
+    }
 }
 
 void QString::compose()
diff --git a/WebCore/src/kwq/KWQString.mm b/WebCore/src/kwq/KWQString.mm
index 2aa30de..1c444ea 100644
--- a/WebCore/src/kwq/KWQString.mm
+++ b/WebCore/src/kwq/KWQString.mm
@@ -1062,12 +1062,30 @@ void QString::truncate(uint newLen)
     }
 }
 
-void QString::fill(QChar, int)
+void QString::fill(QChar qc, int len)
 {
     flushCache();
-    // FIXME: not yet implemented
-    NSLog(@"WARNING %s:%s:%d (NOT YET IMPLEMENTED)\n", __FILE__, __FUNCTION__,
-            __LINE__);
+    if (s) {
+        if (len < 0) {
+            len = CFStringGetLength(s);
+        }
+        CFRelease(s);
+        s = NULL;
+    }
+    if (len > 0) {
+        UniChar *ucs = CFAllocatorAllocate(kCFAllocatorDefault,
+                len * sizeof (UniChar), 0);
+        if (ucs) {
+            for (int i = 0; i < len; i++) {
+                ucs[i] = qc.c;
+            }
+            s = CFStringCreateMutableWithExternalCharactersNoCopy(
+                    kCFAllocatorDefault, ucs, len, 0, kCFAllocatorDefault);
+            if (!s) {
+                CFAllocatorDeallocate(kCFAllocatorDefault, ucs);
+            }
+        }
+    }
 }
 
 void QString::compose()

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list