Kaydet (Commit) 16faad36 authored tarafından Mark Hung's avatar Mark Hung

tdf#107487 fix font fallback for non-BMP characters.

Non-BMP characters use two sal_Unicodes. It is necessary
to advnace with OUString::iterateCodePoints safely instead of
nCharPos + 1.

Change-Id: Iea1005f05421b1021a9b3ff611439357d4dcba9e
Reviewed-on: https://gerrit.libreoffice.org/73326
Tested-by: Jenkins
Reviewed-by: 's avatarKhaled Hosny <khaledhosny@eglug.org>
üst 02bee5f5
...@@ -190,12 +190,14 @@ void GenericSalLayout::SetNeedFallback(ImplLayoutArgs& rArgs, sal_Int32 nCharPos ...@@ -190,12 +190,14 @@ void GenericSalLayout::SetNeedFallback(ImplLayoutArgs& rArgs, sal_Int32 nCharPos
//mark all glyphs as missing so the whole thing is rendered with the same //mark all glyphs as missing so the whole thing is rendered with the same
//font //font
sal_Int32 nDone; sal_Int32 nDone;
sal_Int32 nGraphemeStartPos =
mxBreak->previousCharacters(rArgs.mrStr, nCharPos + 1, aLocale,
i18n::CharacterIteratorMode::SKIPCELL, 1, nDone);
sal_Int32 nGraphemeEndPos = sal_Int32 nGraphemeEndPos =
mxBreak->nextCharacters(rArgs.mrStr, nCharPos, aLocale, mxBreak->nextCharacters(rArgs.mrStr, nCharPos, aLocale,
i18n::CharacterIteratorMode::SKIPCELL, 1, nDone); i18n::CharacterIteratorMode::SKIPCELL, 1, nDone);
// Safely advance nCharPos in case it is a non-BMP character.
rArgs.mrStr.iterateCodePoints(&nCharPos);
sal_Int32 nGraphemeStartPos =
mxBreak->previousCharacters(rArgs.mrStr, nCharPos, aLocale,
i18n::CharacterIteratorMode::SKIPCELL, 1, nDone);
rArgs.NeedFallback(nGraphemeStartPos, nGraphemeEndPos, bRightToLeft); rArgs.NeedFallback(nGraphemeStartPos, nGraphemeEndPos, bRightToLeft);
} }
......
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