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

rjw rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 05:54:44 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 856ac1ea142d7088d3ecedca6dd8d9aed372aa86
Author: rjw <rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Jan 30 01:06:49 2002 +0000

    Make copy of chars in QConstString constructor.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@563 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2002-12-03 b/WebCore/ChangeLog-2002-12-03
index 1288b19..3c0204c 100644
--- a/WebCore/ChangeLog-2002-12-03
+++ b/WebCore/ChangeLog-2002-12-03
@@ -1,3 +1,20 @@
+2002-01-29  Richard Williamson  <rjw at apple.com>
+
+    Fixed QConstString to make a copy on initial chars.
+    
+	* ChangeLog:
+	* src/kwq/KWQString.mm: (QString::_copyIfNeededInternalString),
+	(QString::insert), (QString::remove), (QString::replace), (QString::truncate),
+	(QConstString::QConstString):
+	* src/kwq/qt/qstring.h:
+
+2002-01-29  Richard Williamson  <rjw at apple.com>
+
+	* src/kwq/KWQString.mm: (QString::_copyIfNeededInternalString),
+	(QString::insert), (QString::remove), (QString::replace), (QString::truncate),
+	(QConstString::QConstString):
+	* src/kwq/qt/qstring.h:
+
 2002-01-29  Kenneth Kocienda  <kocienda at apple.com>
 
         - Added in a dummy protocol to clean up a warning that results
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 1288b19..3c0204c 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,20 @@
+2002-01-29  Richard Williamson  <rjw at apple.com>
+
+    Fixed QConstString to make a copy on initial chars.
+    
+	* ChangeLog:
+	* src/kwq/KWQString.mm: (QString::_copyIfNeededInternalString),
+	(QString::insert), (QString::remove), (QString::replace), (QString::truncate),
+	(QConstString::QConstString):
+	* src/kwq/qt/qstring.h:
+
+2002-01-29  Richard Williamson  <rjw at apple.com>
+
+	* src/kwq/KWQString.mm: (QString::_copyIfNeededInternalString),
+	(QString::insert), (QString::remove), (QString::replace), (QString::truncate),
+	(QConstString::QConstString):
+	* src/kwq/qt/qstring.h:
+
 2002-01-29  Kenneth Kocienda  <kocienda at apple.com>
 
         - Added in a dummy protocol to clean up a warning that results
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 1288b19..3c0204c 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,20 @@
+2002-01-29  Richard Williamson  <rjw at apple.com>
+
+    Fixed QConstString to make a copy on initial chars.
+    
+	* ChangeLog:
+	* src/kwq/KWQString.mm: (QString::_copyIfNeededInternalString),
+	(QString::insert), (QString::remove), (QString::replace), (QString::truncate),
+	(QConstString::QConstString):
+	* src/kwq/qt/qstring.h:
+
+2002-01-29  Richard Williamson  <rjw at apple.com>
+
+	* src/kwq/KWQString.mm: (QString::_copyIfNeededInternalString),
+	(QString::insert), (QString::remove), (QString::replace), (QString::truncate),
+	(QConstString::QConstString):
+	* src/kwq/qt/qstring.h:
+
 2002-01-29  Kenneth Kocienda  <kocienda at apple.com>
 
         - Added in a dummy protocol to clean up a warning that results
diff --git a/WebCore/kwq/KWQString.h b/WebCore/kwq/KWQString.h
index 1cbc9cc..46878ff 100644
--- a/WebCore/kwq/KWQString.h
+++ b/WebCore/kwq/KWQString.h
@@ -526,7 +526,7 @@ private:
     friend class QGDict;
 
 #ifdef _KWQ_
-    void _copyInternalString();
+    void _copyIfNeededInternalString();
 #endif
 
 #ifdef KWQ_STRING_DEBUG
diff --git a/WebCore/kwq/KWQString.mm b/WebCore/kwq/KWQString.mm
index c9a0420..febc95a 100644
--- a/WebCore/kwq/KWQString.mm
+++ b/WebCore/kwq/KWQString.mm
@@ -1071,12 +1071,12 @@ QString &QString::append(const QString &qs)
     return insert(length(), qs);
 }
 
-void QString::_copyInternalString()
+void QString::_copyIfNeededInternalString()
 {
     if (s && CFGetRetainCount(s) > 1) {
         CFMutableStringRef tmp;
         tmp = CFStringCreateMutableCopy(kCFAllocatorDefault, 0, s);
-        CFRelease (s);
+        _cf_release (s);
         s = tmp;
     }
 }
@@ -1092,7 +1092,8 @@ QString &QString::insert(uint index, const QString &qs)
             if (!s) {
                 s = CFStringCreateMutable(kCFAllocatorDefault, 0);
             }
-            _copyInternalString();
+            else
+                _copyIfNeededInternalString();
             if (s) {
                 if (index < (uint)CFStringGetLength(s)) {
                     CFStringInsert(s, index, qs.s);
@@ -1124,7 +1125,7 @@ QString &QString::remove(uint index, uint width)
             if (width > (len - index)) {
                 width = len - index;
             }
-            _copyInternalString();
+            _copyIfNeededInternalString();
             CFStringDelete(s, CFRangeMake(index, width));
         }
     }
@@ -1143,7 +1144,7 @@ QString &QString::replace(const QRegExp &qre, const QString &qs)
                 break;
             }
             CFRange r = CFRangeMake(i, width);
-            _copyInternalString();
+            _copyIfNeededInternalString();
             if (len) {
                 CFStringReplace(s, r, qs.s);
             } else {
@@ -1160,7 +1161,7 @@ void QString::truncate(uint newLen)
     if (s) {
         if (newLen) {
             CFIndex len = CFStringGetLength(s);
-            _copyInternalString();
+            _copyIfNeededInternalString();
             if (len && (newLen < (uint)len)) {
                 CFStringDelete(s, CFRangeMake(newLen, len - newLen));
             }
@@ -1615,8 +1616,10 @@ QConstString::QConstString(QChar *qcs, uint len)
     if (qcs || len) {
         // NOTE: use instead of CFStringCreateWithCharactersNoCopy function to
         // guarantee backing store is not copied even though string is mutable
-        s = CFStringCreateMutableWithExternalCharactersNoCopy(
-                kCFAllocatorDefault, &qcs->c, len, len, kCFAllocatorNull);
+        //s = CFStringCreateMutableWithExternalCharactersNoCopy(
+        //        kCFAllocatorDefault, &qcs->c, len, len, kCFAllocatorNull);
+        s = CFStringCreateMutable(kCFAllocatorDefault, 0);
+        CFStringAppendCharacters (s, &qcs->c, len);
     } else {
         s = NULL;
     }
diff --git a/WebCore/kwq/qt/qstring.h b/WebCore/kwq/qt/qstring.h
index 1cbc9cc..46878ff 100644
--- a/WebCore/kwq/qt/qstring.h
+++ b/WebCore/kwq/qt/qstring.h
@@ -526,7 +526,7 @@ private:
     friend class QGDict;
 
 #ifdef _KWQ_
-    void _copyInternalString();
+    void _copyIfNeededInternalString();
 #endif
 
 #ifdef KWQ_STRING_DEBUG
diff --git a/WebCore/src/kwq/KWQString.mm b/WebCore/src/kwq/KWQString.mm
index c9a0420..febc95a 100644
--- a/WebCore/src/kwq/KWQString.mm
+++ b/WebCore/src/kwq/KWQString.mm
@@ -1071,12 +1071,12 @@ QString &QString::append(const QString &qs)
     return insert(length(), qs);
 }
 
-void QString::_copyInternalString()
+void QString::_copyIfNeededInternalString()
 {
     if (s && CFGetRetainCount(s) > 1) {
         CFMutableStringRef tmp;
         tmp = CFStringCreateMutableCopy(kCFAllocatorDefault, 0, s);
-        CFRelease (s);
+        _cf_release (s);
         s = tmp;
     }
 }
@@ -1092,7 +1092,8 @@ QString &QString::insert(uint index, const QString &qs)
             if (!s) {
                 s = CFStringCreateMutable(kCFAllocatorDefault, 0);
             }
-            _copyInternalString();
+            else
+                _copyIfNeededInternalString();
             if (s) {
                 if (index < (uint)CFStringGetLength(s)) {
                     CFStringInsert(s, index, qs.s);
@@ -1124,7 +1125,7 @@ QString &QString::remove(uint index, uint width)
             if (width > (len - index)) {
                 width = len - index;
             }
-            _copyInternalString();
+            _copyIfNeededInternalString();
             CFStringDelete(s, CFRangeMake(index, width));
         }
     }
@@ -1143,7 +1144,7 @@ QString &QString::replace(const QRegExp &qre, const QString &qs)
                 break;
             }
             CFRange r = CFRangeMake(i, width);
-            _copyInternalString();
+            _copyIfNeededInternalString();
             if (len) {
                 CFStringReplace(s, r, qs.s);
             } else {
@@ -1160,7 +1161,7 @@ void QString::truncate(uint newLen)
     if (s) {
         if (newLen) {
             CFIndex len = CFStringGetLength(s);
-            _copyInternalString();
+            _copyIfNeededInternalString();
             if (len && (newLen < (uint)len)) {
                 CFStringDelete(s, CFRangeMake(newLen, len - newLen));
             }
@@ -1615,8 +1616,10 @@ QConstString::QConstString(QChar *qcs, uint len)
     if (qcs || len) {
         // NOTE: use instead of CFStringCreateWithCharactersNoCopy function to
         // guarantee backing store is not copied even though string is mutable
-        s = CFStringCreateMutableWithExternalCharactersNoCopy(
-                kCFAllocatorDefault, &qcs->c, len, len, kCFAllocatorNull);
+        //s = CFStringCreateMutableWithExternalCharactersNoCopy(
+        //        kCFAllocatorDefault, &qcs->c, len, len, kCFAllocatorNull);
+        s = CFStringCreateMutable(kCFAllocatorDefault, 0);
+        CFStringAppendCharacters (s, &qcs->c, len);
     } else {
         s = NULL;
     }
diff --git a/WebCore/src/kwq/qt/qstring.h b/WebCore/src/kwq/qt/qstring.h
index 1cbc9cc..46878ff 100644
--- a/WebCore/src/kwq/qt/qstring.h
+++ b/WebCore/src/kwq/qt/qstring.h
@@ -526,7 +526,7 @@ private:
     friend class QGDict;
 
 #ifdef _KWQ_
-    void _copyInternalString();
+    void _copyIfNeededInternalString();
 #endif
 
 #ifdef KWQ_STRING_DEBUG

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list