Kaydet (Commit) ae716b07 authored tarafından Caolán McNamara's avatar Caolán McNamara

Related: fdo#49208 optimize common case

Change-Id: Ieec379b08cb9096b1c8187c2eda5053f093c612d
üst ccc47b3d
......@@ -172,9 +172,16 @@ sal_Int32 SwBreakIt::getGraphemeCount(const rtl::OUString& rText, sal_Int32 nSta
sal_Int32 nCurPos = nStart;
while (nCurPos < nEnd)
{
sal_Int32 nCount2 = 1;
nCurPos = xBreak->nextCharacters(rText, nCurPos, lang::Locale(),
i18n::CharacterIteratorMode::SKIPCELL, nCount2, nCount2);
//fdo#49208 cheat and assume that nothing can combine with a space
//to form a single grapheme
if (rText[nCurPos] == ' ')
++nCurPos;
else
{
sal_Int32 nCount2 = 1;
nCurPos = xBreak->nextCharacters(rText, nCurPos, lang::Locale(),
i18n::CharacterIteratorMode::SKIPCELL, nCount2, nCount2);
}
++nGraphemeCount;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment