diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2019-09-24 21:22:30 +0200 |
---|---|---|
committer | Xisco FaulĂ <xiscofauli@libreoffice.org> | 2019-09-25 13:58:15 +0200 |
commit | c02b5cf6472ccb45a916369db493a40ed3e21d60 (patch) | |
tree | c9ddf6c84a273b110829e063a19ebc7b7e432f88 /sw/source/core/fields/authfld.cxx | |
parent | 472535a4f8aa95a17d996e96a67df60e72df7b32 (diff) |
tdf#107784: DOCX Import: Show citation's title in fields (2nd take)
Regression from 06f7d1a96eef5aa69d4872ff6d96eb5085296d09
The problem as I see it is that LibreOffice uses the identifier
plus optionals prefix and suffix to display the bibliographic
references.
On the other hand, MSO displays the title for references
starting with CITATION.
So do the same MSO does, when working with CITATION refs
We already add CITATION when we export to ooxml.
See case SwFieldIds::TableOfAuthorities in
AttributeOutputBase::TextField
Change-Id: I144f27f711926658c8b6f89e69f0ddeeb7e7890c
Reviewed-on: https://gerrit.libreoffice.org/79477
Tested-by: Jenkins
Reviewed-by: Xisco FaulĂ <xiscofauli@libreoffice.org>
Diffstat (limited to 'sw/source/core/fields/authfld.cxx')
-rw-r--r-- | sw/source/core/fields/authfld.cxx | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sw/source/core/fields/authfld.cxx b/sw/source/core/fields/authfld.cxx index 8c91051135f9..f6215b8cff9b 100644 --- a/sw/source/core/fields/authfld.cxx +++ b/sw/source/core/fields/authfld.cxx @@ -505,7 +505,14 @@ OUString SwAuthorityField::ConditionalExpandAuthIdentifier( { //TODO: Expand to: identifier, number sequence, ... if(m_xAuthEntry) - sRet += m_xAuthEntry->GetAuthorField(AUTH_FIELD_IDENTIFIER); + { + OUString sIdentifier(m_xAuthEntry->GetAuthorField(AUTH_FIELD_IDENTIFIER)); + // tdf#107784 Use title if it's a ooxml citation + if (sIdentifier.trim().startsWith("CITATION")) + return m_xAuthEntry->GetAuthorField(AUTH_FIELD_TITLE); + else + sRet += sIdentifier; + } } if(pAuthType->GetSuffix()) sRet += OUStringLiteral1(pAuthType->GetSuffix()); |