summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2023-01-18 08:33:14 +0100
committerMiklos Vajna <vmiklos@collabora.com>2023-01-18 09:12:26 +0000
commit91c0e64c2f4d67c6a1073a73b1e467a3b28f0e85 (patch)
tree430d0304da25067b15457eaa307dc1734da1f454 /sw/source
parent90d658d6d1054ac352e1b074a37b8963514a05f8 (diff)
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 <vmiklos@collabora.com>
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/core/doc/docbm.cxx2
-rw-r--r--sw/source/core/inc/MarkManager.hxx2
-rw-r--r--sw/source/uibase/shells/textsh1.cxx2
-rw-r--r--sw/source/uibase/uno/loktxdoc.cxx2
4 files changed, 4 insertions, 4 deletions
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)
{