summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2021-06-12 18:57:51 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-06-13 13:18:59 +0200
commit07021596acb3d104ba129d371b1ae0b79f67a6a4 (patch)
treed99ee61d34889f56d7ff3a37f06a850420f3638d
parent93a3e2f86c27b06062708fe788963a0e49f3a90b (diff)
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>
-rw-r--r--unotools/source/config/useroptions.cxx7
1 files changed, 4 insertions, 3 deletions
diff --git a/unotools/source/config/useroptions.cxx b/unotools/source/config/useroptions.cxx
index 66f354ef5ae5..bf877b790392 100644
--- a/unotools/source/config/useroptions.cxx
+++ b/unotools/source/config/useroptions.cxx
@@ -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;
}