summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorobo <obo@openoffice.org>2010-10-08 08:19:25 +0200
committerobo <obo@openoffice.org>2010-10-08 08:19:25 +0200
commitd90ed34d0861ac564acd14a95890dda4849e5558 (patch)
treee877ebda41c9065b1f7e2c2194910f61c711a624 /vcl
parentbde077de4b4b94727f6cbe3fd647128a8cd5d7ef (diff)
parent011ac751da6ad88af5ff9e6547f568549e6675c3 (diff)
CWS-TOOLING: integrate CWS sw33bf10
Diffstat (limited to 'vcl')
-rw-r--r--vcl/unx/source/fontmanager/fontconfig.cxx17
1 files changed, 12 insertions, 5 deletions
diff --git a/vcl/unx/source/fontmanager/fontconfig.cxx b/vcl/unx/source/fontmanager/fontconfig.cxx
index 03816857f27c..5b18ec002aa9 100644
--- a/vcl/unx/source/fontmanager/fontconfig.cxx
+++ b/vcl/unx/source/fontmanager/fontconfig.cxx
@@ -509,22 +509,29 @@ namespace
std::vector<lang_and_family>::const_iterator aEnd = families.end();
bool alreadyclosematch = false;
- for (std::vector<lang_and_family>::const_iterator aIter = families.begin(); aIter != aEnd; ++aIter)
+ for( std::vector<lang_and_family>::const_iterator aIter = families.begin(); aIter != aEnd; ++aIter )
{
const char *pLang = (const char*)aIter->first;
- //perfect
- if( rtl_str_compare(pLang,sFullMatch.getStr() ) == 0)
+ if( rtl_str_compare( pLang, sFullMatch.getStr() ) == 0)
{
+ // both language and country match
candidate = aIter->second;
break;
}
- else if( (rtl_str_compare(pLang,sLangMatch.getStr()) == 0) && (!alreadyclosematch))
+ else if( alreadyclosematch )
+ continue;
+ else if( rtl_str_compare( pLang, sLangMatch.getStr()) == 0)
{
+ // just the language matches
candidate = aIter->second;
alreadyclosematch = true;
}
+ else if( rtl_str_compare( pLang, "en") == 0)
+ {
+ // fallback to the english family name
+ candidate = aIter->second;
+ }
}
-
return candidate;
}
}