[Libreoffice-commits] core.git: sw/source
Jim Raykowski (via logerrit)
logerrit at kemper.freedesktop.org
Fri Oct 1 01:22:04 UTC 2021
sw/source/uibase/utlui/content.cxx | 28 ++++++++--------------------
1 file changed, 8 insertions(+), 20 deletions(-)
New commits:
commit 9a3d2258420c4c1cc322b4f1317317dcd7c0b1a1
Author: Jim Raykowski <raykowj at gmail.com>
AuthorDate: Wed Sep 29 17:12:54 2021 -0800
Commit: Jim Raykowski <raykowj at gmail.com>
CommitDate: Fri Oct 1 03:21:26 2021 +0200
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 at gmail.com>
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();
More information about the Libreoffice-commits
mailing list