summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/source/core/bastyp/breakit.cxx13
1 files changed, 10 insertions, 3 deletions
diff --git a/sw/source/core/bastyp/breakit.cxx b/sw/source/core/bastyp/breakit.cxx
index 1fbadd80114c..4c8437902a07 100644
--- a/sw/source/core/bastyp/breakit.cxx
+++ b/sw/source/core/bastyp/breakit.cxx
@@ -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;
}