Commit 9156f8e5 authored by mjs's avatar mjs

Rubber stamped by Hyatt.

        - move kwq/KWQString.mm to platform/QString.cpp, split out nonportable parts, speculative
        port of one remaining nonportable bit to windows.

        * ForwardingHeaders/qstring.h:
        * WebCore+SVG/KDOMSettings.h:
        * WebCore+SVG/kdom.h:
        * WebCore.xcodeproj/project.pbxproj:
        * css/cssparser.h:
        * css/cssstyleselector.cpp:
        * kcanvas/KCanvasResources.h:
        * kcanvas/KCanvasTreeDebug.h:
        * khtml/ecma/kjs_window.h:
        * khtml/editing/html_interchange.cpp:
        * khtml/editing/visible_position.h:
        * khtml/editing/visible_text.h:
        * khtml/editing/visible_units.cpp:
        * khtml/html/FormDataList.h:
        * khtml/html/html_objectimpl.cpp:
        * khtml/html/htmltokenizer.h:
        * khtml/misc/decoder.h:
        * khtml/misc/formdata.h:
        * khtml/xbl/xbl_protohandler.cpp:
        * khtml/xml/dom_position.cpp:
        * khtml/xsl/xslt_processorimpl.h:
        * ksvg2/svg/SVGHelper.h:
        * ksvg2/svg/SVGPreserveAspectRatioImpl.cpp:
        * ksvg2/svg/SVGStyleElementImpl.cpp:
        * ksvg2/svg/SVGURIReferenceImpl.h:
        * ksvg2/svg/svgpathparser.cpp:
        * kwq/KWQAccObjectCache.mm:
        * kwq/KWQBuffer.h:
        * kwq/KWQEvent.h:
        * kwq/KWQFont.mm:
        * kwq/KWQFontFamily.h:
        * kwq/KWQFontMetrics.h:
        * kwq/KWQKConfigBase.h:
        * kwq/KWQKDebug.h:
        * kwq/KWQKHTMLSettings.h:
        * kwq/KWQKJobClasses.h:
        * kwq/KWQKJobClasses.mm:
        * kwq/KWQKLocale.mm:
        * kwq/KWQKSSLKeyGen.mm:
        * kwq/KWQKURL.h:
        * kwq/KWQLineEdit.h:
        * kwq/KWQRegExp.h:
        * kwq/KWQRenderTreeDebug.h:
        * kwq/KWQString.h: Removed.
        * kwq/KWQString.mm: Removed.
        * kwq/KWQStringList.h:
        * kwq/KWQTextCodec.h:
        * kwq/KWQTextStream.h:
        * kwq/KWQTextUtilities.mm:
        * kwq/WebCoreScriptDebugger.mm:
        * loader/Cache.h:
        * platform/Color.cpp:
        * platform/Color.h:
        * platform/QString.cpp: Added.
        (allocateHandle):
        (KWQStringData::KWQStringData):
        (QString::QString):
        (QString::insert):
        (QString::detach):
        (QString::remove):
        (QString::setLength):
        (QString::fill):
        (initializeHandleNodeBlock):
        (allocateNode):
        (freeHandle):
        * platform/QString.h: Added.
        * platform/SegmentedString.h:
        * platform/StringImpl.h:
        * platform/mac/Image.mm:
        * platform/mac/QString.mm: Added.
        (QString::setBufferFromCFString):
        (QString::fromCFString):
        (QString::fromNSString):
        (QString::getNSString):
        (QString::utf8):
        (QString::fromUtf8):
        * rendering/bidi.h:
        * rendering/break_lines.cpp:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@12655 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 36aefb65
2006-02-07 Maciej Stachowiak <mjs@apple.com>
Rubber stamped by Hyatt.
- move kwq/KWQString.mm to platform/QString.cpp, split out nonportable parts, speculative
port of one remaining nonportable bit to windows.
* ForwardingHeaders/qstring.h:
* WebCore+SVG/KDOMSettings.h:
* WebCore+SVG/kdom.h:
* WebCore.xcodeproj/project.pbxproj:
* css/cssparser.h:
* css/cssstyleselector.cpp:
* kcanvas/KCanvasResources.h:
* kcanvas/KCanvasTreeDebug.h:
* khtml/ecma/kjs_window.h:
* khtml/editing/html_interchange.cpp:
* khtml/editing/visible_position.h:
* khtml/editing/visible_text.h:
* khtml/editing/visible_units.cpp:
* khtml/html/FormDataList.h:
* khtml/html/html_objectimpl.cpp:
* khtml/html/htmltokenizer.h:
* khtml/misc/decoder.h:
* khtml/misc/formdata.h:
* khtml/xbl/xbl_protohandler.cpp:
* khtml/xml/dom_position.cpp:
* khtml/xsl/xslt_processorimpl.h:
* ksvg2/svg/SVGHelper.h:
* ksvg2/svg/SVGPreserveAspectRatioImpl.cpp:
* ksvg2/svg/SVGStyleElementImpl.cpp:
* ksvg2/svg/SVGURIReferenceImpl.h:
* ksvg2/svg/svgpathparser.cpp:
* kwq/KWQAccObjectCache.mm:
* kwq/KWQBuffer.h:
* kwq/KWQEvent.h:
* kwq/KWQFont.mm:
* kwq/KWQFontFamily.h:
* kwq/KWQFontMetrics.h:
* kwq/KWQKConfigBase.h:
* kwq/KWQKDebug.h:
* kwq/KWQKHTMLSettings.h:
* kwq/KWQKJobClasses.h:
* kwq/KWQKJobClasses.mm:
* kwq/KWQKLocale.mm:
* kwq/KWQKSSLKeyGen.mm:
* kwq/KWQKURL.h:
* kwq/KWQLineEdit.h:
* kwq/KWQRegExp.h:
* kwq/KWQRenderTreeDebug.h:
* kwq/KWQString.h: Removed.
* kwq/KWQString.mm: Removed.
* kwq/KWQStringList.h:
* kwq/KWQTextCodec.h:
* kwq/KWQTextStream.h:
* kwq/KWQTextUtilities.mm:
* kwq/WebCoreScriptDebugger.mm:
* loader/Cache.h:
* platform/Color.cpp:
* platform/Color.h:
* platform/QString.cpp: Added.
(allocateHandle):
(KWQStringData::KWQStringData):
(QString::QString):
(QString::insert):
(QString::detach):
(QString::remove):
(QString::setLength):
(QString::fill):
(initializeHandleNodeBlock):
(allocateNode):
(freeHandle):
* platform/QString.h: Added.
* platform/SegmentedString.h:
* platform/StringImpl.h:
* platform/mac/Image.mm:
* platform/mac/QString.mm: Added.
(QString::setBufferFromCFString):
(QString::fromCFString):
(QString::fromNSString):
(QString::getNSString):
(QString::utf8):
(QString::fromUtf8):
* rendering/bidi.h:
* rendering/break_lines.cpp:
2006-02-07 Maciej Stachowiak <mjs@apple.com>
Reviewed by Adele.
......
#include "KWQString.h"
#include "QString.h"
......@@ -25,7 +25,7 @@
#if SVG_SUPPORT
#include "Color.h"
#include <qstring.h>
#include <QString.h>
class KConfig;
struct KPerDomainSettings;
......
......@@ -27,7 +27,7 @@
#include <kdebug.h>
#include <qstring.h>
#include <QString.h>
#include "PlatformString.h"
......
This diff is collapsed.
......@@ -22,7 +22,7 @@
#ifndef _CSS_cssparser_h_
#define _CSS_cssparser_h_
#include <qstring.h>
#include <QString.h>
#include "Color.h"
#include "String.h"
#include "AtomicString.h"
......
......@@ -51,7 +51,7 @@
#include <assert.h>
#include <kurl.h>
#include <kxmlcore/HashMap.h>
#include <qstring.h>
#include <QString.h>
#include <qvaluelist.h>
#include <stdlib.h>
......
......@@ -24,7 +24,7 @@
#define KCanvasResources_H
#if SVG_SUPPORT
#include <qstring.h>
#include <QString.h>
#include <q3valuelist.h>
#include <kcanvas/RenderPath.h>
......
......@@ -23,7 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <qstring.h>
#include <QString.h>
#include <qtextstream.h>
#include <q3valuelist.h>
......
......@@ -26,7 +26,7 @@
#include <kxmlcore/HashMap.h>
#include <qguardedptr.h>
#include <qobject.h>
#include <qstring.h>
#include <QString.h>
namespace WebCore {
class AtomicString;
......
......@@ -26,7 +26,7 @@
#include "config.h"
#include "html_interchange.h"
#include <qstring.h>
#include <QString.h>
#include "visible_text.h"
using khtml::isCollapsibleWhitespace;
......
......@@ -26,7 +26,7 @@
#ifndef KHTML_EDITING_VISIBLE_POSITION_H
#define KHTML_EDITING_VISIBLE_POSITION_H
#include <qstring.h> // for QChar
#include <QString.h> // for QChar
#include <kxmlcore/PassRefPtr.h>
#include "xml/dom_position.h"
......
......@@ -30,7 +30,7 @@
#include "InlineTextBox.h"
#include <kxmlcore/Vector.h>
#include <qstring.h>
#include <QString.h>
namespace khtml {
......
......@@ -26,7 +26,7 @@
#include "config.h"
#include "visible_units.h"
#include <qstring.h>
#include <QString.h>
#include "htmlnames.h"
#include "htmlediting.h"
......
......@@ -27,7 +27,7 @@
#ifndef HTML_FormDataList_h
#define HTML_FormDataList_h
#include <qstring.h>
#include <QString.h>
#include <qvaluelist.h>
#include "PlatformString.h"
......
......@@ -41,7 +41,7 @@
#include "render_frames.h"
#include "render_image.h"
#include <java/kjavaappletwidget.h>
#include <qstring.h>
#include <QString.h>
#include "htmlnames.h"
namespace WebCore {
......
......@@ -35,7 +35,7 @@
#include "dom_qname.h"
#include "xml_tokenizer.h"
#include <qptrqueue.h>
#include <qstring.h>
#include <QString.h>
class HTMLParser;
......
......@@ -22,7 +22,7 @@
#ifndef KHTMLDECODER_H
#define KHTMLDECODER_H
#include <qstring.h>
#include <QString.h>
class QTextCodec;
class QTextDecoder;
......
......@@ -21,7 +21,7 @@
#ifndef KHTML_FORM_DATA_H
#define KHTML_FORM_DATA_H
#include <qstring.h>
#include <QString.h>
#include <qvaluelist.h>
class QCString;
......
......@@ -2,7 +2,7 @@
#include "config.h"
#include "qstringlist.h"
#include "qstring.h"
#include "QString.h"
#include "xbl_protohandler.h"
using DOM::DOMString;
......
......@@ -26,7 +26,7 @@
#include "config.h"
#include "dom_position.h"
#include <qstring.h>
#include <QString.h>
#include "css_computedstyle.h"
#include "css_valueimpl.h"
......
......@@ -32,7 +32,7 @@
#include <libxml/parserInternals.h>
#include <libxslt/documents.h>
#include <libxslt/transform.h>
#include <qstring.h>
#include <QString.h>
#include <kxmlcore/HashMap.h>
......
......@@ -24,7 +24,7 @@
#define KSVG_SVGHelper_H
#if SVG_SUPPORT
#include <qstring.h>
#include <QString.h>
#include <kxmlcore/RefPtr.h>
namespace KSVG
......
......@@ -22,7 +22,7 @@
#include "config.h"
#if SVG_SUPPORT
#include <qstring.h>
#include <QString.h>
#include <qstringlist.h>
#include "StringImpl.h"
......
......@@ -29,7 +29,7 @@
#include "SVGStyleElementImpl.h"
#include <qstring.h>
#include <QString.h>
using namespace KSVG;
......
......@@ -24,7 +24,7 @@
#define KSVG_SVGURIReferenceImpl_H
#if SVG_SUPPORT
#include <qstring.h>
#include <QString.h>
namespace KDOM
{
......
......@@ -20,7 +20,7 @@
#include "config.h"
#if SVG_SUPPORT
#include "svgpathparser.h"
#include <qstring.h>
#include <QString.h>
#include <math.h>
using namespace KSVG;
......
......@@ -29,7 +29,7 @@
#import "KWQAccObject.h"
#import <kxmlcore/Assertions.h>
#import "KWQFoundationExtras.h"
#import "KWQString.h"
#import "QString.h"
#import "render_object.h"
#import "WebCoreViewFactory.h"
#import "DocumentImpl.h"
......
......@@ -29,7 +29,7 @@
#include "KWQDef.h"
#include "Array.h"
#include "KWQString.h"
#include "QString.h"
#include "KWQIODevice.h"
class QBuffer {
......
......@@ -29,7 +29,7 @@
#include "KWQNamespace.h"
#include "KWQRegion.h"
#include "IntPointArray.h"
#include "KWQString.h"
#include "QString.h"
#ifdef __OBJC__
@class NSEvent;
......
......@@ -27,7 +27,7 @@
#import "KWQFont.h"
#import "KWQExceptions.h"
#import "KWQString.h"
#import "QString.h"
#import "KWQFoundationExtras.h"
#import "WebCoreTextRendererFactory.h"
......
......@@ -23,7 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "KWQString.h"
#include "QString.h"
#include "AtomicString.h"
#ifdef __OBJC__
......
......@@ -28,7 +28,7 @@
#include "IntRect.h"
#include "IntSize.h"
#include "KWQString.h"
#include "QString.h"
class QFont;
class QFontMetricsPrivate;
......
......@@ -26,7 +26,7 @@
#ifndef KCONFIG_H_
#define KCONFIG_H_
#include "KWQString.h"
#include "QString.h"
#include "KWQKHTMLSettings.h"
class QStringList;
......
......@@ -26,7 +26,7 @@
#ifndef KDEBUG_H_
#define KDEBUG_H_
#include "KWQString.h"
#include "QString.h"
#include "KWQTextStream.h"
#define k_funcinfo "[" << __FILE__ << ":" << __LINE__ << "] "
......
......@@ -26,7 +26,7 @@
#ifndef KHTML_SETTINGS_H_
#define KHTML_SETTINGS_H_
#include "KWQString.h"
#include "QString.h"
#include "KWQStringList.h"
#include "KWQFont.h"
......
......@@ -28,7 +28,7 @@
#include <kxmlcore/HashMap.h>
#include "KWQObject.h"
#include "KWQString.h"
#include "QString.h"
#include "KWQKURL.h"
#include "PlatformString.h"
......
......@@ -31,7 +31,7 @@
#import "KWQLoader.h"
#import "KWQLogging.h"
#import "KWQResourceLoader.h"
#import "KWQString.h"
#import "QString.h"
#import "PlatformString.h"
#import "formdata.h"
......
......@@ -28,7 +28,7 @@
#import "KWQExceptions.h"
#import "KWQLogging.h"
#import "KWQString.h"
#import "QString.h"
#import "WebCoreViewFactory.h"
QString inputElementAltText()
......
......@@ -27,7 +27,7 @@
#import "KWQKSSLKeyGen.h"
#import "KWQKURL.h"
#import "KWQString.h"
#import "QString.h"
#import "WebCoreKeyGenerator.h"
QStringList KSSLKeyGen::supportedKeySizes()
......
......@@ -26,7 +26,7 @@
#ifndef KURL_H_
#define KURL_H_
#include "KWQString.h"
#include "QString.h"
class QTextCodec;
......
......@@ -26,7 +26,7 @@
#ifndef QLINEEDIT_H_
#define QLINEEDIT_H_
#include "KWQString.h"
#include "QString.h"
#include "KWQWidget.h"
#include "KWQPainter.h"
......
......@@ -26,7 +26,7 @@
#ifndef QREGEXP_H_
#define QREGEXP_H_
#include "KWQString.h"
#include "QString.h"
#include <kxmlcore/RefPtr.h>
......
......@@ -25,7 +25,7 @@
#ifdef __cplusplus
#include "KWQString.h"
#include "QString.h"
#include "KWQTextStream.h"
#include "render_object.h"
......
......@@ -26,7 +26,7 @@
#ifndef QSTRINGLIST_H_
#define QSTRINGLIST_H_
#include "KWQString.h"
#include "QString.h"
#include "KWQValueList.h"
#ifdef __OBJC__
......
......@@ -27,7 +27,7 @@
#define QTEXTCODEC_H_
#include "KWQCharsets.h"
#include "KWQString.h"
#include "QString.h"
#include "KWQCString.h"
class QTextDecoder;
......
......@@ -27,7 +27,7 @@
#define QTEXTSTREAM_H_
#include "KWQIODevice.h"
#include "KWQString.h"
#include "QString.h"
class QTextStream;
......
......@@ -26,7 +26,7 @@
#include "config.h"
#import "KWQTextUtilities.h"
#import "KWQString.h"
#import "QString.h"
#import <AppKit/NSAttributedString.h>
#import <unicode/ubrk.h>
#import <unicode/ustring.h>
......
......@@ -33,7 +33,7 @@
#import <JavaScriptCore/debugger.h>
#import <JavaScriptCore/context.h>
#import "KWQString.h"
#import "QString.h"
using namespace KJS;
......
......@@ -30,7 +30,7 @@
#include "PlatformString.h"
#include <kio/global.h>
#include <qptrlist.h>
#include <qstring.h>
#include <QString.h>
class KURL;
......
......@@ -26,7 +26,7 @@
#include "config.h"
#include "Color.h"
#include "KWQString.h"
#include "QString.h"
#include <kxmlcore/Assertions.h>
// Turn off inlining to avoid warning with newer gcc.
......
......@@ -26,7 +26,7 @@
#ifndef COLOR_H_
#define COLOR_H_
#include "KWQString.h"
#include "QString.h"
#if __APPLE__
#ifdef __OBJC__
......
......@@ -428,7 +428,7 @@ public:
static QString fromUtf8(const char *, int len);
#if __APPLE__
static QString fromCFString(CFStringRef);
static QString fromNSString(NSString *);
static QString fromNSString(NSString*);
#endif
QString &operator=(char);
QString &operator=(QChar);
......
......@@ -27,7 +27,7 @@
#include "PlatformString.h"
#include <qstring.h>
#include <QString.h>
#include <qvaluelist.h>
#include <assert.h>
......
......@@ -27,7 +27,7 @@
#include "Shared.h"
#include <kxmlcore/RefPtr.h>
#include <limits.h>
#include <qstring.h>
#include <QString.h>
#if __APPLE__
#include <CoreFoundation/CoreFoundation.h>
......
......@@ -30,7 +30,7 @@
#import "FloatRect.h"
#import "Image.h"
#import "PDFDocumentImage.h"
#import <qstring.h>
#import <QString.h>
#import "WebCoreImageRendererFactory.h"
......
/*
* Copyright (C) 2005, 2006 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 "config.h"
#include "QString.h"
#import <kxmlcore/Assertions.h>
#import <Foundation/Foundation.h>
#import "KWQTextCodec.h"
void QString::setBufferFromCFString(CFStringRef cfs)
{
if (!cfs) {
return;
}
CFIndex size = CFStringGetLength(cfs);
UniChar fixedSizeBuffer[1024];
UniChar *buffer;
if (size > (CFIndex)(sizeof(fixedSizeBuffer) / sizeof(UniChar))) {
buffer = (UniChar *)fastMalloc(size * sizeof(UniChar));
} else {
buffer = fixedSizeBuffer;
}
CFStringGetCharacters(cfs, CFRangeMake (0, size), buffer);
setUnicode((const QChar *)buffer, (uint)size);
if (buffer != fixedSizeBuffer) {
fastFree(buffer);
}
}
QString QString::fromCFString(CFStringRef cfs)
{
QString qs;
qs.setBufferFromCFString(cfs);
return qs;
}
QString QString::fromNSString(NSString *nss)
{
QString qs;
qs.setBufferFromCFString((CFStringRef)nss);
return qs;
}
NSString *QString::getNSString() const
{
// The Cocoa calls in this method don't need exceptions blocked
// because they are simple NSString calls that can't throw.
int length = dataHandle[0]->_length;
if (dataHandle[0]->_isUnicodeValid) {
return [NSString stringWithCharacters:(const unichar *)unicode() length:length];
}
if (dataHandle[0]->_isAsciiValid) {