diff options
author | Michael Stahl <Michael.Stahl@cib.de> | 2020-01-31 12:05:43 +0100 |
---|---|---|
committer | Michael Stahl <michael.stahl@cib.de> | 2020-02-03 12:05:56 +0100 |
commit | 9e7b5c74b484fcfd3317db56745b26b10897047d (patch) | |
tree | e26ab6e413481e55e9a69468196fc90c3861bf06 /sw/inc/IDocumentMarkAccess.hxx | |
parent | 249b10c22f4a35672a7388d34b2ded1b76054dac (diff) |
sw: implement protection of bookmarks and fields
SwPaM::HasReadonlySel() checks PROTECT_BOOKMARKS / PROTECT_FIELDS
setting and checks if bookmarks or fields are selected for deletion.
This should already be called by the UI code in all the right places,
for the other content protection features, and cause a dialog to pop
up.
What's not ideal about this is that it's impossible to delete a
character immediately before or after a point bookmark because that
would delete the point bookmark too.
The bookmark check is done by extracting a function out of
MarkManager::deleteMarks() so both will use the same logic.
The problem of DelContentIndex() duplicating that logic remains...
Apparently the status bar at the bottom already displays "read-only"
for such a selection.
Change-Id: Id87999198a03ba847ef0eff5651fef3bd2517fae
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87778
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@cib.de>
Diffstat (limited to 'sw/inc/IDocumentMarkAccess.hxx')
-rw-r--r-- | sw/inc/IDocumentMarkAccess.hxx | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sw/inc/IDocumentMarkAccess.hxx b/sw/inc/IDocumentMarkAccess.hxx index a076a6dada66..736f12e98c8f 100644 --- a/sw/inc/IDocumentMarkAccess.hxx +++ b/sw/inc/IDocumentMarkAccess.hxx @@ -278,6 +278,9 @@ class IDocumentMarkAccess // interface IBookmarks (BOOKMARK, CROSSREF_NUMITEM_BOOKMARK, CROSSREF_HEADING_BOOKMARK ) + /** check if the selection would delete a BOOKMARK */ + virtual bool isBookmarkDeleted(SwPaM const& rPaM) const =0; + /** returns a STL-like random access iterator to the begin of the sequence the IBookmarks. */ virtual const_iterator_t getBookmarksBegin() const =0; |