sw/source/uibase/utlui/content.cxx |   14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

New commits:
commit 9ae74207e02d3a0ecc8f360720eb4e1c14bba0d3
Author:     Jim Raykowski <rayk...@gmail.com>
AuthorDate: Wed Feb 23 12:16:35 2022 -0900
Commit:     Jim Raykowski <rayk...@gmail.com>
CommitDate: Sun Mar 13 19:55:46 2022 +0100

    SwNavigator: Gray out Comments members not visible in the document
    
    Grays out comment members in the Navigator Comments member list that
    are in hidden sections and folded outline content. Not showing comment
    annotation windows will not cause comment member graying. The patch
    also fixes comments sometimes not showing in the member list after
    document load due to the document layout of comments not being
    completed before the comment content array is initially filled.
    
    Change-Id: Id3ac664480c36f1a3d072f7658cc9269a55b70aa
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130471
    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 1791887b1f43..6a4bf1d9456d 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -779,8 +779,7 @@ void SwContentType::FillMemberList(bool* pbContentChanged)
                 {
                     if (const SwFormatField* pFormatField = dynamic_cast<const 
SwFormatField *>((*i)->GetBroadcaster())) // SwPostit
                     {
-                        if (pFormatField->GetTextField() && 
pFormatField->IsFieldInDoc() &&
-                            (*i)->mLayoutStatus!=SwPostItHelper::INVISIBLE )
+                        if (pFormatField->GetTextField() && 
pFormatField->IsFieldInDoc())
                         {
                             OUString sEntry = 
pFormatField->GetField()->GetPar2();
                             sEntry = RemoveNewline(sEntry);
@@ -789,6 +788,17 @@ void SwContentType::FillMemberList(bool* pbContentChanged)
                                                 sEntry,
                                                 pFormatField,
                                                 nYPos));
+                            if 
(!pFormatField->GetTextField()->GetTextNode().getLayoutFrame(
+                                        m_pWrtShell->GetLayout()))
+                                pCnt->SetInvisible();
+                            if (pOldMember)
+                            {
+                                assert(pbContentChanged && "pbContentChanged 
is always set if pOldMember is");
+                                if (!*pbContentChanged &&
+                                        nOldMemberCount > 
o3tl::make_unsigned(nYPos) &&
+                                        (*pOldMember)[nYPos]->IsInvisible() != 
pCnt->IsInvisible())
+                                    *pbContentChanged = true;
+                            }
                             m_pMember->insert(std::move(pCnt));
                             nYPos++;
                         }

Reply via email to