Bug 1552121 - Suppress auto-hyphenation of words with any internal capital letters. r=mats

Differential Revision: https://phabricator.services.mozilla.com/D31408

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Jonathan Kew 2019-06-10 09:39:16 +00:00
Родитель 33ee21db75
Коммит 1dd81b8e87
1 изменённых файлов: 11 добавлений и 5 удалений

Просмотреть файл

@ -108,14 +108,20 @@ void nsHyphenator::HyphenateWord(const nsAString& aString, uint32_t aStart,
uint32_t origCh = ch; uint32_t origCh = ch;
ch = ToLowerCase(ch); ch = ToLowerCase(ch);
// Avoid hyphenating capitalized words (bug 1550532) unless explicitly if (ch != origCh) {
// allowed by prefs for the language in use. if (firstLetter) {
if (firstLetter) { // Avoid hyphenating capitalized words (bug 1550532) unless explicitly
if (!mHyphenateCapitalized && ch != origCh) { // allowed by prefs for the language in use.
if (!mHyphenateCapitalized) {
return;
}
} else {
// Also never auto-hyphenate a word that has internal caps, as it may
// well be an all-caps acronym or a quirky name like iTunes.
return; return;
} }
firstLetter = false;
} }
firstLetter = false;
if (ch < 0x80) { // U+0000 - U+007F if (ch < 0x80) { // U+0000 - U+007F
utf8.Append(ch); utf8.Append(ch);