diff options
author | Ivan Timofeev <timofeev.i.s@gmail.com> | 2013-08-18 21:43:52 +0400 |
---|---|---|
committer | Ivan Timofeev <timofeev.i.s@gmail.com> | 2013-08-18 21:44:00 +0400 |
commit | ca538f48e866b4eb69b498786d9030639cfe2ebd (patch) | |
tree | 6c88bc6e4ef2b4192ddd21f98b3a1131cd712a70 /cui | |
parent | b0f4295fdc411eaacf32bd41139da8eb08fe575b (diff) |
fix updating of initials for the Russians
i.e. replace hardcoded "2" by nInits var. For the Russians nInits == 3.
Also move the code block to the more appropriate place.
Change-Id: I1cbc6b14dc5e4c04516c0d3952920ee060c81afc
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/options/optgenrl.cxx | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/cui/source/options/optgenrl.cxx b/cui/source/options/optgenrl.cxx index a3f25e0f7986..5dacdf68a79e 100644 --- a/cui/source/options/optgenrl.cxx +++ b/cui/source/options/optgenrl.cxx @@ -361,17 +361,16 @@ IMPL_LINK( SvxGeneralTabPage, ModifyHdl_Impl, Edit *, pEdit ) { if (vFields[rNameRow.nFirstField + i]->pEdit == pEdit) nField = i; - // Since middle names are not supported, clear shortname if it - // contains a middle initial - if (OUString(rShortName.pEdit->GetText()).getLength() > 2) - { - rShortName.pEdit->SetText(OUString()); - } } // updating the initial if (nField < nInits && rShortName.pEdit->IsEnabled()) { OUString sShortName = rShortName.pEdit->GetText(); + // clear short name if it contains more characters than the number of initials + if ((unsigned)sShortName.getLength() > nInits) + { + rShortName.pEdit->SetText(OUString()); + } while ((unsigned)sShortName.getLength() < nInits) sShortName += OUString(' '); OUString sName = pEdit->GetText(); |