tdf#142242 Forename imported with trailing space

Fix the case where there is only a name, and no surname.

Change-Id: If11078364924c8332b113e5650e7ea2b262a357a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117080
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin 2021-06-12 18:57:51 +02:00 committed by Noel Grandin
parent 93a3e2f86c
commit 07021596ac

View file

@ -222,7 +222,7 @@ OUString SvtUserOptions::Impl::GetFullName () const
sFullName += GetToken(UserOptToken::FathersName).trim();
if (!sFullName.isEmpty())
sFullName += " ";
sFullName += GetToken(UserOptToken::LastName).trim();
sFullName += GetToken(UserOptToken::LastName);
}
else
{
@ -231,16 +231,17 @@ OUString SvtUserOptions::Impl::GetFullName () const
sFullName = GetToken(UserOptToken::LastName).trim();
if (!sFullName.isEmpty())
sFullName += " ";
sFullName += GetToken(UserOptToken::FirstName).trim();
sFullName += GetToken(UserOptToken::FirstName);
}
else
{
sFullName = GetToken(UserOptToken::FirstName).trim();
if (!sFullName.isEmpty())
sFullName += " ";
sFullName += GetToken(UserOptToken::LastName).trim();
sFullName += GetToken(UserOptToken::LastName);
}
}
sFullName = sFullName.trim();
return sFullName;
}