summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorJim Raykowski <raykowj@gmail.com>2022-01-21 23:19:09 -0900
committerJim Raykowski <raykowj@gmail.com>2022-01-22 22:49:15 +0100
commita903d114f8d67f266e12d129333fb35c04861ae2 (patch)
tree94ab3476e52038f9cd81e5396553b25c932b70c5 /sw
parentb2f2f7afce2ae711239bfe36deb20e6a3a6c0c0e (diff)
tdf#146490 SwNavigator: replace page number field expand field text
when field is in header/footer Change-Id: Ic11f020655a863d05e638e55db6ab150ce4ad7c2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128752 Tested-by: Jenkins Reviewed-by: Jim Raykowski <raykowj@gmail.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/inc/strings.hrc1
-rw-r--r--sw/source/uibase/utlui/content.cxx8
2 files changed, 8 insertions, 1 deletions
diff --git a/sw/inc/strings.hrc b/sw/inc/strings.hrc
index d5aaf979b66f..18d9b02081cb 100644
--- a/sw/inc/strings.hrc
+++ b/sw/inc/strings.hrc
@@ -415,6 +415,7 @@
#define STR_HIDDEN_CHANGES_DETAIL NC_("STR_HIDDEN_CHANGES_DETAIL", "Document contains tracked changes and recording is enabled.")
#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")
// 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 517b0a658814..90ef955e00d6 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -807,7 +807,13 @@ void SwContentType::FillMemberList(bool* pbLevelOrVisibilityChanged)
if (SwTextField* pTextField = pFormatField->GetTextField())
{
const SwField* pField = pFormatField->GetField();
- OUString sExpandField(pField->ExpandField(true, m_pWrtShell->GetLayout()));
+ OUString sExpandField;
+ // tdf#146490 page number field type in Header/Footer
+ if (pField->GetTypeId() == SwFieldTypesEnum::PageNumber &&
+ m_pWrtShell->GetDoc()->IsInHeaderFooter(pTextField->GetTextNode()))
+ sExpandField = SwResId(STR_HEADER_FOOTER);
+ else
+ sExpandField = pField->ExpandField(true, m_pWrtShell->GetLayout());
if (!sExpandField.isEmpty())
sExpandField = u" - " + sExpandField;
OUString sText = pField->GetDescription() + u" - " + pField->GetFieldName()