sw/inc/strings.hrc | 2 ++ sw/source/uibase/utlui/content.cxx | 19 +++++++++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-)
New commits: commit 8f27cde891cc925d5ff76a736fb54dd70e53b4ee Author: Jim Raykowski <rayk...@gmail.com> AuthorDate: Fri Apr 15 16:48:02 2022 -0800 Commit: Jim Raykowski <rayk...@gmail.com> CommitDate: Sun Apr 17 05:21:25 2022 +0200 tdf#148237 Show 'Footnote' and 'Endnote' as field name for field cross references to footnotes and endnotes Change-Id: Ie1828c9c4ec0c3c8159c8e5653b09b2b7bd8a5e3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133092 Tested-by: Jenkins Reviewed-by: Jim Raykowski <rayk...@gmail.com> diff --git a/sw/inc/strings.hrc b/sw/inc/strings.hrc index b534cb115b80..1258f55801af 100644 --- a/sw/inc/strings.hrc +++ b/sw/inc/strings.hrc @@ -416,6 +416,8 @@ #define STR_HIDDEN_CHANGES_DETAIL2 NC_("STR_HIDDEN_CHANGES_DETAIL2", "Recording of changes is enabled.") #define STR_HIDDEN_CHANGES_DETAIL3 NC_("STR_HIDDEN_CHANGES_DETAIL3", "Document contains tracked changes.") #define STR_HEADER_FOOTER NC_("STR_HEADER_FOOTER", "Header/Footer") +#define STR_FLDREF_FOOTNOTE NC_("STR_FLDREF_FOOTNOTE", "Footnote") +#define STR_FLDREF_ENDNOTE NC_("STR_FLDREF_ENDNOTE", "Endnote") // Undo #define STR_CANT_UNDO NC_("STR_CANT_UNDO", "not possible") diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index 05e9eabfbdca..02b07633f531 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -602,8 +602,7 @@ void SwContentType::FillMemberList(bool* pbContentChanged) OUString sExpandField = pField->ExpandField(true, m_pWrtShell->GetLayout()); if (!sExpandField.isEmpty()) sExpandField = u" - " + sExpandField; - OUString sText = pField->GetDescription() + u" - " + pField->GetFieldName() - + sExpandField; + OUString sText; if (pField->GetTypeId() == SwFieldTypesEnum::DocumentStatistics) { OUString sSubType; @@ -612,6 +611,22 @@ void SwContentType::FillMemberList(bool* pbContentChanged) sText = pField->GetDescription() + u" - " + pField->GetFieldName() + sSubType + sExpandField; } + else if (pField->GetTypeId() == SwFieldTypesEnum::GetRef) + { + OUString sFieldSubTypeOrName; + auto nSubType = pField->GetSubType(); + if (nSubType == REF_FOOTNOTE) + sFieldSubTypeOrName = SwResId(STR_FLDREF_FOOTNOTE); + else if (nSubType == REF_ENDNOTE) + sFieldSubTypeOrName = SwResId(STR_FLDREF_ENDNOTE); + else + sFieldSubTypeOrName = pField->GetFieldName(); + sText = pField->GetDescription() + u" - " + sFieldSubTypeOrName + + sExpandField; + } + else + sText = pField->GetDescription() + u" - " + pField->GetFieldName() + + sExpandField; auto pCnt(std::make_unique<SwTextFieldContent>(this, sText, pFormatField, m_bAlphabeticSort ? 0 : pTextField->GetTextNode().GetIndex().get())); if (!pTextField->GetTextNode().getLayoutFrame(m_pWrtShell->GetLayout()))