sw/source/uibase/utlui/content.cxx |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

New commits:
commit af26393963ed2ed19607d3f0cb42c0c6243d25c3
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Wed Oct 7 15:21:52 2020 +0100
Commit:     Michael Stahl <michael.st...@cib.de>
CommitDate: Thu Oct 8 10:15:27 2020 +0200

    Resolves: tdf#137274 comment node not expandable when there are comments
    
    if it was opened and closed before deleting (or undoing thereof) comments
    
    If the node is currently not expanded, but it was previously expanded, then 
it
    is not filled-on-demand because it is already filled.
    
    If the content it tracks has changed, remove its current children and set 
it to
    filled-on-demand if there would be a non-zero set of new children
    
    Change-Id: Ic8eafea7f298d285d1e6c4a60cb21b57a971bd86
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103980
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.st...@cib.de>

diff --git a/sw/source/uibase/utlui/content.cxx 
b/sw/source/uibase/utlui/content.cxx
index 44ce6c197a9e..4729818da11f 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -2377,8 +2377,9 @@ bool SwContentTree::HasContentChanged()
                     // i.e. in header/footer
                     pArrType->FillMemberList(&bLevelOrVisibilityChanged);
                     bool bRemoveChildren = false;
-                    const size_t nChildCount = GetChildCount(*xEntry);
-                    if (nChildCount != pArrType->GetMemberCount())
+                    const size_t nOldChildCount = GetChildCount(*xEntry);
+                    const size_t nNewChildCount = pArrType->GetMemberCount();
+                    if (nOldChildCount != nNewChildCount)
                     {
                         bRemoveChildren = true;
                     }
@@ -2386,7 +2387,7 @@ bool SwContentTree::HasContentChanged()
                     {
                         std::unique_ptr<weld::TreeIter> 
xChild(m_xTreeView->make_iterator(xEntry.get()));
                         (void)m_xTreeView->iter_children(*xChild);
-                        for (size_t j = 0; j < nChildCount; ++j)
+                        for (size_t j = 0; j < nOldChildCount; ++j)
                         {
                             const SwContent* pCnt = pArrType->GetMember(j);
                             OUString 
sSubId(OUString::number(reinterpret_cast<sal_Int64>(pCnt)));
@@ -2406,8 +2407,8 @@ bool SwContentTree::HasContentChanged()
                             remove(*xRemove);
                             m_xTreeView->copy_iterator(*xEntry, *xRemove);
                         }
+                        m_xTreeView->set_children_on_demand(*xEntry, 
nNewChildCount != 0);
                     }
-                    m_xTreeView->set_children_on_demand(*xEntry, !nChildCount);
                 }
                 else if((nCntCount != 0)
                             != (pArrType->GetMemberCount()!=0))
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to