sw/source/uibase/utlui/content.cxx | 3 ++- sw/source/uibase/utlui/navipi.cxx | 1 + 2 files changed, 3 insertions(+), 1 deletion(-)
New commits: commit 7684e31b16408b8a2f36ea2aa733d45bd40f5bc6 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Mon Mar 28 20:57:41 2022 +0100 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Tue Mar 29 10:21:25 2022 +0200 cid#1503287 silence Unchecked dynamic_cast Change-Id: Id7c6c1ecbfc88c97d5211826fa2d831344dc795c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132245 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/sw/source/uibase/utlui/navipi.cxx b/sw/source/uibase/utlui/navipi.cxx index 3d9f8f73394c..669234d6bcf7 100644 --- a/sw/source/uibase/utlui/navipi.cxx +++ b/sw/source/uibase/utlui/navipi.cxx @@ -541,6 +541,7 @@ SwNavigationPI::SwNavigationPI(weld::Widget* pParent, m_xContent2Dispatch->GetControllerForCommand(".uno:NavElement"); NavElementToolBoxControl* pToolBoxControl = dynamic_cast<NavElementToolBoxControl*>(xController.get()); + assert(pToolBoxControl); m_pNavigateByComboBox = pToolBoxControl->GetComboBox(); // Restore content tree settings before calling UpdateInitShow. UpdateInitShow calls Fillbox, commit 1f83834bd0d78232762f7467a65ebdf0d4b9f7fa Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Mon Mar 28 20:55:41 2022 +0100 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Tue Mar 29 10:21:10 2022 +0200 cid#1503286 Unchecked return value Change-Id: I701039be73405e354fc64bd6a81999aff44e9e0f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132244 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index fa5e28167be0..36f7801f375a 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -4532,7 +4532,8 @@ IMPL_LINK_NOARG(SwContentTree, SelectHdl, weld::TreeView&, void) return; // Select the content type in the Navigate By control std::unique_ptr<weld::TreeIter> xEntry(m_xTreeView->make_iterator()); - m_xTreeView->get_selected(xEntry.get()); + if (!m_xTreeView->get_selected(xEntry.get())) + return; while (m_xTreeView->get_iter_depth(*xEntry)) m_xTreeView->iter_parent(*xEntry); m_pDialog->SelectNavigateByContentType(m_xTreeView->get_text(*xEntry));