[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - sc/source
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Sun Apr 25 14:41:40 UTC 2021
sc/source/ui/navipi/content.cxx | 21 ++++++++++-----------
1 file changed, 10 insertions(+), 11 deletions(-)
New commits:
commit 59ec383c75837b017cd593adb2a85fba9b2970c5
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Fri Apr 23 17:15:57 2021 +0100
Commit: Noel Grandin <noel.grandin at 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.grandin at 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();
More information about the Libreoffice-commits
mailing list