summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Raykowski <raykowj@gmail.com>2022-02-17 23:37:25 -0900
committerJim Raykowski <raykowj@gmail.com>2022-02-24 04:33:35 +0100
commit5693f0caa0bb589696ac36b9e0ca42b5e26924d0 (patch)
tree990b91d2ad4c311f6250a72742106d380c8f268c
parent21b5d6e0dce7c2034aded96d1499da27094e2781 (diff)
tdf#146490 SwNavigator: don't show fields that are in header footer area
Fields that are in the header footer area don't behave well when included in the Navigators fields members list. This patch make it so they are are not included. Change-Id: I99be944a08a9177676098f30d47ba56dea2b7441 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130126 Tested-by: Jenkins Reviewed-by: Jim Raykowski <raykowj@gmail.com>
-rw-r--r--sw/source/uibase/utlui/content.cxx11
1 files changed, 4 insertions, 7 deletions
diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx
index 46394dd0ce24..89b641a7e1ae 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -591,13 +591,10 @@ void SwContentType::FillMemberList(bool* pbContentChanged)
if (SwTextField* pTextField = pFormatField->GetTextField())
{
const SwField* pField = pFormatField->GetField();
- 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());
+ // fields in header footer don't behave well, skip them
+ if (m_pWrtShell->GetDoc()->IsInHeaderFooter(pTextField->GetTextNode()))
+ continue;
+ OUString sExpandField = pField->ExpandField(true, m_pWrtShell->GetLayout());
if (!sExpandField.isEmpty())
sExpandField = u" - " + sExpandField;
OUString sText = pField->GetDescription() + u" - " + pField->GetFieldName()