summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-10-07 15:21:52 +0100
committerCaolán McNamara <caolanm@redhat.com>2020-10-07 18:32:52 +0200
commit242e90f16bc23eb85941b0bf13c5350375ce3837 (patch)
tree67ddc311288e0c9375f4c209589ba25747d4d75f
parented8df0ec6ed1af600a4d31223d5bfc3f65c5d7ba (diff)
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/+/104061 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--sw/source/uibase/utlui/content.cxx9
1 files changed, 5 insertions, 4 deletions
diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx
index 56c39fa7b25b..626e5354f01d 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -2556,8 +2556,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;
}
@@ -2565,7 +2566,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)));
@@ -2585,8 +2586,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))