summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/doc/docnew.cxx5
-rw-r--r--sw/source/core/unocore/unoportenum.cxx5
2 files changed, 4 insertions, 6 deletions
diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx
index 87f51c3ffd5b..613c0b50aa48 100644
--- a/sw/source/core/doc/docnew.cxx
+++ b/sw/source/core/doc/docnew.cxx
@@ -1084,16 +1084,15 @@ SwNodeIndex SwDoc::AppendDoc(const SwDoc& rSource, sal_uInt16 const nStartPageNu
--aNodeIndex;
SwPaM aPaM(aNodeIndex);
// Collect the marks starting or ending at this text node.
- std::set<sw::mark::IMark*> aSeenMarks;
+ o3tl::sorted_vector<sw::mark::IMark*> aSeenMarks;
IDocumentMarkAccess* pMarkAccess = getIDocumentMarkAccess();
for (const SwIndex* pIndex = pTextNode->GetFirstIndex(); pIndex; pIndex = pIndex->GetNext())
{
sw::mark::IMark* pMark = const_cast<sw::mark::IMark*>(pIndex->GetMark());
if (!pMark)
continue;
- if (aSeenMarks.find(pMark) != aSeenMarks.end())
+ if (!aSeenMarks.insert(pMark).second)
continue;
- aSeenMarks.insert(pMark);
}
// And move them back.
for (sw::mark::IMark* pMark : aSeenMarks)
diff --git a/sw/source/core/unocore/unoportenum.cxx b/sw/source/core/unocore/unoportenum.cxx
index a370fe2dabc6..9a7605644b5d 100644
--- a/sw/source/core/unocore/unoportenum.cxx
+++ b/sw/source/core/unocore/unoportenum.cxx
@@ -203,7 +203,7 @@ namespace
else
{
// A text node already knows its marks via its SwIndexes.
- std::set<sw::mark::IMark*> aSeenMarks;
+ o3tl::sorted_vector<const sw::mark::IMark*> aSeenMarks;
for (const SwIndex* pIndex = pTextNode->GetFirstIndex(); pIndex; pIndex = pIndex->GetNext())
{
// Need a non-cost mark here, as we'll create an UNO wrapper around it.
@@ -216,9 +216,8 @@ namespace
eType != IDocumentMarkAccess::MarkType::CROSSREF_HEADING_BOOKMARK)
continue;
// Only handle bookmarks once, if they start and end at this node as well.
- if (aSeenMarks.find(pBkmk) != aSeenMarks.end())
+ if (!aSeenMarks.insert(pBkmk).second)
continue;
- aSeenMarks.insert(pBkmk);
lcl_FillBookmark(pBkmk, nOwnNode, rDoc, rBkmArr);
}
}