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 419239 Details for
Bug 355178
[patch]
Fix a regression of previous patch
spell.patch (text/plain), 2.47 KB, created by
Massimeddu
(
hide
)
Description:
Fix a regression of previous patch
Filename:
MIME Type:
Creator:
Massimeddu
Size:
2.47 KB
patch
obsolete
>diff -r 62d3936eb3f0 extensions/spellcheck/src/mozInlineSpellWordUtil.cpp >--- a/extensions/spellcheck/src/mozInlineSpellWordUtil.cpp Sun Dec 27 08:50:08 2009 -0500 >+++ b/extensions/spellcheck/src/mozInlineSpellWordUtil.cpp Sun Dec 27 15:22:55 2009 +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 >+ // 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] == '.' && >+ ClassifyCharacter(aIndex - 1, false) == CHAR_CLASS_WORD) >+ return CHAR_CLASS_WORD; >+ >+ // all other punctuation (only if it is at start or end of the word) > if (charCategory == nsIUGenCategory::kSeparator || > charCategory == nsIUGenCategory::kOther || > charCategory == nsIUGenCategory::kPunctuation || >- charCategory == nsIUGenCategory::kSymbol) >- return CHAR_CLASS_SEPARATOR; >+ 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:
smontagu
: review-
Actions:
View
|
Diff
|
Review
Attachments on
bug 355178
:
418524
|
418548
|
418549
|
418984
|
419239
|
431603
|
507324
|
507912
|
507917
|
508164
|
510837
|
526149