Created attachment 95957 [details] Test case Steps to reproduce: 1. Open the attached file. 2. Save as a docx. 3. Reload it (File -> Reload). 4. The citation [ARJ00] becomes [[ARJ00]]. 5. If you open with Word, the citation becomes "ARJ00]". Cause: In the saved document the citation looks like this: <w:t>ARJ00]</w:t> Probably the additional brackets in step 5 are added by the importer, in any case there is an error in the exporter.
Reproducible, tested using Windows 8.1 with LibreOffice Version: 4.3.0.0.alpha0+ Build ID: 87efec9cc27b18aa09e50c289b503ba1127eb0b8 TinderBox: Win-x86@39, Branch:master, Time: 2014-03-18_02:50:50 Kind regards, Joren
There are some unbalanced ifs in the code of SwAuthorityField::ConditionalExpand: if(pAuthType->GetPrefix() && eField != AUTH_FIELD_TITLE) sRet = OUString(pAuthType->GetPrefix()); // adds [ ... sRet += pEntry->GetAuthorField(AUTH_FIELD_IDENTIFIER); ... if(pAuthType->GetSuffix()) sRet += OUString(pAuthType->GetSuffix()); // adds ] Obviously, they should have the same condition. The change as introduced in commit 06f7d1a96eef5aa69d4872ff6d96eb5085296d09, I'm not sure why we should remove the brackets when exporting to .docx, but I will at least rebalance the ifs.
Jacobo Aragunde Perez committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=0ed60a973753d143158c5b17c781bac07bfc3827 fdo#76281: Fix wrong square brackets in exported citations 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.
Jacobo Aragunde Perez committed a patch related to this issue. It has been pushed to "libreoffice-4-3": http://cgit.freedesktop.org/libreoffice/core/commit/?id=729ad1210c6c55eece7550e43437b9cb2c8fded3&h=libreoffice-4-3 fdo#76281: Fix wrong square brackets in exported citations It will be available in LibreOffice 4.3. 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.