[Libreoffice-commits] core.git: sw/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Fri May 21 18:54:02 UTC 2021


 sw/source/uibase/dbui/dbtree.cxx |    2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 89cc421a6b246df36415fc3fbbec00435ffc5a85
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Fri May 21 16:46:23 2021 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Fri May 21 20:53:24 2021 +0200

    tdf#142294 drop placeholder on-demand node on directly populating node
    
    Initially there's a <placeholder> entry to indicate the load-on-demand
    state.  It needs to be there for the expander indicator to be
    drawn/shown when there are no "real" entries yet.
    
    Typically the user clicks on the expander, the expansion remove the
    <placeholder> entry and calls the provided expander-callback which has
    the change to populate the node.
    
    Here RequestingChildrenHdl is the expander-callback (set via
    connect_expanding) and populates the node like it should.
    
    But then there are two places where it is called directly outside the
    expander-callback so it merrily appends entries into the node, but
    because it's called outside the expander-callback the <placeholder>
    entry was never removed which is then a problem because of the resulting
    inconsistency.
    
    Change-Id: Ie7d034e3f41832591438127c82eba85deb610952
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115949
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sw/source/uibase/dbui/dbtree.cxx b/sw/source/uibase/dbui/dbtree.cxx
index 469a69968d74..8b3692f8da31 100644
--- a/sw/source/uibase/dbui/dbtree.cxx
+++ b/sw/source/uibase/dbui/dbtree.cxx
@@ -342,6 +342,7 @@ void SwDBTreeList::Select(std::u16string_view rDBName, std::u16string_view rTabl
             }
             if (!m_xTreeView->iter_has_child(*xParent))
             {
+                m_xTreeView->set_children_on_demand(*xParent, false); // tdf#142294 drop placeholder on-demand node
                 RequestingChildrenHdl(*xParent);
                 // If successful, it will be expanded in a call to scroll_to_row for its children
             }
@@ -363,6 +364,7 @@ void SwDBTreeList::Select(std::u16string_view rDBName, std::u16string_view rTabl
                     {
                         if (!m_xTreeView->iter_has_child(*xParent))
                         {
+                            m_xTreeView->set_children_on_demand(*xParent, false); // tdf#142294 drop placeholder on-demand node
                             RequestingChildrenHdl(*xParent);
                             m_xTreeView->expand_row(*xParent);
                         }


More information about the Libreoffice-commits mailing list