From 5693f0caa0bb589696ac36b9e0ca42b5e26924d0 Mon Sep 17 00:00:00 2001 From: Jim Raykowski Date: Thu, 17 Feb 2022 23:37:25 -0900 Subject: 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 --- sw/source/uibase/utlui/content.cxx | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'sw/source/uibase/utlui') 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() -- cgit