[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:44:57 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 521e6fb242062c38f412db366564a87c7a0bd404
Author: gramps <gramps at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Sep 19 02:16:24 2001 +0000

    Added QConstString implementation and some fixes
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/kwq/KWQString.h b/WebCore/kwq/KWQString.h
index 8edeca7..2fb8527 100644
--- a/WebCore/kwq/KWQString.h
+++ b/WebCore/kwq/KWQString.h
@@ -30,13 +30,15 @@
 #include <config.h>
 #endif
 
+// FIXME: this clever hack may need to be moved into KWQDef.h or elsewhere
 #define Fixed MacFixed
 #define Rect MacRect
 #define Boolean MacBoolean
-#include <CoreFoundation/CFString.h>
+#include <CoreFoundation/CoreFoundation.h>
 #undef Fixed
 #undef Rect
 #undef Boolean
+
 #include "qcstring.h"
 
 class QString;
@@ -255,16 +257,21 @@ public:
 
     // static member functions -------------------------------------------------
 
-    const QString string() const;
-
     // constructors, copy constructors, and destructors ------------------------
 
     QConstString(QChar *, uint);
-    QConstString(const QConstString &);
+#ifdef _KWQ_PEDANTIC_
+    // NOTE: copy constructor not needed
+    // QConstString(const QConstString &);
+#endif
 
-    ~QConstString();
+    // NOTE: destructor not needed
+    //~QConstString();
 
     // member functions --------------------------------------------------------
+
+    const QString &string() const;
+
     // operators ---------------------------------------------------------------
 
 // protected -------------------------------------------------------------------
@@ -275,7 +282,8 @@ private:
 // add assignment operator 
 // this private declaration prevents assignment
 #ifdef _KWQ_PEDANTIC_
-    QConstString &operator=(const QConstString &);
+    // NOTE: assignment operator not needed
+    // QConstString &operator=(const QConstString &);
 #endif
 
 }; // class QConstString =======================================================
diff --git a/WebCore/kwq/KWQString.mm b/WebCore/kwq/KWQString.mm
index e4ca8aa..fe371ad 100644
--- a/WebCore/kwq/KWQString.mm
+++ b/WebCore/kwq/KWQString.mm
@@ -61,3 +61,18 @@ QString::~QString()
 {
     CFRelease(s);
 }
+
+QConstString::QConstString(QChar *qc, uint len)
+{
+    if (qc || len) {
+        // FIXME: do we ever need to worry about deallocating the contents?
+        s = const_cast<CFMutableStringRef>(CFStringCreateWithCharactersNoCopy(NULL, &qc->c, len, kCFAllocatorNull));
+    } else {
+        s = NULL;
+    }
+}
+
+const QString &QConstString::string() const
+{
+    return *this;
+}
diff --git a/WebCore/kwq/qt/qstring.h b/WebCore/kwq/qt/qstring.h
index 8edeca7..2fb8527 100644
--- a/WebCore/kwq/qt/qstring.h
+++ b/WebCore/kwq/qt/qstring.h
@@ -30,13 +30,15 @@
 #include <config.h>
 #endif
 
+// FIXME: this clever hack may need to be moved into KWQDef.h or elsewhere
 #define Fixed MacFixed
 #define Rect MacRect
 #define Boolean MacBoolean
-#include <CoreFoundation/CFString.h>
+#include <CoreFoundation/CoreFoundation.h>
 #undef Fixed
 #undef Rect
 #undef Boolean
+
 #include "qcstring.h"
 
 class QString;
@@ -255,16 +257,21 @@ public:
 
     // static member functions -------------------------------------------------
 
-    const QString string() const;
-
     // constructors, copy constructors, and destructors ------------------------
 
     QConstString(QChar *, uint);
-    QConstString(const QConstString &);
+#ifdef _KWQ_PEDANTIC_
+    // NOTE: copy constructor not needed
+    // QConstString(const QConstString &);
+#endif
 
-    ~QConstString();
+    // NOTE: destructor not needed
+    //~QConstString();
 
     // member functions --------------------------------------------------------
+
+    const QString &string() const;
+
     // operators ---------------------------------------------------------------
 
 // protected -------------------------------------------------------------------
@@ -275,7 +282,8 @@ private:
 // add assignment operator 
 // this private declaration prevents assignment
 #ifdef _KWQ_PEDANTIC_
-    QConstString &operator=(const QConstString &);
+    // NOTE: assignment operator not needed
+    // QConstString &operator=(const QConstString &);
 #endif
 
 }; // class QConstString =======================================================
diff --git a/WebCore/src/kwq/KWQString.mm b/WebCore/src/kwq/KWQString.mm
index e4ca8aa..fe371ad 100644
--- a/WebCore/src/kwq/KWQString.mm
+++ b/WebCore/src/kwq/KWQString.mm
@@ -61,3 +61,18 @@ QString::~QString()
 {
     CFRelease(s);
 }
+
+QConstString::QConstString(QChar *qc, uint len)
+{
+    if (qc || len) {
+        // FIXME: do we ever need to worry about deallocating the contents?
+        s = const_cast<CFMutableStringRef>(CFStringCreateWithCharactersNoCopy(NULL, &qc->c, len, kCFAllocatorNull));
+    } else {
+        s = NULL;
+    }
+}
+
+const QString &QConstString::string() const
+{
+    return *this;
+}
diff --git a/WebCore/src/kwq/qt/qstring.h b/WebCore/src/kwq/qt/qstring.h
index 8edeca7..2fb8527 100644
--- a/WebCore/src/kwq/qt/qstring.h
+++ b/WebCore/src/kwq/qt/qstring.h
@@ -30,13 +30,15 @@
 #include <config.h>
 #endif
 
+// FIXME: this clever hack may need to be moved into KWQDef.h or elsewhere
 #define Fixed MacFixed
 #define Rect MacRect
 #define Boolean MacBoolean
-#include <CoreFoundation/CFString.h>
+#include <CoreFoundation/CoreFoundation.h>
 #undef Fixed
 #undef Rect
 #undef Boolean
+
 #include "qcstring.h"
 
 class QString;
@@ -255,16 +257,21 @@ public:
 
     // static member functions -------------------------------------------------
 
-    const QString string() const;
-
     // constructors, copy constructors, and destructors ------------------------
 
     QConstString(QChar *, uint);
-    QConstString(const QConstString &);
+#ifdef _KWQ_PEDANTIC_
+    // NOTE: copy constructor not needed
+    // QConstString(const QConstString &);
+#endif
 
-    ~QConstString();
+    // NOTE: destructor not needed
+    //~QConstString();
 
     // member functions --------------------------------------------------------
+
+    const QString &string() const;
+
     // operators ---------------------------------------------------------------
 
 // protected -------------------------------------------------------------------
@@ -275,7 +282,8 @@ private:
 // add assignment operator 
 // this private declaration prevents assignment
 #ifdef _KWQ_PEDANTIC_
-    QConstString &operator=(const QConstString &);
+    // NOTE: assignment operator not needed
+    // QConstString &operator=(const QConstString &);
 #endif
 
 }; // class QConstString =======================================================

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list