diff options
author | Jim Raykowski <raykowj@gmail.com> | 2021-09-29 17:12:54 -0800 |
---|---|---|
committer | Jim Raykowski <raykowj@gmail.com> | 2021-10-01 03:21:26 +0200 |
commit | 9a3d2258420c4c1cc322b4f1317317dcd7c0b1a1 (patch) | |
tree | d60244ea7260b0403907068c4fa45bd5e48fc57a /sw | |
parent | c2de581d1943df2d84f2b71817b6a8bee41f0217 (diff) |
Writer Navigator: Make fields always show in the content tree
Currently, a field that is not visible, for example, when in folded
outline content or a hidden section, is not shown under the Fields
category. This patch changes the behavior to always show the field.
Change-Id: Iea85a2c69df68bb0d37e8d94662d3ca9c81b0e41
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122842
Tested-by: Jenkins
Reviewed-by: Jim Raykowski <raykowj@gmail.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/uibase/utlui/content.cxx | 28 |
1 files changed, 8 insertions, 20 deletions
diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index 954ac752c22f..6e944bb11669 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -403,17 +403,11 @@ void SwContentType::Init(bool* pbInvalidateWindow) pFieldType->GatherFields(vFields); for (SwFormatField* pFormatField: vFields) { - if (SwTextField* pTextField = pFormatField->GetTextField()) - { - const SwTextNode& rTextNode = pTextField->GetTextNode(); - const SwContentFrame* pCFrame = - rTextNode.getLayoutFrame(rTextNode.GetDoc().getIDocumentLayoutAccess().GetCurrentLayout()); - if (pCFrame) - m_nMemberCount++; - } + if (pFormatField->GetTextField()) + m_nMemberCount++; } } - } + } break; case ContentTypeId::BOOKMARK: { @@ -786,17 +780,9 @@ void SwContentType::FillMemberList(bool* pbLevelOrVisibilityChanged) if (SwTextField* pTextField = pFormatField->GetTextField()) { const SwTextNode& rTextNode = pTextField->GetTextNode(); - const SwContentFrame* pCFrame = - rTextNode.getLayoutFrame(rTextNode.GetDoc(). - getIDocumentLayoutAccess(). - GetCurrentLayout()); - if (pCFrame) - { - std::unique_ptr<SetGetExpField> - pNew(new SetGetExpField(SwNodeIndex(rTextNode), - pTextField)); - aSrtLst.insert(std::move(pNew)); - } + std::unique_ptr<SetGetExpField> + pNew(new SetGetExpField(SwNodeIndex(rTextNode), pTextField)); + aSrtLst.insert(std::move(pNew)); } } } @@ -852,6 +838,8 @@ void SwContentType::FillMemberList(bool* pbLevelOrVisibilityChanged) } std::unique_ptr<SwTextFieldContent> pCnt(new SwTextFieldContent(this, sText, &rFormatField, i)); + if (!pTextField->GetTextNode().getLayoutFrame(m_pWrtShell->GetLayout())) + pCnt->SetInvisible(); m_pMember->insert(std::move(pCnt)); } m_nMemberCount = m_pMember->size(); |