[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.15.1-1414-gc69ee75

jmalonzo at webkit.org jmalonzo at webkit.org
Thu Oct 29 20:43:14 UTC 2009


The following commit has been merged in the webkit-1.1 branch:
commit 82e1440993af439eeb34175c6865414f39ca36ec
Author: jmalonzo at webkit.org <jmalonzo at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Oct 12 14:15:16 2009 +0000

    2009-10-12  Christian Dywan  <christian at twotoasts.de>
    
            Reviewed by Gustavo Noronha.
    
            [GTK] Crash when right-clicking misspelled word
            https://bugs.webkit.org/show_bug.cgi?id=29772
    
            Make sure the dictionary exist before adding it to the list of
            dictionaries.
    
            * WebCoreSupport/EditorClientGtk.cpp:
            (WebKit::EditorClient::checkSpellingOfString):
            * webkit/webkitwebsettings.cpp:
            (webkit_web_settings_set_property):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@49437 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/gtk/ChangeLog b/WebKit/gtk/ChangeLog
index 1093e33..700198f 100644
--- a/WebKit/gtk/ChangeLog
+++ b/WebKit/gtk/ChangeLog
@@ -1,3 +1,18 @@
+2009-10-12  Christian Dywan  <christian at twotoasts.de>
+
+        Reviewed by Gustavo Noronha.
+
+        [GTK] Crash when right-clicking misspelled word
+        https://bugs.webkit.org/show_bug.cgi?id=29772
+
+        Make sure the dictionary exist before adding it to the list of
+        dictionaries.
+
+        * WebCoreSupport/EditorClientGtk.cpp:
+        (WebKit::EditorClient::checkSpellingOfString):
+        * webkit/webkitwebsettings.cpp:
+        (webkit_web_settings_set_property):
+
 2009-10-08  Adam Barth  <abarth at webkit.org>
 
         Reviewed by Eric Seidel.
diff --git a/WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp b/WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp
index 7121163..6ec6baf 100644
--- a/WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp
+++ b/WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp
@@ -615,6 +615,10 @@ void EditorClient::learnWord(const String& text)
 
 void EditorClient::checkSpellingOfString(const UChar* text, int length, int* misspellingLocation, int* misspellingLength)
 {
+    GSList* langs = webkit_web_settings_get_spell_languages(m_webView);
+    if (!langs)
+        return;
+
     gchar* ctext = g_utf16_to_utf8(const_cast<gunichar2*>(text), length, 0, 0, 0);
     int utflen = g_utf8_strlen(ctext, -1);
 
@@ -632,7 +636,6 @@ void EditorClient::checkSpellingOfString(const UChar* text, int length, int* mis
             int start = i;
             int end = i;
             int wordLength;
-            GSList* langs = webkit_web_settings_get_spell_languages(m_webView);
 
             while (attrs[end].is_word_end < 1)
                 end++;
diff --git a/WebKit/gtk/webkit/webkitwebsettings.cpp b/WebKit/gtk/webkit/webkitwebsettings.cpp
index 588d5bd..9aadf18 100644
--- a/WebKit/gtk/webkit/webkitwebsettings.cpp
+++ b/WebKit/gtk/webkit/webkitwebsettings.cpp
@@ -694,6 +694,7 @@ static void webkit_web_settings_set_property(GObject* object, guint prop_id, con
 {
     WebKitWebSettings* web_settings = WEBKIT_WEB_SETTINGS(object);
     WebKitWebSettingsPrivate* priv = web_settings->priv;
+    EnchantBroker* broker;
     SpellLanguage* lang;
     GSList* spellLanguages = NULL;
 
@@ -787,26 +788,32 @@ static void webkit_web_settings_set_property(GObject* object, guint prop_id, con
     case PROP_SPELL_CHECKING_LANGUAGES:
         priv->spell_checking_languages = g_strdup(g_value_get_string(value));
 
+        broker = enchant_broker_init();
         if (priv->spell_checking_languages) {
             char** langs = g_strsplit(priv->spell_checking_languages, ",", -1);
             for (int i = 0; langs[i]; i++) {
-                lang = g_slice_new0(SpellLanguage);
-                lang->config = enchant_broker_init();
-                lang->speller = enchant_broker_request_dict(lang->config, langs[i]);
+                if (enchant_broker_dict_exists(broker, langs[i])) {
+                    lang = g_slice_new0(SpellLanguage);
+                    lang->config = enchant_broker_init();
+                    lang->speller = enchant_broker_request_dict(lang->config, langs[i]);
 
-                spellLanguages = g_slist_append(spellLanguages, lang);
+                    spellLanguages = g_slist_append(spellLanguages, lang);
+                }
             }
 
             g_strfreev(langs);
         } else {
             const char* language = pango_language_to_string(gtk_get_default_language());
 
-            lang = g_slice_new0(SpellLanguage);
-            lang->config = enchant_broker_init();
-            lang->speller = enchant_broker_request_dict(lang->config, language);
+            if (enchant_broker_dict_exists(broker, language)) {
+                lang = g_slice_new0(SpellLanguage);
+                lang->config = enchant_broker_init();
+                lang->speller = enchant_broker_request_dict(lang->config, language);
 
-            spellLanguages = g_slist_append(spellLanguages, lang);
+                spellLanguages = g_slist_append(spellLanguages, lang);
+            }
         }
+        enchant_broker_free(broker);
         g_slist_foreach(priv->spell_checking_languages_list, free_spell_checking_language, NULL);
         g_slist_free(priv->spell_checking_languages_list);
         priv->spell_checking_languages_list = spellLanguages;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list