Kaydet (Commit) e7f7c836 authored tarafından Samphan Raruenrom's avatar Samphan Raruenrom Kaydeden (comit) Caolán McNamara

fix bug that prevents glyph-fallback for char at end of string

üst 3256422d
...@@ -555,13 +555,14 @@ bool WinGlyphFallbackSubstititution::FindFontSubstitute( ImplFontSelectData& rFo ...@@ -555,13 +555,14 @@ bool WinGlyphFallbackSubstititution::FindFontSubstitute( ImplFontSelectData& rFo
{ {
// guess a locale matching to the missing chars // guess a locale matching to the missing chars
com::sun::star::lang::Locale aLocale; com::sun::star::lang::Locale aLocale;
LanguageType eLang = LANGUAGE_DONTKNOW;
sal_Int32 nStrIdx = 0; sal_Int32 nStrIdx = 0;
const sal_Int32 nStrLen = rMissingChars.getLength(); const sal_Int32 nStrLen = rMissingChars.getLength();
while( nStrIdx < nStrLen ) while( nStrIdx < nStrLen )
{ {
const sal_UCS4 uChar = rMissingChars.iterateCodePoints( &nStrIdx ); const sal_UCS4 uChar = rMissingChars.iterateCodePoints( &nStrIdx );
const LanguageType eLang = MapCharToLanguage( uChar ); eLang = MapCharToLanguage( uChar );
if( eLang == LANGUAGE_DONTKNOW ) if( eLang == LANGUAGE_DONTKNOW )
continue; continue;
MsLangId::convertLanguageToLocale( eLang, aLocale ); MsLangId::convertLanguageToLocale( eLang, aLocale );
...@@ -569,7 +570,7 @@ bool WinGlyphFallbackSubstititution::FindFontSubstitute( ImplFontSelectData& rFo ...@@ -569,7 +570,7 @@ bool WinGlyphFallbackSubstititution::FindFontSubstitute( ImplFontSelectData& rFo
} }
// fall back to default UI locale if the missing characters are inconclusive // fall back to default UI locale if the missing characters are inconclusive
if( nStrIdx >= nStrLen ) if( eLang == LANGUAGE_DONTKNOW )
aLocale = Application::GetSettings().GetUILocale(); aLocale = Application::GetSettings().GetUILocale();
// first level fallback: // first level fallback:
......
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