summaryrefslogtreecommitdiff
path: root/unotools
diff options
context:
space:
mode:
authorAndras Timar <andras.timar@collabora.com>2014-07-09 11:44:32 +0200
committerAndras Timar <andras.timar@collabora.com>2014-07-10 11:11:13 +0200
commit8196454b0e6fd1d48d6d862ac3207f36abb869e2 (patch)
tree0a36f4d1e0ae2b95ac22d396e305a36b3f94a454 /unotools
parentcbe1e2e735ca4f90cff32986b415d3e7fea52b07 (diff)
localized GetFullName()
Change-Id: I4f2bffadef3db1bd07432202525734ab9b0cb0de (cherry picked from commit 33c36fb9fbc69bbc32088532dd21db7153aee09d)
Diffstat (limited to 'unotools')
-rw-r--r--unotools/source/config/useroptions.cxx38
1 files changed, 32 insertions, 6 deletions
diff --git a/unotools/source/config/useroptions.cxx b/unotools/source/config/useroptions.cxx
index 01ae9e69bfde..1dadaf3faa55 100644
--- a/unotools/source/config/useroptions.cxx
+++ b/unotools/source/config/useroptions.cxx
@@ -19,7 +19,7 @@
#include <unotools/useroptions.hxx>
-
+#include <unotools/syslocale.hxx>
#include <unotools/configmgr.hxx>
#include <com/sun/star/uno/Any.hxx>
#include <com/sun/star/uno/Sequence.hxx>
@@ -39,6 +39,7 @@
#include <com/sun/star/util/ChangesEvent.hpp>
#include <comphelper/configurationhelper.hxx>
#include <comphelper/processfactory.hxx>
+#include <i18nlangtag/mslangid.hxx>
using namespace utl;
using namespace com::sun::star;
@@ -210,11 +211,36 @@ void SvtUserOptions::Impl::SetToken (sal_uInt16 nToken, OUString const& sToken)
OUString SvtUserOptions::Impl::GetFullName () const
{
- // TODO international name
- OUString sFullName = GetToken(USER_OPT_FIRSTNAME).trim();
- if (!sFullName.isEmpty())
- sFullName += " ";
- sFullName += GetToken(USER_OPT_LASTNAME).trim();
+ OUString sFullName;
+ switch (LanguageType const eLang = SvtSysLocale().GetUILanguageTag().getLanguageType())
+ {
+ case LANGUAGE_RUSSIAN:
+ sFullName = GetToken(USER_OPT_FIRSTNAME).trim();
+ if (!sFullName.isEmpty())
+ sFullName += " ";
+ sFullName += GetToken(USER_OPT_FATHERSNAME).trim();
+ if (!sFullName.isEmpty())
+ sFullName += " ";
+ sFullName += GetToken(USER_OPT_LASTNAME).trim();
+ break;
+ default:
+ if (MsLangId::isFamilyNameFirst(eLang))
+ {
+ sFullName = GetToken(USER_OPT_LASTNAME).trim();
+ if (!sFullName.isEmpty())
+ sFullName += " ";
+ sFullName += GetToken(USER_OPT_FIRSTNAME).trim();
+ }
+ else
+ {
+ sFullName = GetToken(USER_OPT_FIRSTNAME).trim();
+ if (!sFullName.isEmpty())
+ sFullName += " ";
+ sFullName += GetToken(USER_OPT_LASTNAME).trim();
+ }
+ break;
+ }
+
return sFullName;
}