localized GetFullName()
Change-Id: I4f2bffadef3db1bd07432202525734ab9b0cb0de
This commit is contained in:
parent
f285ac7c0a
commit
33c36fb9fb
1 changed files with 32 additions and 6 deletions
|
@ -18,7 +18,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <unotools/useroptions.hxx>
|
#include <unotools/useroptions.hxx>
|
||||||
|
#include <unotools/syslocale.hxx>
|
||||||
#include <unotools/configmgr.hxx>
|
#include <unotools/configmgr.hxx>
|
||||||
#include <com/sun/star/uno/Any.hxx>
|
#include <com/sun/star/uno/Any.hxx>
|
||||||
#include <com/sun/star/uno/Sequence.hxx>
|
#include <com/sun/star/uno/Sequence.hxx>
|
||||||
|
@ -37,6 +37,7 @@
|
||||||
#include <com/sun/star/util/ChangesEvent.hpp>
|
#include <com/sun/star/util/ChangesEvent.hpp>
|
||||||
#include <comphelper/configurationhelper.hxx>
|
#include <comphelper/configurationhelper.hxx>
|
||||||
#include <comphelper/processfactory.hxx>
|
#include <comphelper/processfactory.hxx>
|
||||||
|
#include <i18nlangtag/mslangid.hxx>
|
||||||
|
|
||||||
using namespace utl;
|
using namespace utl;
|
||||||
using namespace com::sun::star;
|
using namespace com::sun::star;
|
||||||
|
@ -194,11 +195,36 @@ void SvtUserOptions::Impl::SetToken (sal_uInt16 nToken, OUString const& sToken)
|
||||||
|
|
||||||
OUString SvtUserOptions::Impl::GetFullName () const
|
OUString SvtUserOptions::Impl::GetFullName () const
|
||||||
{
|
{
|
||||||
// TODO international name
|
OUString sFullName;
|
||||||
OUString sFullName = GetToken(USER_OPT_FIRSTNAME).trim();
|
switch (LanguageType const eLang = SvtSysLocale().GetUILanguageTag().getLanguageType())
|
||||||
if (!sFullName.isEmpty())
|
{
|
||||||
sFullName += " ";
|
case LANGUAGE_RUSSIAN:
|
||||||
sFullName += GetToken(USER_OPT_LASTNAME).trim();
|
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;
|
return sFullName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue