sw/source/uibase/utlui/content.cxx | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-)
New commits: commit 5693f0caa0bb589696ac36b9e0ca42b5e26924d0 Author: Jim Raykowski <rayk...@gmail.com> AuthorDate: Thu Feb 17 23:37:25 2022 -0900 Commit: Jim Raykowski <rayk...@gmail.com> CommitDate: Thu Feb 24 04:33:35 2022 +0100 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 <rayk...@gmail.com> 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()