[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 06:21:11 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit d2867d5bed66a67c16465c17da218c3d6fd917ae
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Jun 25 17:30:43 2002 +0000
Removed remaining uses of BORROWED defines.
Made some simplifications and formatting fixes. All safe.
* kwq/KWQArrayImpl.h:
* kwq/KWQArrayImpl.mm:
* kwq/KWQChar.mm:
* kwq/KWQCharsets.mm:
* kwq/KWQFile.mm:
* kwq/KWQKCursor.mm:
* kwq/KWQKHTMLPart.mm:
* kwq/KWQListImpl.h:
* kwq/KWQMapImpl.mm:
* kwq/KWQString.mm:
* kwq/KWQValueListImpl.mm:
* kwq/KWQVectorImpl.h:
* kwq/KWQtextcodec.mm:
* kwq/make-charset-table.pl:
* kwq/make-mac-encodings.c:
* kwq/qt/qfile.h:
* kwq/qt/qregexp.h:
* kwq/qt/qtextcodec.h:
* WebCore-tests.exp: Small change to exports for the array test.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@1428 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog-2002-12-03 b/WebCore/ChangeLog-2002-12-03
index a4bf0cf..5f7d179 100644
--- a/WebCore/ChangeLog-2002-12-03
+++ b/WebCore/ChangeLog-2002-12-03
@@ -1,3 +1,29 @@
+2002-06-25 Darin Adler <darin at apple.com>
+
+ Removed remaining uses of BORROWED defines.
+ Made some simplifications and formatting fixes. All safe.
+
+ * kwq/KWQArrayImpl.h:
+ * kwq/KWQArrayImpl.mm:
+ * kwq/KWQChar.mm:
+ * kwq/KWQCharsets.mm:
+ * kwq/KWQFile.mm:
+ * kwq/KWQKCursor.mm:
+ * kwq/KWQKHTMLPart.mm:
+ * kwq/KWQListImpl.h:
+ * kwq/KWQMapImpl.mm:
+ * kwq/KWQString.mm:
+ * kwq/KWQValueListImpl.mm:
+ * kwq/KWQVectorImpl.h:
+ * kwq/KWQtextcodec.mm:
+ * kwq/make-charset-table.pl:
+ * kwq/make-mac-encodings.c:
+ * kwq/qt/qfile.h:
+ * kwq/qt/qregexp.h:
+ * kwq/qt/qtextcodec.h:
+
+ * WebCore-tests.exp: Small change to exports for the array test.
+
2002-06-24 Chris Blumenberg <cblu at apple.com>
Changed the plug-in view constructor to take NSURL's rather
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index a4bf0cf..5f7d179 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,29 @@
+2002-06-25 Darin Adler <darin at apple.com>
+
+ Removed remaining uses of BORROWED defines.
+ Made some simplifications and formatting fixes. All safe.
+
+ * kwq/KWQArrayImpl.h:
+ * kwq/KWQArrayImpl.mm:
+ * kwq/KWQChar.mm:
+ * kwq/KWQCharsets.mm:
+ * kwq/KWQFile.mm:
+ * kwq/KWQKCursor.mm:
+ * kwq/KWQKHTMLPart.mm:
+ * kwq/KWQListImpl.h:
+ * kwq/KWQMapImpl.mm:
+ * kwq/KWQString.mm:
+ * kwq/KWQValueListImpl.mm:
+ * kwq/KWQVectorImpl.h:
+ * kwq/KWQtextcodec.mm:
+ * kwq/make-charset-table.pl:
+ * kwq/make-mac-encodings.c:
+ * kwq/qt/qfile.h:
+ * kwq/qt/qregexp.h:
+ * kwq/qt/qtextcodec.h:
+
+ * WebCore-tests.exp: Small change to exports for the array test.
+
2002-06-24 Chris Blumenberg <cblu at apple.com>
Changed the plug-in view constructor to take NSURL's rather
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index a4bf0cf..5f7d179 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,29 @@
+2002-06-25 Darin Adler <darin at apple.com>
+
+ Removed remaining uses of BORROWED defines.
+ Made some simplifications and formatting fixes. All safe.
+
+ * kwq/KWQArrayImpl.h:
+ * kwq/KWQArrayImpl.mm:
+ * kwq/KWQChar.mm:
+ * kwq/KWQCharsets.mm:
+ * kwq/KWQFile.mm:
+ * kwq/KWQKCursor.mm:
+ * kwq/KWQKHTMLPart.mm:
+ * kwq/KWQListImpl.h:
+ * kwq/KWQMapImpl.mm:
+ * kwq/KWQString.mm:
+ * kwq/KWQValueListImpl.mm:
+ * kwq/KWQVectorImpl.h:
+ * kwq/KWQtextcodec.mm:
+ * kwq/make-charset-table.pl:
+ * kwq/make-mac-encodings.c:
+ * kwq/qt/qfile.h:
+ * kwq/qt/qregexp.h:
+ * kwq/qt/qtextcodec.h:
+
+ * WebCore-tests.exp: Small change to exports for the array test.
+
2002-06-24 Chris Blumenberg <cblu at apple.com>
Changed the plug-in view constructor to take NSURL's rather
diff --git a/WebCore/WebCore-tests.exp b/WebCore/WebCore-tests.exp
index 5056176..20928d9 100644
--- a/WebCore/WebCore-tests.exp
+++ b/WebCore/WebCore-tests.exp
@@ -37,7 +37,6 @@ __ZN12KWQArrayImpl4fillEPKvi
__ZN12KWQArrayImpl6resizeEm
__ZN12KWQArrayImpl9duplicateEPKvm
__ZN12KWQArrayImplC1ERKS_
-__ZN12KWQArrayImplC1Em
__ZN12KWQArrayImplC1Emm
__ZN12KWQArrayImplD1Ev
__ZN12KWQArrayImplaSERKS_
diff --git a/WebCore/kwq/KWQArrayImpl.h b/WebCore/kwq/KWQArrayImpl.h
index b588a8a..b7a0fde 100644
--- a/WebCore/kwq/KWQArrayImpl.h
+++ b/WebCore/kwq/KWQArrayImpl.h
@@ -26,21 +26,17 @@
#ifndef KWQ_ARRAY_IMPL_H
#define KWQ_ARRAY_IMPL_H
-#include <config.h>
#include <KWQRefPtr.h>
#include <KWQDef.h>
#include <stddef.h>
-#ifndef USING_BORROWED_QARRAY
-
class KWQArrayImpl
{
public:
- KWQArrayImpl(size_t itemSize);
- KWQArrayImpl(size_t itemSize, size_t numItems);
- KWQArrayImpl(const KWQArrayImpl &);
+ KWQArrayImpl(size_t itemSize, size_t numItems = 0);
~KWQArrayImpl();
+ KWQArrayImpl(const KWQArrayImpl &);
KWQArrayImpl &operator=(const KWQArrayImpl &);
void *at(size_t pos) const;
@@ -58,6 +54,3 @@ class KWQArrayImpl
};
#endif
-
-#endif
-
diff --git a/WebCore/kwq/KWQArrayImpl.mm b/WebCore/kwq/KWQArrayImpl.mm
index 5e74e27..4b59096 100644
--- a/WebCore/kwq/KWQArrayImpl.mm
+++ b/WebCore/kwq/KWQArrayImpl.mm
@@ -30,7 +30,7 @@
#define MIN(a,b) (((a)<(b))?(a):(b))
-using namespace std;
+using std::nothrow;
class KWQArrayImpl::KWQArrayPrivate
{
@@ -39,31 +39,24 @@ public:
~KWQArrayPrivate();
size_t numItems;
size_t itemSize;
- void *data;
+ char *data;
int refCount;
};
KWQArrayImpl::KWQArrayPrivate::KWQArrayPrivate(size_t pItemSize, size_t pNumItems) :
numItems(pNumItems),
itemSize(pItemSize),
- data(pNumItems > 0 ? (void *)new char[itemSize * numItems] : NULL),
+ data(pNumItems > 0 ? new char[itemSize * numItems] : NULL),
refCount(0)
{
}
KWQArrayImpl::KWQArrayPrivate::~KWQArrayPrivate()
{
- if (data != NULL) {
- delete[] (char *)data;
- }
+ delete[] data;
}
-KWQArrayImpl::KWQArrayImpl(size_t itemSize) :
- d(new KWQArrayPrivate(itemSize, 0))
-{
-}
-
KWQArrayImpl::KWQArrayImpl(size_t itemSize, size_t numItems) :
d(new KWQArrayPrivate(itemSize, numItems))
{
@@ -86,7 +79,7 @@ KWQArrayImpl &KWQArrayImpl::operator=(const KWQArrayImpl &a)
void *KWQArrayImpl::at(size_t pos) const
{
- return (void *)&((char *)d->data)[pos*d->itemSize];
+ return &d->data[pos * d->itemSize];
}
void *KWQArrayImpl::data() const
@@ -102,9 +95,10 @@ uint KWQArrayImpl::size() const
bool KWQArrayImpl::resize(size_t newSize)
{
if (newSize != d->numItems) {
- void *newData;
+ char *newData;
+
if (newSize != 0) {
- newData= new(nothrow) char[newSize*d->itemSize];
+ newData = new (nothrow) char[newSize * d->itemSize];
if (newData == NULL) {
return false;
}
@@ -112,10 +106,9 @@ bool KWQArrayImpl::resize(size_t newSize)
newData = NULL;
}
- memcpy(newData, d->data, MIN(newSize, d->numItems)*d->itemSize);
- if (d->data != NULL) {
- delete[] (char *)d->data;
- }
+ memcpy(newData, d->data, MIN(newSize, d->numItems) * d->itemSize);
+
+ delete[] d->data;
d->data = newData;
d->numItems = newSize;
}
@@ -130,14 +123,14 @@ void KWQArrayImpl::duplicate(const void *data, size_t newSize)
}
if (d->refCount > 1) {
- d = KWQRefPtr<KWQArrayImpl::KWQArrayPrivate>(new KWQArrayImpl::KWQArrayPrivate(d->itemSize, newSize));
+ d = KWQRefPtr<KWQArrayPrivate>(new KWQArrayPrivate(d->itemSize, newSize));
}
if (d->numItems != newSize) {
resize(newSize);
}
- memcpy(d->data, data, newSize*d->itemSize);
+ memcpy(d->data, data, newSize * d->itemSize);
}
bool KWQArrayImpl::fill(const void *item, int numItems)
@@ -152,8 +145,8 @@ bool KWQArrayImpl::fill(const void *item, int numItems)
}
}
- for(int i = 0; i < numItems; i++) {
- memcpy(&((char *)d->data)[i*d->itemSize], item, d->itemSize);
+ for (int i = 0; i < numItems; i++) {
+ memcpy(&d->data[i * d->itemSize], item, d->itemSize);
}
return true;
@@ -161,5 +154,6 @@ bool KWQArrayImpl::fill(const void *item, int numItems)
bool KWQArrayImpl::operator==(const KWQArrayImpl &a) const
{
- return d->numItems == a.d->numItems && d->itemSize == d->itemSize && (d->data == a.d->data || memcmp(d->data, a.d->data, d->itemSize*d->numItems) == 0);
+ return d->numItems == a.d->numItems && d->itemSize == d->itemSize
+ && (d->data == a.d->data || memcmp(d->data, a.d->data, d->itemSize*d->numItems) == 0);
}
diff --git a/WebCore/kwq/KWQChar.mm b/WebCore/kwq/KWQChar.mm
index fcd7b76..5593c43 100644
--- a/WebCore/kwq/KWQChar.mm
+++ b/WebCore/kwq/KWQChar.mm
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2001 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2001, 2002 Apple Computer, Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -23,40 +23,24 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#import <qstring.h>
#import <kwqdebug.h>
#import <Foundation/Foundation.h>
-#import <qstring.h>
-
-#ifndef USING_BORROWED_QSTRING
static UniChar scratchUniChar;
-/* FIXME: use of this function is clearly not threadsafe! */
static CFMutableStringRef GetScratchUniCharString()
{
static CFMutableStringRef s = NULL;
-
- if (!s) {
- s = CFStringCreateMutableWithExternalCharactersNoCopy(
- kCFAllocatorDefault, &scratchUniChar, 1, 1, kCFAllocatorNull);
- }
+ if (!s)
+ s = CFStringCreateMutableWithExternalCharactersNoCopy(kCFAllocatorDefault, &scratchUniChar, 1, 1, kCFAllocatorNull);
return s;
}
-// constants -------------------------------------------------------------------
-
const QChar QChar::null;
-// member functions ------------------------------------------------------------
-
bool QChar::isSpace() const
{
- // FIXME: should we use this optimization?
-#if 0
- if (c <= 0xff) {
- return isspace(c);
- }
-#endif
static CFCharacterSetRef set = CFCharacterSetGetPredefined(kCFCharacterSetWhitespaceAndNewline);
return CFCharacterSetIsCharacterMember(set, c);
}
@@ -92,33 +76,22 @@ bool QChar::isPunct() const
QChar QChar::lower() const
{
- CFMutableStringRef scratchUniCharString = GetScratchUniCharString();
- if (scratchUniCharString) {
- scratchUniChar = c;
- CFStringLowercase(scratchUniCharString, NULL);
- if (scratchUniChar) {
- return scratchUniChar;
- }
- }
- return *this;
+ scratchUniChar = c;
+ CFStringLowercase(GetScratchUniCharString(), NULL);
+ return scratchUniChar;
}
QChar QChar::upper() const
{
- CFMutableStringRef scratchUniCharString = GetScratchUniCharString();
- if (scratchUniCharString) {
- scratchUniChar = c;
- CFStringUppercase(scratchUniCharString, NULL);
- if (scratchUniChar) {
- return scratchUniChar;
- }
- }
- return *this;
+ scratchUniChar = c;
+ CFStringUppercase(GetScratchUniCharString(), NULL);
+ return scratchUniChar;
}
QChar::Direction QChar::direction() const
{
// FIXME: unimplemented because we don't do BIDI yet
+ _logNotYetImplemented();
if (c == ' ')
return DirWS;
return DirL;
@@ -128,8 +101,7 @@ bool QChar::mirrored() const
{
// FIXME: unimplemented because we don't do BIDI yet
_logNotYetImplemented();
- // return whether character should be reversed if text direction is
- // reversed
+ // return whether character should be reversed if text direction is reversed
return false;
}
@@ -143,11 +115,8 @@ QChar QChar::mirroredChar() const
int QChar::digitValue() const
{
- // ##### just latin1
if (c < '0' || c > '9')
return -1;
else
return c - '0';
}
-
-#endif
diff --git a/WebCore/kwq/KWQCharsets.mm b/WebCore/kwq/KWQCharsets.mm
index d835813..474d0a3 100644
--- a/WebCore/kwq/KWQCharsets.mm
+++ b/WebCore/kwq/KWQCharsets.mm
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2001 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2001, 2002 Apple Computer, Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -79,8 +79,7 @@ CFStringEncoding KWQCFStringEncodingFromIANACharsetName(CFStringRef charsetName)
if (CFDictionaryGetValueIfPresent(nameToEncoding, (void *) charsetName, &value)) {
return (CFStringEncoding) value;
} else {
- // FIXME: This cast to CFStringEncoding is a workaround for Radar 2912404.
- return (CFStringEncoding) kCFStringEncodingInvalidId;
+ return kCFStringEncodingInvalidId;
}
}
@@ -96,8 +95,7 @@ CFStringEncoding KWQCFStringEncodingFromMIB(int mib)
if (CFDictionaryGetValueIfPresent(mibToEncoding, (void *) mib, &value)) {
return (CFStringEncoding) value;
} else {
- // FIXME: This cast to CFStringEncoding is a workaround for Radar 2912404.
- return (CFStringEncoding) kCFStringEncodingInvalidId;
+ return kCFStringEncodingInvalidId;
}
}
diff --git a/WebCore/kwq/KWQFile.h b/WebCore/kwq/KWQFile.h
index 30fc90e..3fa5b6e 100644
--- a/WebCore/kwq/KWQFile.h
+++ b/WebCore/kwq/KWQFile.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2001 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2001, 2002 Apple Computer, Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -26,27 +26,14 @@
#ifndef QFILE_H_
#define QFILE_H_
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
#include <KWQDef.h>
-// USING_BORROWED_QFILE =======================================================
-
-#ifdef USING_BORROWED_QFILE
-
-#include <_qfile.h>
-
-#else // !USING_BORROWED_QFILE
-
#include <qstring.h>
#include <qiodevice.h>
class QFile
{
public:
- QFile();
QFile(const QString &);
~QFile();
@@ -59,17 +46,11 @@ public:
static bool exists(const QString &path);
private:
- // no copying or assignment
- // note that these are "standard" (no pendantic stuff needed)
QFile(const QFile &);
QFile &operator=(const QFile &);
- class KWQFilePrivate;
-
- KWQFilePrivate *d;
+ char *name;
+ int fd;
};
-
-#endif // USING_BORROWED_QFILE
-
#endif // QFILE_H_
diff --git a/WebCore/kwq/KWQFile.mm b/WebCore/kwq/KWQFile.mm
index 506bb1d..882361d 100644
--- a/WebCore/kwq/KWQFile.mm
+++ b/WebCore/kwq/KWQFile.mm
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2001 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2001, 2002 Apple Computer, Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -25,59 +25,18 @@
#import <qfile.h>
-#ifndef USING_BORROWED_QFILE
-
-#import <kwqdebug.h>
-#import <Foundation/Foundation.h>
-#import <sys/param.h>
-#import <qstring.h>
-#import <unistd.h>
-#import <sys/types.h>
-#import <sys/stat.h>
-#import <fcntl.h>
-
-#import <qiodevice.h>
-
-class QFile::KWQFilePrivate
-{
-public:
- KWQFilePrivate(const QString &name);
- ~KWQFilePrivate();
-
- char *name;
- int fd;
-};
-
-
-QFile::KWQFilePrivate::KWQFilePrivate(const QString &qname) : name(new char[MAXPATHLEN + 1]), fd(-1)
-{
- NSString *nsname = (NSString *)qname.getCFMutableString();
-
- [nsname getFileSystemRepresentation:name maxLength:MAXPATHLEN];
-}
-
-QFile::KWQFilePrivate::~KWQFilePrivate()
-{
- delete [] name;
-}
-
-
-QFile::QFile() : d(new QFile::KWQFilePrivate(QString("")))
-{
-}
-
-QFile::QFile(const QString &name) : d(new QFile::KWQFilePrivate(name))
+QFile::QFile(const QString &n) : name(strdup([n.getNSString() fileSystemRepresentation])), fd(-1)
{
}
QFile::~QFile()
{
- delete d;
+ free(name);
}
bool QFile::exists() const
{
- return access(d->name, F_OK) == 0;
+ return access(name, F_OK) == 0;
}
bool QFile::open(int mode)
@@ -85,27 +44,27 @@ bool QFile::open(int mode)
close();
if (mode == IO_ReadOnly) {
- d->fd = ::open(d->name, O_RDONLY);
+ fd = ::open(name, O_RDONLY);
}
- return d->fd != -1;
+ return fd != -1;
}
void QFile::close()
{
- if (d->fd != -1) {
- ::close(d->fd);
+ if (fd != -1) {
+ ::close(fd);
}
- d->fd = -1;
+ fd = -1;
}
int QFile::readBlock(char *data, uint bytesToRead)
{
- if (d->fd == -1) {
+ if (fd == -1) {
return -1;
} else {
- return read(d->fd, data, bytesToRead);
+ return read(fd, data, bytesToRead);
}
}
@@ -113,7 +72,7 @@ uint QFile::size() const
{
struct stat statbuf;
- if (stat(d->name, &statbuf) == 0) {
+ if (stat(name, &statbuf) == 0) {
return statbuf.st_size;
} else {
return 0;
@@ -124,7 +83,3 @@ bool QFile::exists(const QString &path)
{
return QFile(path).exists();
}
-
-
-#endif
-
diff --git a/WebCore/kwq/KWQKCursor.mm b/WebCore/kwq/KWQKCursor.mm
index 7005d09..79d0d24 100644
--- a/WebCore/kwq/KWQKCursor.mm
+++ b/WebCore/kwq/KWQKCursor.mm
@@ -31,21 +31,21 @@
@end
@implementation NSCursor (_WebCoreCursorAdditions)
+
+ (NSCursor *)_WebCore_linkCursor
{
static NSCursor *linkCursor = nil;
- if (linkCursor == nil)
- {
+ if (linkCursor == nil) {
NSImage *linkCursorImage = [[NSImage alloc] initWithContentsOfFile:
- [[NSBundle bundleWithIdentifier:@"com.apple.WebCore"] pathForResource:@"linkCursor" ofType:@"tiff"]];
- [linkCursorImage autorelease];
-
+ [[NSBundle bundleWithIdentifier:@"com.apple.WebCore"] pathForResource:@"linkCursor" ofType:@"tiff"]];
linkCursor = [[NSCursor alloc] initWithImage:linkCursorImage hotSpot:NSMakePoint(6.0,1.0)];
+ [linkCursorImage release];
}
return linkCursor;
}
+
@end
const QCursor &waitCursor = KCursor::waitCursor();
diff --git a/WebCore/kwq/KWQKHTMLPart.mm b/WebCore/kwq/KWQKHTMLPart.mm
index 1907cfe..c8822f0 100644
--- a/WebCore/kwq/KWQKHTMLPart.mm
+++ b/WebCore/kwq/KWQKHTMLPart.mm
@@ -487,9 +487,9 @@ bool KWQKHTMLPartImpl::requestObject(khtml::RenderPart *frame, const QString &ur
QWidget *widget = new QWidget();
widget->setView([[WebCoreViewFactory sharedFactory]
viewForPluginWithURL:part->completeURL(url).getNSURL()
- serviceType:serviceType.getNSString()
- arguments:argsArray
- baseURL:m_baseURL.getNSURL()]);
+ serviceType:serviceType.getNSString()
+ arguments:argsArray
+ baseURL:m_baseURL.getNSURL()]);
frame->setWidget(widget);
return true;
diff --git a/WebCore/kwq/KWQKHTMLPartImpl.mm b/WebCore/kwq/KWQKHTMLPartImpl.mm
index 1907cfe..c8822f0 100644
--- a/WebCore/kwq/KWQKHTMLPartImpl.mm
+++ b/WebCore/kwq/KWQKHTMLPartImpl.mm
@@ -487,9 +487,9 @@ bool KWQKHTMLPartImpl::requestObject(khtml::RenderPart *frame, const QString &ur
QWidget *widget = new QWidget();
widget->setView([[WebCoreViewFactory sharedFactory]
viewForPluginWithURL:part->completeURL(url).getNSURL()
- serviceType:serviceType.getNSString()
- arguments:argsArray
- baseURL:m_baseURL.getNSURL()]);
+ serviceType:serviceType.getNSString()
+ arguments:argsArray
+ baseURL:m_baseURL.getNSURL()]);
frame->setWidget(widget);
return true;
diff --git a/WebCore/kwq/KWQListImpl.h b/WebCore/kwq/KWQListImpl.h
index 7a12dbc..d2f6718 100644
--- a/WebCore/kwq/KWQListImpl.h
+++ b/WebCore/kwq/KWQListImpl.h
@@ -26,11 +26,8 @@
#ifndef KWQ_LIST_IMPL_H
#define KWQ_LIST_IMPL_H
-#include <config.h>
#include <KWQDef.h>
-#ifndef USING_BORROWED_QLIST
-
class KWQListNode;
class KWQListIteratorImpl;
@@ -120,5 +117,3 @@ private:
};
#endif
-
-#endif
diff --git a/WebCore/kwq/KWQMapImpl.mm b/WebCore/kwq/KWQMapImpl.mm
index fc93314..f34cb22 100644
--- a/WebCore/kwq/KWQMapImpl.mm
+++ b/WebCore/kwq/KWQMapImpl.mm
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2001 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2001, 2002 Apple Computer, Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -25,10 +25,6 @@
#import <KWQMapImpl.h>
-#ifndef USING_BORROWED_QMAP
-
-// KWQMapNodeImpl
-
KWQMapNodeImpl::KWQMapNodeImpl() :
prev(NULL),
next(NULL),
@@ -153,7 +149,7 @@ KWQMapImpl::KWQMapPrivate::~KWQMapPrivate()
// KWQMapImpl
KWQMapImpl::KWQMapImpl(KWQMapNodeImpl *guard, void (*deleteNode)(KWQMapNodeImpl *)) :
- d(new KWQMapImpl::KWQMapPrivate(guard,0, deleteNode))
+ d(new KWQMapPrivate(guard, 0, deleteNode))
{
}
@@ -169,7 +165,7 @@ KWQMapImpl::~KWQMapImpl()
void KWQMapImpl::copyOnWrite()
{
if (d->refCount > 1) {
- d = KWQRefPtr<KWQMapImpl::KWQMapPrivate>(new KWQMapImpl::KWQMapPrivate(copyTree(d->guard, NULL, NULL), d->numNodes, d->deleteNode));
+ d = KWQRefPtr<KWQMapPrivate>(new KWQMapPrivate(copyTree(d->guard, NULL, NULL), d->numNodes, d->deleteNode));
}
}
@@ -593,7 +589,7 @@ void KWQMapImpl::removeEqualInternal(KWQMapNodeImpl *nodeToDelete, bool samePoin
void KWQMapImpl::swap(KWQMapImpl &map)
{
- KWQRefPtr<KWQMapImpl::KWQMapPrivate> tmp = d;
+ KWQRefPtr<KWQMapPrivate> tmp = d;
d = map.d;
map.d = d;
}
@@ -648,7 +644,3 @@ KWQMapNodeImpl *KWQMapImpl::endInternal()
copyOnWrite();
return d->guard;
}
-
-
-
-#endif
diff --git a/WebCore/kwq/KWQRegExp.h b/WebCore/kwq/KWQRegExp.h
index c8bedad..2857973 100644
--- a/WebCore/kwq/KWQRegExp.h
+++ b/WebCore/kwq/KWQRegExp.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2001 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2001, 2002 Apple Computer, Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -26,43 +26,26 @@
#ifndef QREGEXP_H_
#define QREGEXP_H_
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-// USING_BORROWED_QREGEXP ======================================================
-
-#ifdef USING_BORROWED_QREGEXP
-#include <_qregexp.h>
-#else
-
#include <qstring.h>
#include <KWQRefPtr.h>
-// class QRegExp ===============================================================
-
class QRegExp {
public:
-
QRegExp();
- QRegExp(const QString &, bool caseSensitive = TRUE, bool glob = FALSE);
+ QRegExp(const QString &, bool caseSensitive = false, bool glob = false);
QRegExp(const char *);
- QRegExp(const QRegExp &);
~QRegExp();
+ QRegExp(const QRegExp &);
QRegExp &operator=(const QRegExp &);
QString pattern() const;
- int match (const QString &, int startFrom = 0, int *matchLength = 0,
- bool treatStartAsStartOfInput = TRUE) const;
+ int match(const QString &, int startFrom = 0, int *matchLength = 0, bool treatStartAsStartOfInput = true) const;
private:
- class KWQRegExpPrivate;
-
+ class KWQRegExpPrivate;
KWQRefPtr<KWQRegExpPrivate> d;
-}; // class QRegExp ============================================================
-
-#endif // USING_BORROWED_QREGEXP
+};
#endif
diff --git a/WebCore/kwq/KWQString.mm b/WebCore/kwq/KWQString.mm
index c5b3fd6..607cb2d 100644
--- a/WebCore/kwq/KWQString.mm
+++ b/WebCore/kwq/KWQString.mm
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2001 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2001, 2002 Apple Computer, Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -37,13 +37,6 @@
#import <qregexp.h>
#import <stdio.h>
-
-#ifndef USING_BORROWED_QSTRING
-
-// QString class ===============================================================
-
-// constants -------------------------------------------------------------------
-
const QString QString::null;
static CFMutableStringRef
@@ -61,8 +54,6 @@ getNullQCharString()
return &nullCharacter;
}
-// static member functions -----------------------------------------------------
-
QString QString::number(int n)
{
QString qs;
@@ -98,14 +89,6 @@ QString QString::number(double n)
return qs;
}
-#ifdef USING_BORROWED_KURL
-QString QString::fromLocal8Bit(const char *chs, int len)
-{
- // FIXME: is MacRoman the correct encoding?
- return fromStringWithEncoding(chs, len, kCFStringEncodingMacRoman);
-}
-#endif // USING_BORROWED_KURL
-
QString QString::fromStringWithEncoding(const char *chs, int len,
CFStringEncoding encoding)
{
@@ -175,10 +158,6 @@ CFMutableStringRef QString::gstring_toCFString(CFMutableStringRef *ref, UniChar
return *ref;
}
-
-
-// constructors, copy constructors, and destructors ----------------------------
-
QString::QString()
{
s = getNullCFString();
@@ -253,8 +232,6 @@ QString::QString(const QString &qs)
cache = NULL;
}
-// assignment operators --------------------------------------------------------
-
QString &QString::operator=(const QString &qs)
{
// shared copy
@@ -285,8 +262,6 @@ QString &QString::operator=(char ch)
return *this = QString(QChar(ch));
}
-// member functions ------------------------------------------------------------
-
QChar QString::at(uint index) const
{
CFIndex signedIndex = index;
@@ -1070,8 +1045,6 @@ QString QString::visual()
return QString(*this);
}
-// operators -------------------------------------------------------------------
-
QString &QString::operator+=(const QString &qs)
{
return insert(length(), qs);
@@ -1087,8 +1060,6 @@ QString &QString::operator+=(char ch)
return insert(length(), ch);
}
-// private member functions ----------------------------------------------------
-
void QString::flushCache() const
{
if (cache) {
@@ -1247,8 +1218,6 @@ int QString::compareToLatin1(const char *chs) const
return kCFCompareGreaterThan;
}
-// operators associated with QString ===========================================
-
bool operator==(const QString &qs1, const QString &qs2)
{
return CFEqual(qs1.s, qs2.s);
@@ -1327,10 +1296,6 @@ QString operator+(char ch, const QString &qs)
return tmp;
}
-// class QConstString ==========================================================
-
-// constructors, copy constructors, and destructors ----------------------------
-
QConstString::QConstString(const QChar *qcs, uint len)
{
if (qcs || len) {
@@ -1345,10 +1310,3 @@ QConstString::QConstString(const QChar *qcs, uint len)
}
cache = NULL;
}
-
-// member functions ------------------------------------------------------------
-
-#else // USING_BORROWED_QSTRING
-// This will help to keep the linker from complaining about empty archives
-void KWQString_Dummy() {}
-#endif // USING_BORROWED_QSTRING
diff --git a/WebCore/kwq/KWQTextCodec.h b/WebCore/kwq/KWQTextCodec.h
index 3eff4d9..c122c35 100644
--- a/WebCore/kwq/KWQTextCodec.h
+++ b/WebCore/kwq/KWQTextCodec.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2001 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2001, 2002 Apple Computer, Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -26,64 +26,18 @@
#ifndef QTEXTCODEC_H_
#define QTEXTCODEC_H_
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-// USING_BORROWED_QSTRING ======================================================
-#ifdef USING_BORROWED_QSTRING
-
-#include <_qtextcodec.h>
-
-#else
-
-#include "qstring.h"
-#include "qcstring.h"
-
-class QTextCodec;
-
-// class QTextDecoder ==========================================================
-
-class QTextDecoder {
-public:
-
- // constructors, copy constructors, and destructors ------------------------
-
- QTextDecoder(const QTextCodec *);
- ~QTextDecoder();
-
- // member functions --------------------------------------------------------
-
- QString toUnicode(const char *, int);
-
-// private ---------------------------------------------------------------------
-
-private:
-
- // data members ------------------------------------------------------------
-
- const QTextCodec *textCodec;
-
-}; // class QTextDecoder =======================================================
+#include <qstring.h>
+#include <qcstring.h>
-
-// class QTextCodec ============================================================
+class QTextDecoder;
class QTextCodec {
public:
-
- // static member functions -------------------------------------------------
-
static QTextCodec *codecForMib(int);
static QTextCodec *codecForName(const char *, int accuracy=0);
static QTextCodec *codecForLocale();
- // constructors, copy constructors, and destructors ------------------------
-
- QTextCodec(CFStringEncoding);
- ~QTextCodec();
-
- // member functions --------------------------------------------------------
+ QTextCodec(CFStringEncoding e) : encoding(e) { }
const char* name() const;
int mibEnum() const;
@@ -96,16 +50,16 @@ public:
QString toUnicode(const QByteArray &, int) const;
QString toUnicode(const char *) const;
-// private ---------------------------------------------------------------------
-
private:
-
- // data members ------------------------------------------------------------
-
CFStringEncoding encoding;
+};
-}; // class QTextCodec =========================================================
-
-#endif // USING_BORROWED_QSTRING
+class QTextDecoder {
+public:
+ QTextDecoder(const QTextCodec *c) : textCodec(*c) { }
+ QString toUnicode(const char *chs, int len) { return textCodec.toUnicode(chs, len); }
+private:
+ QTextCodec textCodec;
+};
#endif
diff --git a/WebCore/kwq/KWQTextCodec.mm b/WebCore/kwq/KWQTextCodec.mm
index 2438eb3..a65e7f7 100644
--- a/WebCore/kwq/KWQTextCodec.mm
+++ b/WebCore/kwq/KWQTextCodec.mm
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2001 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2001, 2002 Apple Computer, Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -23,15 +23,11 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// FIXME: obviously many functions here can be made inline
-
#import <qtextcodec.h>
+
#import <kwqdebug.h>
#import <KWQCharsets.h>
-// USING_BORROWED_QSTRING ======================================================
-#ifndef USING_BORROWED_QSTRING
-
static CFMutableDictionaryRef encodingToCodec = NULL;
static QTextCodec *codecForCFStringEncoding(CFStringEncoding encoding)
@@ -40,63 +36,31 @@ static QTextCodec *codecForCFStringEncoding(CFStringEncoding encoding)
QTextCodec *codec;
if (encodingToCodec == NULL) {
- encodingToCodec = CFDictionaryCreateMutable(NULL, 0, NULL, NULL);
+ encodingToCodec = CFDictionaryCreateMutable(NULL, 0, NULL, NULL);
}
if (CFDictionaryGetValueIfPresent(encodingToCodec, (void *)encoding, &value)) {
return (QTextCodec *)value;
} else {
codec = new QTextCodec(encoding);
- CFDictionarySetValue(encodingToCodec, (void *)encoding, (void *)codec);
+ CFDictionarySetValue(encodingToCodec, (void *)encoding, codec);
return codec;
}
}
-
-
-
-
-// class QTextDecoder ==========================================================
-
-// constructors, copy constructors, and destructors ----------------------------
-
-QTextDecoder::QTextDecoder(const QTextCodec *tc)
-{
- textCodec = tc;
-}
-
-QTextDecoder::~QTextDecoder()
-{
- // do nothing
-}
-
-// member functions --------------------------------------------------------
-
-QString QTextDecoder::toUnicode(const char *chs, int len)
-{
- return textCodec->toUnicode(chs, len);
-}
-
-
-// class QTextCodec ============================================================
-
-// static member functions -----------------------------------------------------
-
QTextCodec *QTextCodec::codecForMib(int mib)
{
CFStringEncoding encoding;
encoding = KWQCFStringEncodingFromMIB(mib);
- // FIXME: This cast to CFStringEncoding is a workaround for Radar 2912404.
- if (encoding == (CFStringEncoding) kCFStringEncodingInvalidId) {
+ if (encoding == kCFStringEncodingInvalidId) {
return NULL;
} else {
return codecForCFStringEncoding(encoding);
}
}
-
QTextCodec *QTextCodec::codecForName(const char *name, int accuracy)
{
CFStringRef cfname;
@@ -107,8 +71,7 @@ QTextCodec *QTextCodec::codecForName(const char *name, int accuracy)
encoding = KWQCFStringEncodingFromIANACharsetName(cfname);
CFRelease(cfname);
- // FIXME: This cast to CFStringEncoding is a workaround for Radar 2912404.
- if (encoding == (CFStringEncoding) kCFStringEncodingInvalidId) {
+ if (encoding == kCFStringEncodingInvalidId) {
return NULL;
} else {
return codecForCFStringEncoding(encoding);
@@ -120,23 +83,9 @@ QTextCodec *QTextCodec::codecForLocale()
return codecForCFStringEncoding(CFStringGetSystemEncoding());
}
-// constructors, copy constructors, and destructors ----------------------------
-
-QTextCodec::QTextCodec(CFStringEncoding e)
-{
- encoding = e;
-}
-
-QTextCodec::~QTextCodec()
-{
- // do nothing
-}
-
-// member functions --------------------------------------------------------
-
-const char* QTextCodec::name() const
+const char *QTextCodec::name() const
{
- return QString::fromCFString(KWQCFStringEncodingToIANACharsetName(encoding)).latin1();
+ return [(NSString *)KWQCFStringEncodingToIANACharsetName(encoding) cString];
}
int QTextCodec::mibEnum() const
@@ -146,13 +95,11 @@ int QTextCodec::mibEnum() const
QTextDecoder *QTextCodec::makeDecoder() const
{
- // FIXME: will this leak or do clients dispose of the object?
return new QTextDecoder(this);
}
QCString QTextCodec::fromUnicode(const QString &qcs) const
{
- // FIXME: is there a more efficient way to do this?
return QCString(qcs.latin1());
}
@@ -170,34 +117,3 @@ QString QTextCodec::toUnicode(const char *chs) const
{
return QString::fromStringWithEncoding(chs, -1, encoding);
}
-
-#else // USING_BORROWED_QSTRING
-
-QTextCodec *QTextCodec::codecForMib(int)
-{
- // FIXME: danger Will Robinson!!!
- _logNotYetImplemented();
- return NULL;
-}
-
-QTextCodec *QTextCodec::codecForName(const char *, int)
-{
- // FIXME: danger Will Robinson!!!
- _logNotYetImplemented();
- return NULL;
-}
-
-QTextCodec *QTextCodec::codecForLocale()
-{
- // FIXME: danger Will Robinson!!!
- _logNotYetImplemented();
- return NULL;
-}
-
-QCString QTextCodec::fromUnicode(const QString &qcs) const
-{
- // FIXME: is there a more efficient way to do this?
- return QCString(qcs.latin1());
-}
-
-#endif // USING_BORROWED_QSTRING
diff --git a/WebCore/kwq/KWQValueListImpl.mm b/WebCore/kwq/KWQValueListImpl.mm
index bac1f62..c3696c3 100644
--- a/WebCore/kwq/KWQValueListImpl.mm
+++ b/WebCore/kwq/KWQValueListImpl.mm
@@ -25,8 +25,6 @@
#import <KWQValueListImpl.h>
-#ifndef USING_BORROWED_QVALUELIST
-
#import <stdlib.h>
KWQValueListNodeImpl::KWQValueListNodeImpl() :
@@ -113,7 +111,6 @@ public:
uint refCount;
};
-
KWQValueListImpl::KWQValueListPrivate::KWQValueListPrivate(void (*deleteFunc)(KWQValueListNodeImpl *),
KWQValueListNodeImpl *(*copyFunc)(KWQValueListNodeImpl *)) :
head(NULL),
@@ -173,8 +170,6 @@ void KWQValueListImpl::KWQValueListPrivate::deleteList(KWQValueListNodeImpl *l)
}
}
-
-
KWQValueListImpl::KWQValueListImpl(void (*deleteFunc)(KWQValueListNodeImpl *), KWQValueListNodeImpl *(*copyFunc)(KWQValueListNodeImpl *)) :
d(new KWQValueListPrivate(deleteFunc, copyFunc))
{
@@ -410,7 +405,7 @@ KWQValueListNodeImpl *KWQValueListImpl::nodeAt(uint index) const
KWQValueListImpl& KWQValueListImpl::operator=(const KWQValueListImpl &other)
{
KWQValueListImpl tmp(other);
- KWQRefPtr<KWQValueListImpl::KWQValueListPrivate> tmpD = tmp.d;
+ KWQRefPtr<KWQValueListPrivate> tmpD = tmp.d;
tmp.d = d;
d = tmpD;
@@ -421,8 +416,6 @@ KWQValueListImpl& KWQValueListImpl::operator=(const KWQValueListImpl &other)
void KWQValueListImpl::copyOnWrite()
{
if (d->refCount > 1) {
- d = KWQRefPtr<KWQValueListImpl::KWQValueListPrivate>(new KWQValueListPrivate(*d));
+ d = KWQRefPtr<KWQValueListPrivate>(new KWQValueListPrivate(*d));
}
}
-
-#endif
diff --git a/WebCore/kwq/KWQVectorImpl.h b/WebCore/kwq/KWQVectorImpl.h
index 8bf5d5b..2a309a2 100644
--- a/WebCore/kwq/KWQVectorImpl.h
+++ b/WebCore/kwq/KWQVectorImpl.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2001 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2001, 2002 Apple Computer, Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -26,19 +26,18 @@
#ifndef KWQ_VECTOR_IMPL_H
#define KWQ_VECTOR_IMPL_H
-#include <config.h>
#include <KWQDef.h>
-#ifndef USING_BORROWED_QVECTOR
-
class KWQVectorImpl
{
public:
KWQVectorImpl(void (*deleteFunc)(void *));
KWQVectorImpl(uint size, void (*deleteFunc)(void *));
- KWQVectorImpl(const KWQVectorImpl &vi);
~KWQVectorImpl();
+ KWQVectorImpl(const KWQVectorImpl &vi);
+ KWQVectorImpl &assign(KWQVectorImpl &vi, bool delItems);
+
void clear(bool delItems);
bool isEmpty() const;
uint count() const;
@@ -48,16 +47,14 @@ class KWQVectorImpl
bool insert(uint n, const void *item, bool delItems);
void *at(int n) const;
void **data();
- KWQVectorImpl &assign (KWQVectorImpl &vi, bool delItems);
private:
- void KWQVectorImpl::swap(KWQVectorImpl &di);
+ KWQVectorImpl &operator=(const KWQVectorImpl&);
+
+ void swap(KWQVectorImpl &di);
class KWQVectorPrivate;
KWQVectorPrivate *d;
};
-
-#endif
-
#endif
diff --git a/WebCore/kwq/make-charset-table.pl b/WebCore/kwq/make-charset-table.pl
index 4b5a7be..b2af6d6 100755
--- a/WebCore/kwq/make-charset-table.pl
+++ b/WebCore/kwq/make-charset-table.pl
@@ -13,8 +13,7 @@ my %used_mac_encodings;
my $already_wrote_one = 0;
-# FIXME: This cast to CFStringEncoding is a workaround for Radar 2912404.
-my $invalid_encoding = "((CFStringEncoding)kCFStringEncodingInvalidId)";
+my $invalid_encoding = "kCFStringEncodingInvalidId";
sub emit_prefix
{
diff --git a/WebCore/kwq/make-mac-encodings.c b/WebCore/kwq/make-mac-encodings.c
index 68103b8..1c421f0 100644
--- a/WebCore/kwq/make-mac-encodings.c
+++ b/WebCore/kwq/make-mac-encodings.c
@@ -1,3 +1,28 @@
+/*
+ * Copyright (C) 2001, 2002 Apple Computer, Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
#include <CoreFoundation/CoreFoundation.h>
static void
@@ -23,21 +48,28 @@ main (int argc, char **argv)
output = fopen (argv[1], "w");
if (output == NULL) {
- printf ("Cannot open file \"%s\"\n", argv[1]);
+ printf("Cannot open file \"%s\"\n", argv[1]);
exit(1);
}
all_encodings = CFStringGetListOfAvailableEncodings();
- // FIXME: This cast to CFStringEncoding is a workaround for Radar 2912404.
- for (p = all_encodings; *p != (CFStringEncoding) kCFStringEncodingInvalidId; p++) {
+ for (p = all_encodings; *p != kCFStringEncodingInvalidId; p++) {
name = CFStringConvertEncodingToIANACharSetName(*p);
/* All IANA encoding names must be US-ASCII */
if (name != NULL) {
CFStringGetCString(name, cname, 2048, kCFStringEncodingASCII);
fprintf(output, "%ld:%s\n", *p, cname);
} else {
- printf("Warning: encoding %ld does not have an IANA chararacter set name\n", *p);
+ switch (*p) {
+ case 41:
+ case kCFStringEncodingShiftJIS_X0213_00:
+ case kCFStringEncodingGB_18030_2000:
+ case 0xBFF:
+ break;
+ default:
+ printf("Warning: encoding %ld does not have an IANA chararacter set name\n", *p);
+ }
}
}
return 0;
diff --git a/WebCore/kwq/qt/qfile.h b/WebCore/kwq/qt/qfile.h
index 30fc90e..3fa5b6e 100644
--- a/WebCore/kwq/qt/qfile.h
+++ b/WebCore/kwq/qt/qfile.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2001 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2001, 2002 Apple Computer, Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -26,27 +26,14 @@
#ifndef QFILE_H_
#define QFILE_H_
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
#include <KWQDef.h>
-// USING_BORROWED_QFILE =======================================================
-
-#ifdef USING_BORROWED_QFILE
-
-#include <_qfile.h>
-
-#else // !USING_BORROWED_QFILE
-
#include <qstring.h>
#include <qiodevice.h>
class QFile
{
public:
- QFile();
QFile(const QString &);
~QFile();
@@ -59,17 +46,11 @@ public:
static bool exists(const QString &path);
private:
- // no copying or assignment
- // note that these are "standard" (no pendantic stuff needed)
QFile(const QFile &);
QFile &operator=(const QFile &);
- class KWQFilePrivate;
-
- KWQFilePrivate *d;
+ char *name;
+ int fd;
};
-
-#endif // USING_BORROWED_QFILE
-
#endif // QFILE_H_
diff --git a/WebCore/kwq/qt/qregexp.h b/WebCore/kwq/qt/qregexp.h
index c8bedad..2857973 100644
--- a/WebCore/kwq/qt/qregexp.h
+++ b/WebCore/kwq/qt/qregexp.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2001 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2001, 2002 Apple Computer, Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -26,43 +26,26 @@
#ifndef QREGEXP_H_
#define QREGEXP_H_
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-// USING_BORROWED_QREGEXP ======================================================
-
-#ifdef USING_BORROWED_QREGEXP
-#include <_qregexp.h>
-#else
-
#include <qstring.h>
#include <KWQRefPtr.h>
-// class QRegExp ===============================================================
-
class QRegExp {
public:
-
QRegExp();
- QRegExp(const QString &, bool caseSensitive = TRUE, bool glob = FALSE);
+ QRegExp(const QString &, bool caseSensitive = false, bool glob = false);
QRegExp(const char *);
- QRegExp(const QRegExp &);
~QRegExp();
+ QRegExp(const QRegExp &);
QRegExp &operator=(const QRegExp &);
QString pattern() const;
- int match (const QString &, int startFrom = 0, int *matchLength = 0,
- bool treatStartAsStartOfInput = TRUE) const;
+ int match(const QString &, int startFrom = 0, int *matchLength = 0, bool treatStartAsStartOfInput = true) const;
private:
- class KWQRegExpPrivate;
-
+ class KWQRegExpPrivate;
KWQRefPtr<KWQRegExpPrivate> d;
-}; // class QRegExp ============================================================
-
-#endif // USING_BORROWED_QREGEXP
+};
#endif
diff --git a/WebCore/kwq/qt/qtextcodec.h b/WebCore/kwq/qt/qtextcodec.h
index 3eff4d9..c122c35 100644
--- a/WebCore/kwq/qt/qtextcodec.h
+++ b/WebCore/kwq/qt/qtextcodec.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2001 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2001, 2002 Apple Computer, Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -26,64 +26,18 @@
#ifndef QTEXTCODEC_H_
#define QTEXTCODEC_H_
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-// USING_BORROWED_QSTRING ======================================================
-#ifdef USING_BORROWED_QSTRING
-
-#include <_qtextcodec.h>
-
-#else
-
-#include "qstring.h"
-#include "qcstring.h"
-
-class QTextCodec;
-
-// class QTextDecoder ==========================================================
-
-class QTextDecoder {
-public:
-
- // constructors, copy constructors, and destructors ------------------------
-
- QTextDecoder(const QTextCodec *);
- ~QTextDecoder();
-
- // member functions --------------------------------------------------------
-
- QString toUnicode(const char *, int);
-
-// private ---------------------------------------------------------------------
-
-private:
-
- // data members ------------------------------------------------------------
-
- const QTextCodec *textCodec;
-
-}; // class QTextDecoder =======================================================
+#include <qstring.h>
+#include <qcstring.h>
-
-// class QTextCodec ============================================================
+class QTextDecoder;
class QTextCodec {
public:
-
- // static member functions -------------------------------------------------
-
static QTextCodec *codecForMib(int);
static QTextCodec *codecForName(const char *, int accuracy=0);
static QTextCodec *codecForLocale();
- // constructors, copy constructors, and destructors ------------------------
-
- QTextCodec(CFStringEncoding);
- ~QTextCodec();
-
- // member functions --------------------------------------------------------
+ QTextCodec(CFStringEncoding e) : encoding(e) { }
const char* name() const;
int mibEnum() const;
@@ -96,16 +50,16 @@ public:
QString toUnicode(const QByteArray &, int) const;
QString toUnicode(const char *) const;
-// private ---------------------------------------------------------------------
-
private:
-
- // data members ------------------------------------------------------------
-
CFStringEncoding encoding;
+};
-}; // class QTextCodec =========================================================
-
-#endif // USING_BORROWED_QSTRING
+class QTextDecoder {
+public:
+ QTextDecoder(const QTextCodec *c) : textCodec(*c) { }
+ QString toUnicode(const char *chs, int len) { return textCodec.toUnicode(chs, len); }
+private:
+ QTextCodec textCodec;
+};
#endif
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list