sw/inc/IDocumentMarkAccess.hxx | 2 +- sw/source/core/doc/docbm.cxx | 2 +- sw/source/core/inc/MarkManager.hxx | 2 +- sw/source/uibase/shells/textsh1.cxx | 2 +- sw/source/uibase/uno/loktxdoc.cxx | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-)
New commits: commit 91c0e64c2f4d67c6a1073a73b1e467a3b28f0e85 Author: Miklos Vajna <vmik...@collabora.com> AuthorDate: Wed Jan 18 08:33:14 2023 +0100 Commit: Miklos Vajna <vmik...@collabora.com> CommitDate: Wed Jan 18 09:12:26 2023 +0000 sw: rename getBookmarkFor() further to getOneInnermostBookmarkFor() One additional complexity I missed is that there can be only one innermost fieldmark for a position, but there can be multiple bookmarks, because bookmarks don't have a starting dummy character. See <https://gerrit.libreoffice.org/c/core/+/145412/2#message-85a4780c8140038a9cc2bd4b9af64ecf97ee5e60>. Change-Id: Ia5d3bebddd42be7c44b8df2d5db3c5312285a5f5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145699 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmik...@collabora.com> diff --git a/sw/inc/IDocumentMarkAccess.hxx b/sw/inc/IDocumentMarkAccess.hxx index f07a6b6e1fe7..391be58a077a 100644 --- a/sw/inc/IDocumentMarkAccess.hxx +++ b/sw/inc/IDocumentMarkAccess.hxx @@ -314,7 +314,7 @@ class IDocumentMarkAccess virtual const_iterator_t findFirstBookmarkStartsAfter(const SwPosition& rPos) const =0; /// Get the innermost bookmark that contains rPos. - virtual sw::mark::IMark* getInnerBookmarkFor(const SwPosition& rPos) const = 0; + virtual sw::mark::IMark* getOneInnermostBookmarkFor(const SwPosition& rPos) const = 0; // Fieldmarks /** returns a STL-like random access iterator to the begin of the sequence of fieldmarks. diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx index 468b5a2e3b11..56a34fb72a3a 100644 --- a/sw/source/core/doc/docbm.cxx +++ b/sw/source/core/doc/docbm.cxx @@ -1437,7 +1437,7 @@ namespace sw::mark return dynamic_cast<IFieldmark*>(pFieldmark); } - IMark* MarkManager::getInnerBookmarkFor(const SwPosition& rPos) const + IMark* MarkManager::getOneInnermostBookmarkFor(const SwPosition& rPos) const { auto it = std::find_if(m_vBookmarks.begin(), m_vBookmarks.end(), [&rPos](const sw::mark::MarkBase* pMark) diff --git a/sw/source/core/inc/MarkManager.hxx b/sw/source/core/inc/MarkManager.hxx index 0b3f6d7df37d..7f9945043c72 100644 --- a/sw/source/core/inc/MarkManager.hxx +++ b/sw/source/core/inc/MarkManager.hxx @@ -88,7 +88,7 @@ namespace sw::mark { virtual sal_Int32 getBookmarksCount() const override; virtual const_iterator_t findBookmark(const OUString& rName) const override; virtual const_iterator_t findFirstBookmarkStartsAfter(const SwPosition& rPos) const override; - virtual ::sw::mark::IMark* getInnerBookmarkFor(const SwPosition& rPos) const override; + virtual ::sw::mark::IMark* getOneInnermostBookmarkFor(const SwPosition& rPos) const override; // Fieldmarks virtual const_iterator_t getFieldmarksBegin() const override; diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx index 81a3f525bfc4..e887cad14b99 100644 --- a/sw/source/uibase/shells/textsh1.cxx +++ b/sw/source/uibase/shells/textsh1.cxx @@ -561,7 +561,7 @@ void UpdateBookmark(SfxRequest& rReq, SwWrtShell& rWrtSh) IDocumentMarkAccess& rIDMA = *rWrtSh.GetDoc()->getIDocumentMarkAccess(); SwPosition& rCursor = *rWrtSh.GetCursor()->GetPoint(); - auto pBookmark = dynamic_cast<sw::mark::Bookmark*>(rIDMA.getInnerBookmarkFor(rCursor)); + auto pBookmark = dynamic_cast<sw::mark::Bookmark*>(rIDMA.getOneInnermostBookmarkFor(rCursor)); if (!pBookmark || !pBookmark->GetName().startsWith(aBookmarkNamePrefix)) { return; diff --git a/sw/source/uibase/uno/loktxdoc.cxx b/sw/source/uibase/uno/loktxdoc.cxx index 875384d1f307..f9e6b0707fcb 100644 --- a/sw/source/uibase/uno/loktxdoc.cxx +++ b/sw/source/uibase/uno/loktxdoc.cxx @@ -250,7 +250,7 @@ void GetBookmark(tools::JsonWriter& rJsonWriter, SwDocShell* pDocShell, IDocumentMarkAccess& rIDMA = *pDocShell->GetDoc()->getIDocumentMarkAccess(); SwWrtShell* pWrtShell = pDocShell->GetWrtShell(); SwPosition& rCursor = *pWrtShell->GetCursor()->GetPoint(); - sw::mark::IMark* pBookmark = rIDMA.getInnerBookmarkFor(rCursor); + sw::mark::IMark* pBookmark = rIDMA.getOneInnermostBookmarkFor(rCursor); tools::ScopedJsonWriterNode aBookmark = rJsonWriter.startNode("bookmark"); if (!pBookmark) {