[mingw-webkitgtk3/f17] Fix the build with spellchecking enabled

Kalev Lember kalev at fedoraproject.org
Mon Aug 6 17:01:05 UTC 2012


commit a5556e9d2d22d776df4d67f6aec9b58750c4e4c0
Author: Kalev Lember <kalevlember at gmail.com>
Date:   Mon Aug 6 19:58:09 2012 +0300

    Fix the build with spellchecking enabled
    
    Thanks to Paweł Forysiuk for the patch.
    
    https://bugs.webkit.org/show_bug.cgi?id=93255

 mingw-webkitgtk3.spec             |    7 +++-
 webkit-fix-spellcheck-build.patch |   63 +++++++++++++++++++++++++++++++++++++
 2 files changed, 69 insertions(+), 1 deletions(-)
---
diff --git a/mingw-webkitgtk3.spec b/mingw-webkitgtk3.spec
index 68457d8..dbdef7e 100644
--- a/mingw-webkitgtk3.spec
+++ b/mingw-webkitgtk3.spec
@@ -30,6 +30,10 @@ Patch1:         0002-GTK-Win-Fix-plugin-drawing-to-an-offscreen-buffer.patch
 # aren't exported in the .dll.
 Patch2:         webkit-dont-build-dump-render-tree.patch
 
+# Fix the build with spellchecking enabled
+# https://bugs.webkit.org/show_bug.cgi?id=93255
+Patch3:         webkit-fix-spellcheck-build.patch
+
 BuildArch:      noarch
 
 BuildRequires:  bison
@@ -123,6 +127,7 @@ This is the MinGW port of WebKitGTK+ for GTK+ 3.
 %patch1 -p1 -b .npapi_offscreen_drawing
 
 %patch2 -p0 -b .dumprendertree
+%patch3 -p1 -b .spellcheck
 autoreconf --verbose --install -I Source/autotools
 
 
@@ -136,7 +141,6 @@ autoreconf --verbose --install -I Source/autotools
                         --with-gtk=3.0                          \
                         --with-font-backend=freetype            \
                         --with-unicode-backend=icu              \
-                        --disable-spellcheck                    \
                         --disable-geolocation                   \
                         --disable-gtk-doc-html
 
@@ -214,6 +218,7 @@ find $RPM_BUILD_ROOT -name "*.la" -delete
 * Mon Aug 06 2012 Kalev Lember <kalevlember at gmail.com> - 1.8.2-1
 - Update to 1.8.2
 - Backport NPAPI plugin support from trunk
+- Fix the build with spellchecking enabled (Paweł Forysiuk)
 
 * Wed Jun 13 2012 Kalev Lember <kalevlember at gmail.com> - 1.8.1-1
 - Initial mingw-webkitgtk3 packaging, based on Fedora mingw-webkitgtk
diff --git a/webkit-fix-spellcheck-build.patch b/webkit-fix-spellcheck-build.patch
new file mode 100644
index 0000000..1b59f6f
--- /dev/null
+++ b/webkit-fix-spellcheck-build.patch
@@ -0,0 +1,63 @@
+2012-08-06  Paweł Forysiuk  <tuxator at o2.pl>
+
+        [GTK] WebkitGTK fails to build with MinGW with spellchecking enabled
+        https://bugs.webkit.org/show_bug.cgi?id=93255
+
+        Reviewed by NOBODY (OOPS!).
+
+        Build dies because of invalid cast. Additionaly word "interface" is in use with
+        MinGW compiler.
+		
+        * WebCoreSupport/TextCheckerClientGtk.cpp:
+        (WebKit::TextCheckerClientGtk::checkSpellingOfString): Use mingw-friendly cast
+        * webkit/webkitspellcheckerenchant.cpp:
+        (webkit_spell_checker_enchant_spell_checker_interface_init): rename interface -> iface
+
+diff --git a/Source/WebKit/gtk/WebCoreSupport/TextCheckerClientGtk.cpp b/Source/WebKit/gtk/WebCoreSupport/TextCheckerClientGtk.cpp
+index e128ad2..768fa73 100644
+--- a/Source/WebKit/gtk/WebCoreSupport/TextCheckerClientGtk.cpp
++++ b/Source/WebKit/gtk/WebCoreSupport/TextCheckerClientGtk.cpp
+@@ -61,7 +61,7 @@ void TextCheckerClientGtk::learnWord(const String& text)
+ 
+ void TextCheckerClientGtk::checkSpellingOfString(const UChar* text, int length, int* misspellingLocation, int* misspellingLength)
+ {
+-    GOwnPtr<gchar> utf8Text(g_utf16_to_utf8(const_cast<gunichar2*>(text), length, 0, 0, 0));
++    GOwnPtr<gchar> utf8Text(g_utf16_to_utf8(reinterpret_cast<const gunichar2*>(text), length, 0, 0, 0));
+     webkit_spell_checker_check_spelling_of_string(m_spellChecker.get(), utf8Text.get(), misspellingLocation, misspellingLength);
+ }
+ 
+diff --git a/Source/WebKit/gtk/webkit/webkitspellcheckerenchant.cpp b/Source/WebKit/gtk/webkit/webkitspellcheckerenchant.cpp
+index 07d34d1..2b8f5e4 100644
+--- a/Source/WebKit/gtk/webkit/webkitspellcheckerenchant.cpp
++++ b/Source/WebKit/gtk/webkit/webkitspellcheckerenchant.cpp
+@@ -43,7 +43,7 @@ struct _WebKitSpellCheckerEnchantPrivate {
+     GSList* enchantDicts;
+ };
+ 
+-static void webkit_spell_checker_enchant_spell_checker_interface_init(WebKitSpellCheckerInterface* interface);
++static void webkit_spell_checker_enchant_spell_checker_interface_init(WebKitSpellCheckerInterface* iface);
+ 
+ G_DEFINE_TYPE_WITH_CODE(WebKitSpellCheckerEnchant, webkit_spell_checker_enchant, G_TYPE_OBJECT,
+                         G_IMPLEMENT_INTERFACE(WEBKIT_TYPE_SPELL_CHECKER,
+@@ -119,14 +119,14 @@ static void ignoreWord(WebKitSpellChecker* checker, const char* word)
+     }
+ }
+ 
+-static void webkit_spell_checker_enchant_spell_checker_interface_init(WebKitSpellCheckerInterface* interface)
++static void webkit_spell_checker_enchant_spell_checker_interface_init(WebKitSpellCheckerInterface* iface)
+ {
+-    interface->check_spelling_of_string = checkSpellingOfString;
+-    interface->get_guesses_for_word = getGuessesForWord;
+-    interface->update_spell_checking_languages = updateSpellCheckingLanguages;
+-    interface->get_autocorrect_suggestions_for_misspelled_word = getAutocorrectSuggestionsForMisspelledWord;
+-    interface->learn_word = learnWord;
+-    interface->ignore_word = ignoreWord;
++    iface->check_spelling_of_string = checkSpellingOfString;
++    iface->get_guesses_for_word = getGuessesForWord;
++    iface->update_spell_checking_languages = updateSpellCheckingLanguages;
++    iface->get_autocorrect_suggestions_for_misspelled_word = getAutocorrectSuggestionsForMisspelledWord;
++    iface->learn_word = learnWord;
++    iface->ignore_word = ignoreWord;
+ }
+ 
+ #endif /* ENABLE(SPELLCHECK) */


More information about the scm-commits mailing list