[Bug 303269]
Ms2ger
303269 at bugs.launchpad.net
Mon Aug 15 11:57:16 UTC 2011
Comment on attachment 553145
fix Get/SetCurrentDictionary signature
Some nits:
>--- a/editor/composer/src/nsEditorSpellCheck.cpp Mon Aug 15 09:56:38 2011 +0200
>+++ b/editor/composer/src/nsEditorSpellCheck.cpp Mon Aug 15 10:26:10 2011 +0200
>+nsEditorSpellCheck::GetCurrentDictionary(nsAString& aDictionary)
> {
>+ nsresult rv = mSpellChecker->GetCurrentDictionary(aDictionary);
> return rv;
"return mSpellChecker->GetCurrentDictionary(aDictionary);"
> nsEditorSpellCheck::SaveDefaultDictionary()
> {
> if (!mDictWasSetManually) {
> return NS_OK;
> }
>- PRUnichar *dictName = nsnull;
>- nsresult rv = GetCurrentDictionary(&dictName);
>
>- if (NS_SUCCEEDED(rv) && dictName && *dictName) {
>- rv = Preferences::SetString("spellchecker.dictionary", dictName);
>- }
>+ nsAutoString dictName;
>+ nsresult rv = GetCurrentDictionary(dictName);
>+ NS_ENSURE_SUCCESS(rv, rv);
>
>- if (dictName) {
>- nsMemory::Free(dictName);
>- }
>-
>+ rv = Preferences::SetString("spellchecker.dictionary", dictName);
> return rv;
Same comment, and I think you're changing behaviour here if dictName is
the empty string (can that happen?)
>@@ -501,65 +485,65 @@ nsEditorSpellCheck::UpdateCurrentDiction
>- SetCurrentDictionary(NS_LITERAL_STRING("").get());
>+ SetCurrentDictionary(NS_LITERAL_STRING(""));
EmptyString()
>--- a/extensions/spellcheck/src/mozInlineSpellChecker.cpp Mon Aug 15 09:56:38 2011 +0200
>+++ b/extensions/spellcheck/src/mozInlineSpellChecker.cpp Mon Aug 15 10:26:10 2011 +0200
>@@ -1755,36 +1755,27 @@ nsresult mozInlineSpellChecker::KeyPress
> }
>
> NS_IMETHODIMP mozInlineSpellChecker::UpdateCurrentDictionary()
> {
>+ previousDictionary.Assign(NS_LITERAL_STRING(""));
"previousDictionary.Truncate();"
>+ currentDictionary.Assign(NS_LITERAL_STRING(""));
And here
But overall, this looks much better!
--
You received this bug notification because you are a member of Mozilla
Bugs, which is subscribed to firefox in Ubuntu.
https://bugs.launchpad.net/bugs/303269
Title:
Automatically select language for spell check based on user input
To manage notifications about this bug go to:
https://bugs.launchpad.net/firefox/+bug/303269/+subscriptions
More information about the Ubuntu-mozillateam-bugs
mailing list