summaryrefslogtreecommitdiffstats
path: root/cui/source/options/optgenrl.cxx
diff options
context:
space:
mode:
authorIvan Timofeev <timofeev.i.s@gmail.com>2013-08-18 21:43:52 +0400
committerIvan Timofeev <timofeev.i.s@gmail.com>2013-08-18 21:44:00 +0400
commitca538f48e866b4eb69b498786d9030639cfe2ebd (patch)
tree6c88bc6e4ef2b4192ddd21f98b3a1131cd712a70 /cui/source/options/optgenrl.cxx
parentGetPageDescByName_Impl: move, rename and clean up (diff)
downloadcore-ca538f48e866b4eb69b498786d9030639cfe2ebd.tar.gz
core-ca538f48e866b4eb69b498786d9030639cfe2ebd.zip
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/source/options/optgenrl.cxx')
-rw-r--r--cui/source/options/optgenrl.cxx11
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();