From 5a907fe76bc628629fddb5501727642468d38dae Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 21 Mar 2019 14:56:00 +0000 Subject: fix db field page database refresh MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I87e18e8624d63de18bd6e0d68eececab75e7166b Reviewed-on: https://gerrit.libreoffice.org/69527 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- sw/source/uibase/dbui/dbtree.cxx | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'sw/source/uibase/dbui/dbtree.cxx') diff --git a/sw/source/uibase/dbui/dbtree.cxx b/sw/source/uibase/dbui/dbtree.cxx index 444ba7b54ec9..a0fb9e06af4d 100644 --- a/sw/source/uibase/dbui/dbtree.cxx +++ b/sw/source/uibase/dbui/dbtree.cxx @@ -318,19 +318,20 @@ OUString SwDBTreeList::GetDBName(OUString& rTableName, OUString& rColumnName, sa { OUString sDBName; std::unique_ptr xIter(m_xTreeView->make_iterator()); - if (m_xTreeView->get_selected(xIter.get()) && m_xTreeView->get_iter_depth(*xIter)) + if (m_xTreeView->get_selected(xIter.get())) { - if (m_xTreeView->get_iter_depth(*xIter) > 1) + if (m_xTreeView->get_iter_depth(*xIter) == 2) { rColumnName = m_xTreeView->get_text(*xIter); m_xTreeView->iter_parent(*xIter); // column name was selected } - if (pbIsTable) + if (m_xTreeView->get_iter_depth(*xIter) == 1) { - *pbIsTable = m_xTreeView->get_id(*xIter).isEmpty(); + if (pbIsTable) + *pbIsTable = m_xTreeView->get_id(*xIter).isEmpty(); + rTableName = m_xTreeView->get_text(*xIter); + m_xTreeView->iter_parent(*xIter); } - rTableName = m_xTreeView->get_text(*xIter); - m_xTreeView->iter_parent(*xIter); sDBName = m_xTreeView->get_text(*xIter); } return sDBName; @@ -348,7 +349,10 @@ void SwDBTreeList::Select(const OUString& rDBName, const OUString& rTableName, c if (rDBName == m_xTreeView->get_text(*xParent)) { if (!m_xTreeView->iter_has_child(*xParent)) + { + RequestingChildrenHdl(*xParent); m_xTreeView->expand_row(*xParent); + } std::unique_ptr xChild(m_xTreeView->make_iterator(xParent.get())); if (!m_xTreeView->iter_children(*xChild)) continue; @@ -362,7 +366,10 @@ void SwDBTreeList::Select(const OUString& rDBName, const OUString& rTableName, c if (bShowColumns && !rColumnName.isEmpty()) { if (!m_xTreeView->iter_has_child(*xParent)) + { + RequestingChildrenHdl(*xParent); m_xTreeView->expand_row(*xParent); + } bNoChild = true; if (m_xTreeView->iter_children(*xChild)) -- cgit