summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-04-23 17:15:57 +0100
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-04-25 16:41:05 +0200
commit59ec383c75837b017cd593adb2a85fba9b2970c5 (patch)
tree6eccb014b682a5ae0d6f5fdc12404517ca0af99f
parentc5d9d3a50ad8bfd39cbe498dc84cc2e51bbec686 (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.cxx21
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();