summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-05-14 16:50:30 +0100
committerAndras Timar <andras.timar@collabora.com>2018-05-23 13:56:23 +0200
commitdb2924ef296b4308ba45077b591da9d9ab4c427b (patch)
tree4e79554b82a9b51aa5581fec08272a49b1f3aea6 /sw
parent80f6a5f248b4e056a607ad769bc8dc653b9885cc (diff)
ofz#7322 lcl_MarkEqualByStart sort logic differs from that of operator==
when it encounters a SwPosition with a SwIndex nContent whose m_pIndexReg is null and compares to one whose m_pIndexReg is not null, where both have an m_nIndex of 0. operator== considers them different, while lcl_MarkEqualByStart doesn't care and sorts them as equal Change-Id: I29920b98c9e6f395487de1b9cafa6b1282b2b1b6 Reviewed-on: https://gerrit.libreoffice.org/54342 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> (cherry picked from commit b3aece104b886618552828c168a1b51b3290f38f)
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/core/data/ww8/pass/ofz7322-1.docbin0 -> 49544 bytes
-rw-r--r--sw/source/core/doc/docbm.cxx9
2 files changed, 8 insertions, 1 deletions
diff --git a/sw/qa/core/data/ww8/pass/ofz7322-1.doc b/sw/qa/core/data/ww8/pass/ofz7322-1.doc
new file mode 100644
index 000000000000..5f4858849acf
--- /dev/null
+++ b/sw/qa/core/data/ww8/pass/ofz7322-1.doc
Binary files differ
diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx
index 5fe3a250da5d..ba2279853128 100644
--- a/sw/source/core/doc/docbm.cxx
+++ b/sw/source/core/doc/docbm.cxx
@@ -225,6 +225,13 @@ namespace
return false;
}
+ bool lcl_MarkEqualByStart(const IDocumentMarkAccess::pMark_t& rpFirst,
+ const IDocumentMarkAccess::pMark_t& rpSecond)
+ {
+ return !lcl_MarkOrderingByStart(rpFirst, rpSecond) &&
+ !lcl_MarkOrderingByStart(rpSecond, rpFirst);
+ }
+
IDocumentMarkAccess::iterator_t lcl_FindMark(
IDocumentMarkAccess::container_t& rMarks,
const IDocumentMarkAccess::pMark_t& rpMarkToFind)
@@ -235,7 +242,7 @@ namespace
// since there are usually not too many marks on the same start
// position, we are not doing a bisect search for the upper bound
// but instead start to iterate from pMarkLow directly
- while(ppCurrentMark != rMarks.end() && **ppCurrentMark == *rpMarkToFind)
+ while (ppCurrentMark != rMarks.end() && lcl_MarkEqualByStart(*ppCurrentMark, rpMarkToFind))
{
if(ppCurrentMark->get() == rpMarkToFind.get())
{