From 857fe51bc8f2d3f3535807a69399c7e2fee971ae Mon Sep 17 00:00:00 2001 From: Jim Raykowski Date: Thu, 11 Apr 2024 17:50:16 -0800 Subject: SwContentTree: remove repeated pointer assignment The selected entry does not change within the CommandHdl function therefore assignment of the pointer to the selected entry SwContentType does not need to be repeated elsewhere in the function. Change-Id: I025ecb9259e2ee46a64d55c75d0c3f3c8cc625ce Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166018 Tested-by: Jenkins Reviewed-by: Jim Raykowski --- sw/source/uibase/utlui/content.cxx | 33 ++++++++++++--------------------- 1 file changed, 12 insertions(+), 21 deletions(-) (limited to 'sw/source/uibase/utlui') diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index 8e301753b236..9e80e06c3292 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -1941,31 +1941,22 @@ IMPL_LINK(SwContentTree, CommandHdl, const CommandEvent&, rCEvt, bool) } else { - if (lcl_IsContentType(*xEntry, *m_xTreeView)) - pType = weld::fromId(m_xTreeView->get_id(*xEntry)); - else - pType = weld::fromId( - m_xTreeView->get_id(*xEntry))->GetParent(); - if (pType) + if (ContentTypeId::OUTLINE == nContentType) { - if (ContentTypeId::OUTLINE == nContentType) + bOutline = true; + if (State::HIDDEN != m_eState) { - bOutline = true; - if (State::HIDDEN != m_eState) - { - lcl_SetOutlineContentEntriesSensitivities(this, *m_xTreeView, *xEntry, - *xSubPopOutlineContent); - bRemoveSendOutlineEntry = false; - } - bRemoveToggleExpandEntry = lcl_InsertExpandCollapseAllItem(*m_xTreeView, *xEntry, - *xPop); + lcl_SetOutlineContentEntriesSensitivities(this, *m_xTreeView, *xEntry, + *xSubPopOutlineContent); + bRemoveSendOutlineEntry = false; } - else if (State::HIDDEN != m_eState && - nContentType == ContentTypeId::POSTIT && - !m_pActiveShell->GetView().GetDocShell()->IsReadOnly() && - pType->GetMemberCount() > 0) - bRemovePostItEntries = false; + bRemoveToggleExpandEntry + = lcl_InsertExpandCollapseAllItem(*m_xTreeView, *xEntry, *xPop); } + else if (State::HIDDEN != m_eState && nContentType == ContentTypeId::POSTIT + && !m_pActiveShell->GetView().GetDocShell()->IsReadOnly() + && pType->GetMemberCount() > 0) + bRemovePostItEntries = false; } } -- cgit