From fdea055cf0f9dd2dc55fe2adc9f7b85fbaac37b1 Mon Sep 17 00:00:00 2001 From: "mvl%exedo.nl" Date: Thu, 1 Jan 2004 14:53:37 +0000 Subject: [PATCH] spellchecks marks words with initial caps as spelled wrong. bug 229215, r=dwitte, sr=alecf. git-svn-id: svn://10.0.0.236/trunk@150823 18797224-902f-48f8-a5cc-f745e15eee43 --- .../extensions/spellcheck/src/mozEnglishWordUtils.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/mozilla/extensions/spellcheck/src/mozEnglishWordUtils.cpp b/mozilla/extensions/spellcheck/src/mozEnglishWordUtils.cpp index fa2f4a1ed32..9c2e1810833 100644 --- a/mozilla/extensions/spellcheck/src/mozEnglishWordUtils.cpp +++ b/mozilla/extensions/spellcheck/src/mozEnglishWordUtils.cpp @@ -39,9 +39,12 @@ #include "nsICharsetAlias.h" #include "nsReadableUtils.h" #include "nsIServiceManager.h" +#include "nsUnicharUtilCIID.h" #include "nsCRT.h" #include "cattable.h" +static NS_DEFINE_CID(kUnicharUtilCID, NS_UNICHARUTIL_CID); + NS_IMPL_ISUPPORTS1(mozEnglishWordUtils, mozISpellI18NUtil) mozEnglishWordUtils::mozEnglishWordUtils() @@ -74,6 +77,12 @@ NS_IMETHODIMP mozEnglishWordUtils::GetRootForm(const PRUnichar *aWord, PRUint32 *count = 0; + if (!mCaseConv) { + mCaseConv = do_GetService(kUnicharUtilCID); + if (!mCaseConv) + return NS_ERROR_FAILURE; + } + mozEnglishWordUtils::myspCapitalization ct = captype(word); switch (ct) { @@ -138,7 +147,6 @@ NS_IMETHODIMP mozEnglishWordUtils::GetRootForm(const PRUnichar *aWord, PRUint32 NS_FREE_XPCOM_ALLOCATED_POINTER_ARRAY(1, tmpPtr); return NS_ERROR_OUT_OF_MEMORY; } - mCaseConv->ToLower(tmpPtr[1], tmpPtr[1], length); *words = tmpPtr; *count = 2;