diff options
author | Jim Raykowski <raykowj@gmail.com> | 2021-09-23 23:51:59 -0800 |
---|---|---|
committer | Jim Raykowski <raykowj@gmail.com> | 2021-09-25 23:10:39 +0200 |
commit | 7c4f9a1280e5524eee81fe65bf5d76e83e68275e (patch) | |
tree | 7b843d2a67dd5d7cc97ad33c84bdf1138c8c85df /sw | |
parent | ca844cbdc3e933e3082e9cde0632445916de819e (diff) |
SwNavigator: Set in content type init if delete and edit are allowed
Fixes crash that occurs for REFERENCE content type 'Delete' and
'Edit...' menu items. These are not allowed for REFERENCE content type.
Change-Id: I893acd57f80c9a96637e4070f3e1ca7c29b1d7ff
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122559
Tested-by: Jenkins
Reviewed-by: Jim Raykowski <raykowj@gmail.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/uibase/utlui/content.cxx | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index 2acbcc679ef8..583ccd958ce7 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -493,8 +493,8 @@ void SwContentType::Init(bool* pbInvalidateWindow) case ContentTypeId::REFERENCE: { m_nMemberCount = m_pWrtShell->GetRefMarks(); - m_bEdit = true; - m_bDelete = true; + m_bEdit = false; + m_bDelete = false; } break; case ContentTypeId::URLFIELD: @@ -1587,12 +1587,7 @@ IMPL_LINK(SwContentTree, CommandHdl, const CommandEvent&, rCEvt, bool) ContentTypeId::INDEX == nContentType || ContentTypeId::DRAWOBJECT == nContentType); - if (ContentTypeId::TEXTFIELD == nContentType || ContentTypeId::REFERENCE == nContentType) - { - bRemoveEditEntry = false; - bRemoveDeleteEntry = false; - } - else if(ContentTypeId::OUTLINE == nContentType) + if(ContentTypeId::OUTLINE == nContentType) { bOutline = true; lcl_SetOutlineContentEntriesSensitivities(this, *m_xTreeView, *xEntry, *xSubPopOutlineContent); @@ -4523,8 +4518,9 @@ void SwContentTree::EditEntry(const weld::TreeIter& rEntry, EditEntryMode nMode) else nSlot = SID_EDIT_HYPERLINK; break; - case ContentTypeId::TEXTFIELD: case ContentTypeId::REFERENCE: + break; + case ContentTypeId::TEXTFIELD: { const SwTextFieldContent* pTextFieldCnt = static_cast<const SwTextFieldContent*>(pCnt); if (nMode == EditEntryMode::DELETE) |