872e15
# HG changeset patch
872e15
# Parent c0abc2a6e11f52761366e029eb1bae4c9864a8a3
872e15
# User Jorg K <mozilla@jorgk.com>
872e15
Bug 1204147 - Prevent content preferences being written when they shouldn't. r=roc
872e15
872e15
diff --git a/editor/composer/nsEditorSpellCheck.cpp b/editor/composer/nsEditorSpellCheck.cpp
872e15
--- a/editor/composer/nsEditorSpellCheck.cpp
872e15
+++ b/editor/composer/nsEditorSpellCheck.cpp
872e15
@@ -648,16 +648,19 @@ nsEditorSpellCheck::CheckCurrentDictiona
872e15
   }
872e15
 
872e15
   // If our preferred current dictionary has gone, pick another one.
872e15
   nsTArray<nsString> dictList;
872e15
   rv = mSpellChecker->GetDictionaryList(&dictList);
872e15
   NS_ENSURE_SUCCESS(rv, rv);
872e15
 
872e15
   if (dictList.Length() > 0) {
872e15
+    // Use RAII object to prevent content preferences being written during
872e15
+    // this call.
872e15
+    UpdateDictionaryHolder holder(this);
872e15
     rv = SetCurrentDictionary(dictList[0]);
872e15
     NS_ENSURE_SUCCESS(rv, rv);
872e15
   }
872e15
 
872e15
   return NS_OK;
872e15
 }
872e15
 
872e15
 NS_IMETHODIMP