summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Raykowski <raykowj@gmail.com>2022-04-15 16:48:02 -0800
committerJim Raykowski <raykowj@gmail.com>2022-04-17 05:21:25 +0200
commit8f27cde891cc925d5ff76a736fb54dd70e53b4ee (patch)
treea6e534629be3b1c1c3730fef91525ef3971832ba
parentf7102dafc44a66b8ffb7b8d516fe1720fc45f8fe (diff)
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 <raykowj@gmail.com>
-rw-r--r--sw/inc/strings.hrc2
-rw-r--r--sw/source/uibase/utlui/content.cxx19
2 files changed, 19 insertions, 2 deletions
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()))