Created attachment 54093 [details] initials field incorrectly displays ANN, Mac , libo 3.4.4 In Options (Preferences on Mac) user may input or update first name and last name fields and on field change (eg with Tab key) the Initials field is calculated and updated. When initials are not a 2 letter string incorrect initials are populated. As noted in #30862 the field is too narrow to see this until it's scrolled (screenshot attached). Reproduction: In User Data fields of Options/Preferences input initials directly (eg 'ADN') and update First Name (gn) or Last Name (sn) fields directly (eg 'Adric', 'Net'). Initials field is updated to incorrect value 'ANN" rather than 'AN' or 'ADN'. I've seen this in these builds: LibreOffice 3.4.4 OOO340m1 (Build:402) Mac OS X Lion 10.7.2 (Intel 64bit) LibreOffice 3.4.4 OOO340m1 (Build:402) Ubuntu 11.10 (Intel 32bit) Although this is a trivial display concern easily worked-around it demonstrates that a assumption made by the software is incorrect. The behaviour I see suggests that the second character of the string in the Initials field is updated when a new Last name (sn) is input rather than clearing the field and drawing a new correct value.
I would like to take a shot at fixing this bug. It would be my first bugfix for LO, and after poking around in the code, I think I have an idea. In file cui/source/options/optgenrl.cxx, method ModifyHdl_Impl(), I will check to see if the initials field is three characters. If it is, I will clear the field before it is updated.
Took a bit of time to get set up to push patches directly, but I submitted the fix today.
To reproduce the bug in existing code: 1. Click Tools > Options; 2. Navigate to LibreOffice > User Data; 3. Enter "ALB" (without quotes) in the initials field; 4. In the first name field, enter "Adam" (without quotes); 5. In the last name field, enter "Bucky" (without quotes); 6. Observe that the initials now contains "ABB"; the middle initial of "L" has been overwritten. After my change: 1. Click Tools > Options; 2. Navigate to LibreOffice > User Data; 3. Enter "ALB" (without quotes) in the initials field; 4. In the first name field, enter "Adam" (without quotes); 5. Observe that the initials field now contains an "A"; 6. In the last name field, enter "Bucky" (without quotes); 7. Observe that the initials field now contains an "AB". What I am changing: Instead of letting the initials field contain the invalid "ABB" (which ignores the middle initial), I cleared out the initials field completely.
Chris Copits committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=3610d36782ca30aa6478921bcf331dcd7a554efb fdo#43497 Editing the first or last name clears initials. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.