summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2015-04-28 13:18:50 +0200
committerEike Rathke <erack@redhat.com>2015-04-28 13:26:28 +0200
commitf318e305b6afa715ef759b8589823da53b812a88 (patch)
tree1c837daf16121afa9084fe1f3e10d3de8845d1b2
parentaff76b56ea8fb87418a47bcbb85541a4f3297aff (diff)
don't assume Country to be always present, tdf#85432 follow-up
For example, 'C' was displayed as "C_" Also, append Variant if present to display the full locale identifier, for example "en_US.UTF-8" Change-Id: I00c7bf832df25c00cc014589c4662806f8bf1137
-rw-r--r--cui/source/dialogs/about.cxx9
1 files changed, 7 insertions, 2 deletions
diff --git a/cui/source/dialogs/about.cxx b/cui/source/dialogs/about.cxx
index f5761d3093ff..ed4fcc337396 100644
--- a/cui/source/dialogs/about.cxx
+++ b/cui/source/dialogs/about.cxx
@@ -239,9 +239,14 @@ OUString AboutDialog::GetLocaleString()
osl_getProcessLocale( &pLocale );
- if ( pLocale && pLocale->Language && pLocale->Country )
+ if ( pLocale && pLocale->Language )
{
- pLocaleStr = OUString(pLocale->Language) + "_" + OUString(pLocale->Country);
+ if (pLocale->Country && rtl_uString_getLength( pLocale->Country) > 0)
+ pLocaleStr = OUString(pLocale->Language) + "_" + OUString(pLocale->Country);
+ else
+ pLocaleStr = OUString(pLocale->Language);
+ if (pLocale->Variant && rtl_uString_getLength( pLocale->Variant) > 0)
+ pLocaleStr += OUString(pLocale->Variant);
}
return pLocaleStr;