Mozilla Home
Privacy
Cookies
Legal
Bugzilla
Browse
Advanced Search
New Bug
Reports
Documentation
Log In
Log In with GitHub
or
Remember me
Browse
Advanced Search
New Bug
Reports
Documentation
Attachment 431603 Details for
Bug 355178
[patch]
A fixed version
spell.patch (text/plain), 2.60 KB, created by
Massimeddu
(
hide
)
Description:
A fixed version
Filename:
MIME Type:
Creator:
Massimeddu
Size:
2.60 KB
patch
obsolete
>diff -r 3b49923ba8c5 extensions/spellcheck/src/mozInlineSpellWordUtil.cpp >--- a/extensions/spellcheck/src/mozInlineSpellWordUtil.cpp Wed Mar 10 09:07:45 2010 +0100 >+++ b/extensions/spellcheck/src/mozInlineSpellWordUtil.cpp Wed Mar 10 11:48:44 2010 +0100 >@@ -867,22 +867,52 @@ WordSplitState::ClassifyCharacter(PRInt3 > return CHAR_CLASS_SEPARATOR; > if (ClassifyCharacter(aIndex + 1, false) != CHAR_CLASS_WORD) > return CHAR_CLASS_SEPARATOR; > > // char on either side is a word, this counts as a word > return CHAR_CLASS_WORD; > } > >- // all other punctuation >- if (charCategory == nsIUGenCategory::kSeparator || >- charCategory == nsIUGenCategory::kOther || >- charCategory == nsIUGenCategory::kPunctuation || >- charCategory == nsIUGenCategory::kSymbol) >- return CHAR_CLASS_SEPARATOR; >+ // the char dot is evalued by hunspell if is near to a word char >+ // for example it can be used into abreviations >+ if (aIndex > 0 && >+ mDOMWordText[aIndex] == '.' && >+ mDOMWordText[aIndex-1] != '.' && >+ ClassifyCharacter(aIndex - 1, false) == CHAR_CLASS_WORD) >+ return CHAR_CLASS_WORD; >+ >+ if (charCategory == nsIUGenCategory::kSeparator || >+ charCategory == nsIUGenCategory::kOther || >+ charCategory == nsIUGenCategory::kPunctuation || >+ charCategory == nsIUGenCategory::kSymbol) { >+ PRBool start = true, end = true; >+ for (PRInt32 aIndexTmp = aIndex; start && aIndexTmp >= 0; aIndexTmp--) { >+ // this will classify the current character >+ nsIUGenCategory::nsUGenCategory >+ charCategoryTmp = mWordUtil->GetCategories()->Get(PRUint32(mDOMWordText[aIndexTmp])); >+ if (charCategoryTmp != nsIUGenCategory::kSeparator && >+ charCategoryTmp != nsIUGenCategory::kOther && >+ charCategoryTmp != nsIUGenCategory::kPunctuation && >+ charCategoryTmp != nsIUGenCategory::kSymbol) >+ start = false; >+ } >+ for (PRInt32 aIndexTmp = aIndex; !start && end && aIndexTmp <= PRInt32(mDOMWordText.Length()) - 1; aIndexTmp++) { >+ // this will classify the current character >+ nsIUGenCategory::nsUGenCategory >+ charCategoryTmp = mWordUtil->GetCategories()->Get(PRUint32(mDOMWordText[aIndexTmp])); >+ if (charCategoryTmp != nsIUGenCategory::kSeparator && >+ charCategoryTmp != nsIUGenCategory::kOther && >+ charCategoryTmp != nsIUGenCategory::kPunctuation && >+ charCategoryTmp != nsIUGenCategory::kSymbol) >+ end = false; >+ } >+ if (start || end) >+ return CHAR_CLASS_SEPARATOR; >+ } > > // any other character counts as a word > return CHAR_CLASS_WORD; > } > > > // WordSplitState::Advance >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Flags:
smaug
: review-
Actions:
View
|
Diff
|
Review
Attachments on
bug 355178
:
418524
|
418548
|
418549
|
418984
|
419239
|
431603
|
507324
|
507912
|
507917
|
508164
|
510837
|
526149