WebCore:
authordarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 10 May 2006 05:26:26 +0000 (05:26 +0000)
committerdarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 10 May 2006 05:26:26 +0000 (05:26 +0000)
        - fix build

        * rendering/render_style.cpp: (WebCore::RenderStyle::getPseudoStyle):
        Fix a typo.

        - attempt to fix Windows build

        * css/maketokenizer: Use UChar instead of unsigned short.
        * platform/win/FontWin.cpp:
        (WebCore::getFontData): Removed cast to QChar.
        (WebCore::hackishExtentForString): Use UChar.
        (WebCore::Font::floatWidth): Use UChar.
        (WebCore::Font::drawText): Use UChar.
        (WebCore::Font::drawHighlightForText): Use UChar.
        (WebCore::Font::selectionRectForText): Use UChar.
        (WebCore::Font::checkSelectionPoint): Use UChar.
        * platform/win/KeyEventWin.cpp:
        (WebCore::singleCharacterString): Added.
        (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent): Use above function.
        * platform/win/TemporaryLinkStubs.cpp:
        (WebCore::findNextSentenceFromIndex): Use UChar.
        (WebCore::findSentenceBoundary): Use UChar.
        (WebCore::findNextWordFromIndex): Use UChar.
        (WebCore::findWordBoundary): Use UChar.
        * platform/win/TransferJobWin.cpp:
        (WebCore::TransferJob::start): Use a different String constructor.
        * rendering/RenderTable.h: Added an include of DeprecatedArray.h.
        * rendering/RenderText.cpp: Added an include of DeprecatedString.h.
        * rendering/render_list.h: Ditto.

WebKitWin:

        - attempt to fix the Windows build

        * WebView.cpp: (WebKit::WebViewWndProc): Convert to String explicitly via UChar instead of
        implicitly via QChar.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@14274 268f45cc-cd09-0410-ab3c-d52691b4dbfc

12 files changed:
WebCore/ChangeLog
WebCore/css/maketokenizer
WebCore/platform/win/FontWin.cpp
WebCore/platform/win/KeyEventWin.cpp
WebCore/platform/win/TemporaryLinkStubs.cpp
WebCore/platform/win/TransferJobWin.cpp
WebCore/rendering/RenderTable.h
WebCore/rendering/RenderText.cpp
WebCore/rendering/render_list.h
WebCore/rendering/render_style.cpp
WebKitWin/ChangeLog
WebKitWin/WebView.cpp

index f87fc709990641415f49aba362f84d6fc22f5714..1b3cf7ba7b4709a4dc0ee806dd9d72ffdb18d6ff 100644 (file)
@@ -1,3 +1,35 @@
+2006-05-09  Darin Adler  <darin@apple.com>
+
+        - fix build
+
+        * rendering/render_style.cpp: (WebCore::RenderStyle::getPseudoStyle):
+        Fix a typo.
+
+        - attempt to fix Windows build
+
+        * css/maketokenizer: Use UChar instead of unsigned short.
+        * platform/win/FontWin.cpp:
+        (WebCore::getFontData): Removed cast to QChar.
+        (WebCore::hackishExtentForString): Use UChar.
+        (WebCore::Font::floatWidth): Use UChar.
+        (WebCore::Font::drawText): Use UChar.
+        (WebCore::Font::drawHighlightForText): Use UChar.
+        (WebCore::Font::selectionRectForText): Use UChar.
+        (WebCore::Font::checkSelectionPoint): Use UChar.
+        * platform/win/KeyEventWin.cpp:
+        (WebCore::singleCharacterString): Added.
+        (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent): Use above function.
+        * platform/win/TemporaryLinkStubs.cpp:
+        (WebCore::findNextSentenceFromIndex): Use UChar.
+        (WebCore::findSentenceBoundary): Use UChar.
+        (WebCore::findNextWordFromIndex): Use UChar.
+        (WebCore::findWordBoundary): Use UChar.
+        * platform/win/TransferJobWin.cpp:
+        (WebCore::TransferJob::start): Use a different String constructor.
+        * rendering/RenderTable.h: Added an include of DeprecatedArray.h.
+        * rendering/RenderText.cpp: Added an include of DeprecatedString.h.
+        * rendering/render_list.h: Ditto.
+
 2006-05-09  Darin Adler  <darin@apple.com>
 
         Rubber stamped by Hyatt.
index 7a39e217ad642411789a5013caab6a88dcf64a8d..0657d3e12135df34af988a65f4da543cdc19e892 100644 (file)
@@ -59,7 +59,7 @@ while (<>) {
 
 print;
 while (<>) {
-    s/char/unsigned short/;
+    s/char/UChar/;
     print;
     last if /yy_act/;
 }
index 085cdce2ac7e57d19b36d9978a715027fab64f7e..2dcb9acd005e94cd70be9ce3f78d845f6452d5eb 100644 (file)
@@ -90,7 +90,7 @@ FontData* getFontData(const FontDescription& fontDescription, const AtomicString
     RestoreDC(dc, -1);
     ReleaseDC(0, dc);
     dc = 0;
-    if (!equalIgnoringCase(fontFace, String((QChar*)name, resultLength))) {
+    if (!equalIgnoringCase(fontFace, String(name, resultLength))) {
         DeleteObject(font);
         return 0;
     }
@@ -154,7 +154,7 @@ FontData* FontFallbackList::primaryFont(const FontDescription& fontDescription)
     return defaultFont;
 }
 
-static IntSize hackishExtentForString(HDC dc, FontData* font, const QChar* str, int slen, int pos, int len, int tabWidth, int xpos)
+static IntSize hackishExtentForString(HDC dc, FontData* font, const UChar* str, int slen, int pos, int len, int tabWidth, int xpos)
 {
     SaveDC(dc);
 
@@ -176,7 +176,7 @@ static IntSize hackishExtentForString(HDC dc, FontData* font, const QChar* str,
     return s;
 }
 
-float Font::floatWidth(const QChar* str, int slen, int pos, int len,
+float Font::floatWidth(const UChar* str, int slen, int pos, int len,
                        int tabWidth, int xpos, bool runRounding) const
 {
     FontData* font = m_fontList->primaryFont(fontDescription());
@@ -202,7 +202,7 @@ static void convertRange(int from, int to, int len, int& offset, int& length)
 }
 
 void Font::drawText(GraphicsContext* context, const IntPoint& point, int tabWidth, int xpos,
-                    const QChar* str, int len, int from, int to,
+                    const UChar* str, int len, int from, int to,
                     int toAdd, TextDirection d, bool visuallyOrdered) const
 {
     FontData* font = m_fontList->primaryFont(fontDescription());
@@ -232,7 +232,7 @@ void Font::drawText(GraphicsContext* context, const IntPoint& point, int tabWidt
 }
 
 void Font::drawHighlightForText(GraphicsContext* context, const IntPoint& point, int h, int tabWidth, int xpos,
-                                const QChar* str, int len, int from, int to, int toAdd,
+                                const UChar* str, int len, int from, int to, int toAdd,
                                 TextDirection d, bool visuallyOrdered, const Color& backgroundColor) const
 {
     if (!backgroundColor.isValid())
@@ -253,7 +253,7 @@ void Font::drawHighlightForText(GraphicsContext* context, const IntPoint& point,
     const_cast<GraphicsContext*>(context)->fillRect(IntRect(point, runSize), backgroundColor);
 }
 
-IntRect Font::selectionRectForText(const IntPoint& point, int h, int tabWidth, int xpos, const QChar* str, int slen,
+IntRect Font::selectionRectForText(const IntPoint& point, int h, int tabWidth, int xpos, const UChar* str, int slen,
                                    int pos, int len, int toAdd, bool rtl, bool visuallyOrdered, int from, int to) const
 {
     FontData* font = m_fontList->primaryFont(fontDescription());
@@ -269,7 +269,7 @@ IntRect Font::selectionRectForText(const IntPoint& point, int h, int tabWidth, i
     return IntRect(point, runSize);
 }
 
-int Font::checkSelectionPoint(const QChar* str, int slen, int offset, int len, int toAdd, int tabWidth, int xpos, int x,
+int Font::checkSelectionPoint(const UChar* str, int slen, int offset, int len, int toAdd, int tabWidth, int xpos, int x,
                               TextDirection, bool visuallyOrdered, bool includePartialGlyphs) const
 {
     FontData* font = m_fontList->primaryFont(fontDescription());
index 95761ad10fd01693d3184eef41c3c7195788c55d..0dd90f5e99339abd1f295d083c60468ce9b363d6 100644 (file)
@@ -134,9 +134,11 @@ static String keyIdentifierForWindowsKeyCode(short keyCode)
     }
 }
 
+static String singleCharacterString(UChar c) { return String(&c, 1); }
+
 PlatformKeyboardEvent::PlatformKeyboardEvent(HWND hWnd, WPARAM wParam, LPARAM lParam)
-    : m_text(QChar(wParam))
-    , m_unmodifiedText(QChar(wParam))
+    : m_text(singleCharacterString(wParam))
+    , m_unmodifiedText(singleCharacterString(wParam))
     , m_keyIdentifier(keyIdentifierForWindowsKeyCode(wParam))
     , m_isKeyUp((lParam & NEW_RELEASE_STATE_MASK))
     , m_autoRepeat(lParam & REPEAT_COUNT_MASK)
@@ -148,7 +150,7 @@ PlatformKeyboardEvent::PlatformKeyboardEvent(HWND hWnd, WPARAM wParam, LPARAM lP
     , m_metaKey(lParam & ALT_KEY_DOWN_MASK) // FIXME: Is this right?
 {
     if (!m_shiftKey)
-        m_text = String(QChar(tolower(wParam)));
+        m_text = String(singleCharacterString(tolower(wParam)));
 }
 
 }
index da53a136693fb5c8683070baeee5f271880286c4..077fc04cf79a0fd6bed565bb672c113202558ac1 100644 (file)
@@ -156,9 +156,9 @@ PlatformMouseEvent::PlatformMouseEvent() { notImplemented(); }
 bool PlatformMouseEvent::isMouseButtonDown(MouseButton) { notImplemented(); return false; }
 String WebCore::searchableIndexIntroduction() { notImplemented(); return String(); }
 
-int WebCore::findNextSentenceFromIndex(QChar const*,int,int,bool) { notImplemented(); return 0; }
-void WebCore::findSentenceBoundary(QChar const*,int,int,int*,int*) { notImplemented(); }
-int WebCore::findNextWordFromIndex(QChar const*,int,int,bool) { notImplemented(); return 0; }
+int WebCore::findNextSentenceFromIndex(UChar const*,int,int,bool) { notImplemented(); return 0; }
+void WebCore::findSentenceBoundary(UChar const*,int,int,int*,int*) { notImplemented(); }
+int WebCore::findNextWordFromIndex(UChar const*,int,int,bool) { notImplemented(); return 0; }
 
 DeprecatedArray<char> KWQServeSynchronousRequest(Loader*,DocLoader*,TransferJob*,KURL&,DeprecatedString&) { notImplemented(); return 0; }
 
@@ -216,7 +216,7 @@ String WebCore::inputElementAltText() { return DeprecatedString(); }
 String WebCore::resetButtonDefaultLabel() { return "Reset"; }
 String WebCore::defaultLanguage() { return "en"; }
 
-void WebCore::findWordBoundary(QChar const* str,int len,int position,int* start, int* end) {*start=position; *end=position; }
+void WebCore::findWordBoundary(UChar const* str,int len,int position,int* start, int* end) {*start=position; *end=position; }
 
 void WebCore::setCookies(KURL const&,KURL const&,String const&) { }
 String WebCore::cookies(KURL const&) { return String(); }
index 548c950d0647083180719a5131dd1fded7569fa0..ffafdb9e400d621c68ee8613f26a6be2e6e4260d 100644 (file)
@@ -202,8 +202,8 @@ bool TransferJob::start(DocLoader* docLoader)
     } else {
         static HINTERNET internetHandle = 0;
         if (!internetHandle) {
-            String userAgentStr = docLoader->frame()->userAgent() + QChar('\0');
-            LPCWSTR userAgent = reinterpret_cast<const WCHAR*>(userAgentStr.unicode());
+            String userAgentStr = docLoader->frame()->userAgent() + String("", 1);
+            LPCWSTR userAgent = reinterpret_cast<const WCHAR*>(userAgentStr.characters());
             // leak the Internet for now
             internetHandle = InternetOpen(userAgent, INTERNET_OPEN_TYPE_PRECONFIG, 0, 0, INTERNET_FLAG_ASYNC);
         }
index a18cad131d7ed2c2f572964d7902d82575814fc4..c316d3cae1277fca367a6f9ee532a5ceedd0d767 100644 (file)
  * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  * Boston, MA 02111-1307, USA.
  */
+
 #ifndef RenderTable_H
 #define RenderTable_H
 
+#include "DeprecatedArray.h"
 #include "RenderBlock.h"
 
 namespace WebCore {
index 0a3b8c3993639711e7cc58931f3bd319044b4ad4..d9d06f861d2e6e8820aeb6a3900a8e28af7299e8 100644 (file)
 #include "config.h"
 #include "RenderText.h"
 
+#include "DeprecatedString.h"
 #include "InlineTextBox.h"
 #include "Pen.h"
-#include "RenderBlock.h"
-#include "break_lines.h"
 #include "Range.h"
 #include "RenderArena.h"
-#include <wtf/AlwaysInline.h>
+#include "RenderBlock.h"
+#include "break_lines.h"
 #include <unicode/ubrk.h>
+#include <wtf/AlwaysInline.h>
 
 using namespace std;
 
index 21864b13893ad40ff970d8633d0c59ed99a00597..6bd0374c3e55b221bec730ed18e76c302eb99bdf 100644 (file)
  * Boston, MA 02111-1307, USA.
  *
  */
+
 #ifndef RENDER_LIST_H
 #define RENDER_LIST_H
 
+#include "DeprecatedString.h"
 #include "RenderBlock.h"
 
 // ### list-style-position, list-style-image is still missing
index 0ce512454348e999b5195f0b0df9cc9c7d66a175..53b7aee2c489fb4a9072a098ec3e1adb7c09271e 100644 (file)
@@ -663,7 +663,7 @@ RenderStyle* RenderStyle::getPseudoStyle(PseudoId pid)
 {
     RenderStyle* ps = 0;
     if (noninherited_flags._styleType == NOPSEUDO)
-        for (ps = pseudoStyle; ps; ps = ps->psuedoStyle)
+        for (ps = pseudoStyle; ps; ps = ps->pseudoStyle)
             if (ps->styleType() == pid)
                 break;
     return ps;
index 2dda2d6727fabca470a091c19389c6f57f4af9ce..3fb6f665c759b94b1ebdbd4c6eef2dbc19187360 100644 (file)
@@ -1,3 +1,10 @@
+2006-05-09  Darin Adler  <darin@apple.com>
+
+        - attempt to fix the Windows build
+
+        * WebView.cpp: (WebKit::WebViewWndProc): Convert to String explicitly via UChar instead of
+        implicitly via QChar.
+
 2006-05-09  Steve Falkenburg  <sfalken@apple.com>
 
         Add host calback so caller can determine success/failure of a page load.
index b4ae84d28d114aecd33f0235b62aba613f0f832b..86eed39b5fbafdcf1996beb071020967f6488dc5 100644 (file)
@@ -288,7 +288,8 @@ LRESULT CALLBACK WebViewWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM l
     case WM_CHAR: {
         // FIXME: We need to use WM_UNICHAR to support international text.
         if (nextCharIsInputText) {
-            TypingCommand::insertText(webview->mainFrame()->toPrivate()->impl()->document(), QChar(wParam), false);
+            UChar c = wParam;
+            TypingCommand::insertText(webview->mainFrame()->toPrivate()->impl()->document(), String(&c, 1), false);
             nextCharIsInputText = false;
         }
         break;