diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-04-23 17:15:57 +0100 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2021-04-27 21:55:02 +0200 |
commit | 66b3c3f63832f810bc75dc8366ad595d5796e05c (patch) | |
tree | 3dfb82906161aeb25a83d7e86615433f23681510 | |
parent | a521747c51eb77b03ffad8a212677bb1d32d042f (diff) |
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.grandin@collabora.co.uk>
-rw-r--r-- | sc/source/ui/navipi/content.cxx | 21 |
1 files changed, 10 insertions, 11 deletions
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(); |