summaryrefslogtreecommitdiff
path: root/sw/source/filter/writer
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-05-26 15:15:41 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-05-26 18:01:53 +0200
commit8ce36e943f0e50970925b2dd77729ef6036b4a49 (patch)
tree3d5ebcf4831630da873b5d3b0856657bbe998830 /sw/source/filter/writer
parent72ba558eb9e827e0fb2c98cc6c06b25aaf9cc8b6 (diff)
move some searching inside IDocumentMarkAccess
to make followup improvements easier Change-Id: I2b0ab30589bc19a3e6c80228ab037745c7781292 Reviewed-on: https://gerrit.libreoffice.org/72978 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/filter/writer')
-rw-r--r--sw/source/filter/writer/writer.cxx10
1 files changed, 3 insertions, 7 deletions
diff --git a/sw/source/filter/writer/writer.cxx b/sw/source/filter/writer/writer.cxx
index c374d261ce65..aa5c9eab397c 100644
--- a/sw/source/filter/writer/writer.cxx
+++ b/sw/source/filter/writer/writer.cxx
@@ -183,13 +183,9 @@ bool Writer::CopyNextPam( SwPaM ** ppPam )
sal_Int32 Writer::FindPos_Bkmk(const SwPosition& rPos) const
{
const IDocumentMarkAccess* const pMarkAccess = m_pDoc->getIDocumentMarkAccess();
- const IDocumentMarkAccess::const_iterator_t ppBkmk = std::lower_bound(
- pMarkAccess->getAllMarksBegin(),
- pMarkAccess->getAllMarksEnd(),
- rPos,
- sw::mark::CompareIMarkStartsBefore()); // find the first Mark that does not start before
- if(ppBkmk != pMarkAccess->getAllMarksEnd())
- return ppBkmk - pMarkAccess->getAllMarksBegin();
+ const IDocumentMarkAccess::const_iterator_t ppBkmk = pMarkAccess->findFirstBookmarkStartsAfter(rPos);
+ if(ppBkmk != pMarkAccess->getBookmarksEnd())
+ return ppBkmk - pMarkAccess->getBookmarksBegin();
return -1;
}