sw/source/ui/misc/bookmark.cxx | 2 +- sw/source/uibase/utlui/content.cxx | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-)
New commits: commit 5c3c49bbf768f88b3d9a45d1ffc88c44ad2870c1 Author: Michael Stahl <michael.st...@allotropia.de> AuthorDate: Mon Aug 22 15:12:54 2022 +0200 Commit: Michael Stahl <michael.st...@allotropia.de> CommitDate: Mon Aug 22 19:09:26 2022 +0200 sw: Navigator: Protect Bookmarks should allow editing the text ... ... in the bookmark. Only deleting/renaming it is forbidden. Change-Id: I66c6d106f0fd97b416edabd0271cd3230909a279 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138692 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.st...@allotropia.de> diff --git a/sw/source/ui/misc/bookmark.cxx b/sw/source/ui/misc/bookmark.cxx index 89d353c20245..363b861653a4 100644 --- a/sw/source/ui/misc/bookmark.cxx +++ b/sw/source/ui/misc/bookmark.cxx @@ -396,7 +396,7 @@ SwInsertBookmarkDlg::SwInsertBookmarkDlg(weld::Window* pParent, SwWrtShell& rS, m_xEditTextBtn->set_sensitive(false); m_xRenameBtn->set_sensitive(false); - // select 3rd column, otherwise it'll pick 1st one FIXME doesn't work with gtk? + // select 3rd column, otherwise it'll pick 1st one m_xBookmarksBox->set_column_editables({ false, false, true, false, false }); PopulateTable(); diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index dfba5294a35e..7922655252fa 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -1680,7 +1680,7 @@ IMPL_LINK(SwContentTree, CommandHdl, const CommandEvent&, rCEvt, bool) const bool bProtectBM = (ContentTypeId::BOOKMARK == nContentType) && m_pActiveShell->getIDocumentSettingAccess().get(DocumentSettingId::PROTECT_BOOKMARKS); const bool bEditable = pType->IsEditable() && - ((bVisible && !bProtected && !bProtectBM) || ContentTypeId::REGION == nContentType); + ((bVisible && !bProtected) || ContentTypeId::REGION == nContentType); const bool bDeletable = pType->IsDeletable() && ((bVisible && !bProtected && !bProtectBM) || ContentTypeId::REGION == nContentType); const bool bRenamable = bEditable && !bReadonly && @@ -4911,20 +4911,22 @@ void SwContentTree::EditEntry(const weld::TreeIter& rEntry, EditEntryMode nMode) nSlot = FN_FORMAT_FRAME_DLG; break; case ContentTypeId::BOOKMARK : - assert(!m_pActiveShell->getIDocumentSettingAccess().get(DocumentSettingId::PROTECT_BOOKMARKS)); if(nMode == EditEntryMode::DELETE) { + assert(!m_pActiveShell->getIDocumentSettingAccess().get(DocumentSettingId::PROTECT_BOOKMARKS)); IDocumentMarkAccess* const pMarkAccess = m_pActiveShell->getIDocumentMarkAccess(); pMarkAccess->deleteMark(pMarkAccess->findMark(pCnt->GetName()), false); } else if(nMode == EditEntryMode::RENAME) { + assert(!m_pActiveShell->getIDocumentSettingAccess().get(DocumentSettingId::PROTECT_BOOKMARKS)); uno::Reference< frame::XModel > xModel = m_pActiveShell->GetView().GetDocShell()->GetBaseModel(); uno::Reference< text::XBookmarksSupplier > xBkms(xModel, uno::UNO_QUERY); xNameAccess = xBkms->getBookmarks(); } else { + // allowed despite PROTECT_BOOKMARKS: the dialog itself enforces it SfxStringItem const name(FN_EDIT_BOOKMARK, pCnt->GetName()); SfxPoolItem const* args[2] = { &name, nullptr }; m_pActiveShell->GetView().GetViewFrame()->