2006-09-07 MorganL <morlmor@yahoo.com>
authoraroben <aroben@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Sep 2006 18:45:10 +0000 (18:45 +0000)
committeraroben <aroben@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Sep 2006 18:45:10 +0000 (18:45 +0000)
        Reviewed by Darin, landed by Adam.

        Fixes part of bug 10743: Windows build busted.

        * platform/win/FontCacheWin.cpp: Add missing #include, set svn:eol-style to native
        (WebCore::FontCache::getFontLinkInterface):
        (WebCore::FontCache::getFontDataForCharacters):
        * platform/win/FontDataWin.cpp: Ditto.
        (WebCore::FontData::platformWidthForGlyph):
        * platform/win/FontWin.cpp: Add missing #include, band-aid over const problem with GlyphBufferGlyph
        (WebCore::Font::drawGlyphs):
        * platform/win/ResourceLoaderWin.cpp: Add missing #include, change .ascii() to .latin1()
        (WebCore::ResourceLoaderWndProc):
        (WebCore::ResourceLoader::start):

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

WebCore/ChangeLog
WebCore/platform/win/FontCacheWin.cpp
WebCore/platform/win/FontDataWin.cpp
WebCore/platform/win/FontWin.cpp
WebCore/platform/win/ResourceLoaderWin.cpp

index 4cb899225337d01808642f0fda9cadf0326c6164..48d566f06d249c5c5b71646a2cbea97c811505b8 100644 (file)
@@ -1,3 +1,20 @@
+2006-09-07  MorganL  <morlmor@yahoo.com>
+
+        Reviewed by Darin, landed by Adam.
+
+        Fixes part of bug 10743: Windows build busted.
+
+        * platform/win/FontCacheWin.cpp: Add missing #include, set svn:eol-style to native
+        (WebCore::FontCache::getFontLinkInterface):
+        (WebCore::FontCache::getFontDataForCharacters):
+        * platform/win/FontDataWin.cpp: Ditto.
+        (WebCore::FontData::platformWidthForGlyph):
+        * platform/win/FontWin.cpp: Add missing #include, band-aid over const problem with GlyphBufferGlyph
+        (WebCore::Font::drawGlyphs):
+        * platform/win/ResourceLoaderWin.cpp: Add missing #include, change .ascii() to .latin1()
+        (WebCore::ResourceLoaderWndProc):
+        (WebCore::ResourceLoader::start):
+
 2006-09-07  Alexey Proskuryakov  <ap@nypop.com>
 
         Reviewed by Darin.
index eb8565f90715ef1e5d43b6de2f829ff5ae8672c4..8d0bcf514c7dc9a95287b83a56e604479a644a2f 100644 (file)
@@ -28,7 +28,7 @@
 
 #include "config.h"
 #include "FontCache.h"
-#include "FontPlatformData.h"
+#include "FontData.h"
 #include "Font.h"
 #include <windows.h>
 #include <mlang.h>
@@ -43,16 +43,16 @@ void FontCache::platformInit()
 
 IMLangFontLink2* FontCache::getFontLinkInterface()
 {
-    static IMultiLanguage *multiLanguage;\r
-    if (!multiLanguage) {\r
-        if (CoCreateInstance(CLSID_CMultiLanguage, 0, CLSCTX_ALL, IID_IMultiLanguage, (void**)&multiLanguage) != S_OK)\r
-            return 0;\r
-    }\r
-\r
-    static IMLangFontLink2* langFontLink;\r
-    if (!langFontLink) {\r
-        if (multiLanguage->QueryInterface(IID_IMLangFontLink2, (void**)&langFontLink) != S_OK)\r
-            return 0;\r
+    static IMultiLanguage *multiLanguage;
+    if (!multiLanguage) {
+        if (CoCreateInstance(CLSID_CMultiLanguage, 0, CLSCTX_ALL, IID_IMultiLanguage, (void**)&multiLanguage) != S_OK)
+            return 0;
+    }
+
+    static IMLangFontLink2* langFontLink;
+    if (!langFontLink) {
+        if (multiLanguage->QueryInterface(IID_IMLangFontLink2, (void**)&langFontLink) != S_OK)
+            return 0;
     }
 
     return langFontLink;
@@ -61,27 +61,27 @@ IMLangFontLink2* FontCache::getFontLinkInterface()
 const FontData* FontCache::getFontDataForCharacters(const Font& font, const UChar* characters, int length)
 {
     // IMLangFontLink::MapFont Method does what we want.
-    IMLangFontLink2* langFontLink = getFontLinkInterface();\r
-    if (!langFontLink)\r
-        return 0;\r
-\r
-    FontData* fontData = 0;\r
-    HDC hdc = GetDC(0);\r
-    DWORD fontCodePages;\r
-    langFontLink->GetFontCodePages(hdc, font.primaryFont()->m_font.hfont(), &fontCodePages);\r
-\r
-    DWORD actualCodePages;\r
-    long cchActual;\r
-    langFontLink->GetStrCodePages(characters, length, fontCodePages, &actualCodePages, &cchActual);\r
-    if (cchActual) {\r
-        HFONT result;\r
-        if (langFontLink->MapFont(hdc, actualCodePages, characters[0], &result) == S_OK) {\r
-            fontData = new FontData(FontPlatformData(result, font.fontDescription().computedPixelSize()));\r
-            fontData->setIsMLangFont();\r
-        }\r
-    }\r
-\r
-    ReleaseDC(0, hdc);\r
+    IMLangFontLink2* langFontLink = getFontLinkInterface();
+    if (!langFontLink)
+        return 0;
+
+    FontData* fontData = 0;
+    HDC hdc = GetDC(0);
+    DWORD fontCodePages;
+    langFontLink->GetFontCodePages(hdc, font.primaryFont()->m_font.hfont(), &fontCodePages);
+
+    DWORD actualCodePages;
+    long cchActual;
+    langFontLink->GetStrCodePages(characters, length, fontCodePages, &actualCodePages, &cchActual);
+    if (cchActual) {
+        HFONT result;
+        if (langFontLink->MapFont(hdc, actualCodePages, characters[0], &result) == S_OK) {
+            fontData = new FontData(FontPlatformData(result, font.fontDescription().computedPixelSize()));
+            fontData->setIsMLangFont();
+        }
+    }
+
+    ReleaseDC(0, hdc);
     return fontData;
 }
 
index f0bb7ec0085e71adbd43f1a0da25c821ca538d92..3f876eabbbf9907d23e0f4748691d5faad8fc504 100644 (file)
@@ -30,6 +30,7 @@
 #include "Font.h"
 #include "FontCache.h"
 #include "FloatRect.h"
+#include "FontData.h"
 #include "FontDescription.h"
 #include <wtf/MathExtras.h>
 #include <unicode/uchar.h>
@@ -156,8 +157,8 @@ float FontData::platformWidthForGlyph(Glyph glyph) const
     cairo_win32_scaled_font_select_font(scaledFont, dc);
 
     int width;
-    GetCharWidthI(dc, glyph, 1, 0, &width);\r
-\r
+    GetCharWidthI(dc, glyph, 1, 0, &width);
+
     cairo_win32_scaled_font_done_font(scaledFont);
 
     RestoreDC(dc, -1);
index 098d43ae28825a89a908565c58aba36ff972297e..d81b2e97e3e44b1bbe87f3df6bfc3a9c1604b3fe 100644 (file)
@@ -29,6 +29,7 @@
 #include <cairo-win32.h>
 #include "FontData.h"
 #include "FontFallbackList.h"
+#include "GlyphBuffer.h"
 #include "GraphicsContext.h"
 #include "IntRect.h"
 
@@ -71,7 +72,8 @@ void Font::drawGlyphs(GraphicsContext* graphicsContext, const FontData* font, co
     // Restore the original transform.
     SetWorldTransform(dc, &savedxform);
 
-    GlyphBufferGlyph* glyphs = glyphBuffer.glyphs(from);
+    // FIXME: This const_cast seems really wrong
+    GlyphBufferGlyph* glyphs = const_cast<GlyphBufferGlyph*>(glyphBuffer.glyphs(from));
 
     float offset = point.x();
 
index 28452c065149475f4f97057233d424807dacfec0..e35ab42a5e1f7c913101e825a3e47051833b1ae9 100644 (file)
@@ -28,6 +28,7 @@
 #include "ResourceLoaderInternal.h"
 #include "ResourceLoaderWin.h"
 
+#include "CString.h"
 #include "DocLoader.h"
 #include "Frame.h"
 #include "Document.h"
@@ -106,7 +107,7 @@ LRESULT CALLBACK ResourceLoaderWndProc(HWND hWnd, UINT message, WPARAM wParam, L
                         urlStr = urlStr.left(fragmentIndex);
                     static LPCSTR accept[2]={"*/*", NULL};
                     HINTERNET urlHandle = HttpOpenRequestA(job->d->m_resourceHandle, 
-                                                           "POST", urlStr.ascii(), 0, 0, accept,
+                                                           "POST", urlStr.latin1(), 0, 0, accept,
                                                            INTERNET_FLAG_KEEP_CONNECTION | 
                                                            INTERNET_FLAG_FORMS_SUBMIT |
                                                            INTERNET_FLAG_RELOAD | INTERNET_FLAG_NO_CACHE_WRITE,
@@ -129,14 +130,14 @@ LRESULT CALLBACK ResourceLoaderWndProc(HWND hWnd, UINT message, WPARAM wParam, L
                 INTERNET_BUFFERSA buffers;
                 memset(&buffers, 0, sizeof(buffers));
                 buffers.dwStructSize = sizeof(INTERNET_BUFFERSA);
-                buffers.lpcszHeader = headers.ascii();
+                buffers.lpcszHeader = headers.latin1();
                 buffers.dwHeadersLength = headers.length();
                 buffers.dwBufferTotal = formData.length();
                 
                 job->d->m_bytesRemainingToWrite = formData.length();
                 job->d->m_formDataString = (char*)malloc(formData.length());
                 job->d->m_formDataLength = formData.length();
-                strncpy(job->d->m_formDataString, formData.ascii(), formData.length());
+                strncpy(job->d->m_formDataString, formData.latin1(), formData.length());
                 job->d->m_writing = true;
                 HttpSendRequestExA(job->d->m_secondaryHandle, &buffers, 0, 0, (DWORD_PTR)job->d->m_jobId);
             }
@@ -306,7 +307,7 @@ bool ResourceLoader::start(DocLoader* docLoader)
             if (!referrer.isEmpty())
                 headers += String("Referer: ") + referrer + "\r\n";
 
-            urlHandle = InternetOpenUrlA(internetHandle, urlStr.ascii(), headers.ascii(), headers.length(),
+            urlHandle = InternetOpenUrlA(internetHandle, urlStr.ascii(), headers.latin1(), headers.length(),
                                          INTERNET_FLAG_KEEP_CONNECTION, (DWORD_PTR)d->m_jobId);
         }