sc/source/ui/navipi/content.cxx | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-)
New commits: commit 59ec383c75837b017cd593adb2a85fba9b2970c5 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Fri Apr 23 17:15:57 2021 +0100 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Sun Apr 25 16:41:05 2021 +0200 Related: tdf#130326: GetDrawNames doesn't do anything when !bisInNavigatoeDlg so return early instead of looping to do nothing Change-Id: Ibb8fe1409a8e66d37d51d9a1b99ce135f36b9522 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114589 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/sc/source/ui/navipi/content.cxx b/sc/source/ui/navipi/content.cxx index 9383f343bfc0..9ec35128176b 100644 --- a/sc/source/ui/navipi/content.cxx +++ b/sc/source/ui/navipi/content.cxx @@ -863,6 +863,9 @@ bool ScContentTree::IsPartOfType( ScContentId nContentType, sal_uInt16 nObjIdent void ScContentTree::GetDrawNames( ScContentId nType ) { + if (!bisInNavigatoeDlg) + return; + if ( nRootType != ScContentId::ROOT && nRootType != nType ) // hidden ? return; @@ -894,19 +897,15 @@ void ScContentTree::GetDrawNames( ScContentId nType ) OUString aName = ScDrawLayer::GetVisibleName( pObject ); if (!aName.isEmpty()) { - if( bisInNavigatoeDlg ) + weld::TreeIter* pParent = m_aRootNodes[nType].get(); + if (pParent) { - weld::TreeIter* pParent = m_aRootNodes[nType].get(); - if (pParent) - { - m_xTreeView->insert(pParent, -1, &aName, nullptr, nullptr, nullptr, false, m_xScratchIter.get()); - m_xTreeView->set_sensitive(*m_xScratchIter, true); - }//end if parent - else - SAL_WARN("sc", "InsertContent without parent"); - } + m_xTreeView->insert(pParent, -1, &aName, nullptr, nullptr, nullptr, false, m_xScratchIter.get()); + m_xTreeView->set_sensitive(*m_xScratchIter, true); + }//end if parent + else + SAL_WARN("sc", "InsertContent without parent"); } - } pObject = aIter.Next(); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits