summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--editeng/source/misc/svxacorr.cxx2
-rw-r--r--include/o3tl/sorted_vector.hxx140
-rw-r--r--o3tl/qa/test-sorted_vector.cxx18
-rw-r--r--sw/inc/docary.hxx2
-rw-r--r--sw/inc/edglbldc.hxx2
-rw-r--r--sw/inc/ndarr.hxx4
-rw-r--r--sw/source/core/doc/docredln.cxx2
-rw-r--r--sw/source/core/doc/doctxm.cxx4
-rw-r--r--sw/source/core/docnode/ndnum.cxx8
-rw-r--r--sw/source/core/docnode/node.cxx5
-rw-r--r--sw/source/core/edit/ednumber.cxx3
-rw-r--r--sw/source/core/inc/docfld.hxx2
-rw-r--r--sw/source/core/inc/swblocks.hxx2
-rw-r--r--sw/source/filter/html/htmlfly.hxx2
-rw-r--r--sw/source/filter/html/wrthtml.hxx2
-rw-r--r--sw/source/filter/inc/wrtswtbl.hxx7
-rw-r--r--sw/source/filter/xml/xmltble.cxx2
-rw-r--r--sw/source/uibase/docvw/OutlineContentVisibilityWin.cxx3
-rw-r--r--sw/source/uibase/inc/dbinsdlg.hxx2
-rw-r--r--sw/source/uibase/inc/redlndlg.hxx2
-rw-r--r--sw/source/uibase/utlui/content.cxx2
-rw-r--r--xmloff/source/style/XMLFontAutoStylePool.cxx7
-rw-r--r--xmloff/source/text/XMLTextListAutoStylePool.cxx7
23 files changed, 78 insertions, 152 deletions
diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index d278b582e833..30c598594f5d 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -2114,7 +2114,7 @@ bool SvxAutoCorrect::FindInWordStartExceptList( LanguageType eLang,
static bool lcl_FindAbbreviation(const SvStringsISortDtor* pList, const OUString& sWord)
{
- SvStringsISortDtor::const_iterator it = pList->find( "~" );
+ SvStringsISortDtor::const_iterator it = pList->find(u"~"_ustr);
SvStringsISortDtor::size_type nPos = it - pList->begin();
if( nPos < pList->size() )
{
diff --git a/include/o3tl/sorted_vector.hxx b/include/o3tl/sorted_vector.hxx
index 0f31bc517651..bf28b7166e41 100644
--- a/include/o3tl/sorted_vector.hxx
+++ b/include/o3tl/sorted_vector.hxx
@@ -21,9 +21,18 @@
namespace o3tl
{
-// forward declared because it's default template arg for sorted_vector
-template<class Value, class Compare>
-struct find_unique;
+/** the elements are totally ordered by Compare,
+ for no 2 elements !Compare(a,b) && !Compare(b,a) is true
+ */
+template <class Compare> struct find_unique
+{
+ template <typename Iterator, typename Comparable>
+ auto operator()(Iterator first, Iterator last, Comparable const& v)
+ {
+ auto const it = std::lower_bound(first, last, v, Compare());
+ return std::make_pair(it, (it != last && !Compare()(v, *it)));
+ }
+};
/** Represents a sorted vector of values.
@@ -34,12 +43,11 @@ struct find_unique;
template<
typename Value,
typename Compare = std::less<Value>,
- template<typename, typename> class Find = find_unique,
- bool = std::is_copy_constructible<Value>::value >
+ template<typename> class Find = find_unique >
class sorted_vector
{
private:
- typedef Find<Value, Compare> Find_t;
+ typedef Find<Compare> Find_t;
typedef typename std::vector<Value> vector_t;
typedef typename std::vector<Value>::iterator iterator;
public:
@@ -55,10 +63,10 @@ public:
std::sort(m_vector.begin(), m_vector.end(), Compare());
}
sorted_vector() = default;
- sorted_vector(sorted_vector const&) = default;
+ sorted_vector(sorted_vector const&) requires std::is_copy_constructible_v<Value> = default;
sorted_vector(sorted_vector&&) = default;
- sorted_vector& operator=(sorted_vector const&) = default;
+ sorted_vector& operator=(sorted_vector const&) requires std::is_copy_constructible_v<Value> = default;
sorted_vector& operator=(sorted_vector&&) = default;
// MODIFIERS
@@ -192,12 +200,12 @@ public:
// OPERATIONS
- const_iterator lower_bound( const Value& x ) const
+ template <typename Comparable> const_iterator lower_bound(const Comparable& x) const
{
return std::lower_bound( m_vector.begin(), m_vector.end(), x, Compare() );
}
- const_iterator upper_bound( const Value& x ) const
+ template <typename Comparable> const_iterator upper_bound(const Comparable& x) const
{
return std::upper_bound( m_vector.begin(), m_vector.end(), x, Compare() );
}
@@ -208,7 +216,7 @@ public:
*
* Only return a const iterator, so that the vector cannot be directly updated.
*/
- const_iterator find( const Value& x ) const
+ template <typename Comparable> const_iterator find(const Comparable& x) const
{
std::pair<const_iterator, bool> const ret(Find_t()(m_vector.begin(), m_vector.end(), x));
return (ret.second) ? ret.first : m_vector.end();
@@ -229,7 +237,7 @@ public:
return m_vector != other.m_vector;
}
- void insert(sorted_vector<Value,Compare,Find> const& rOther)
+ void insert(const sorted_vector& rOther)
{
// optimization for the rather common case that we are overwriting this with the contents
// of another sorted vector
@@ -301,123 +309,41 @@ private:
vector_t m_vector;
};
-/* Specialise the template for cases like Value = std::unique_ptr<T>, where
- MSVC2017 needs some help
-*/
-template<
- typename Value,
- typename Compare,
- template<typename, typename> class Find >
-class sorted_vector<Value,Compare,Find,false> : public sorted_vector<Value, Compare, Find, true>
-{
-public:
- using sorted_vector<Value, Compare, Find, true>::sorted_vector;
- typedef sorted_vector<Value, Compare, Find, true> super_sorted_vector;
-
- sorted_vector(sorted_vector const&) = delete;
- sorted_vector& operator=(sorted_vector const&) = delete;
-
- sorted_vector() = default;
- sorted_vector(sorted_vector&&) = default;
- sorted_vector& operator=(sorted_vector&&) = default;
-
- /**
- * implement find for sorted_vectors containing std::unique_ptr
- */
- typename super_sorted_vector::const_iterator find( typename Value::element_type const * x ) const
- {
- Value tmp(const_cast<typename Value::element_type*>(x));
- auto ret = super_sorted_vector::find(tmp);
- // coverity[ resource_leak : FALSE] - this is only a pretend unique_ptr, to avoid allocating a temporary
- tmp.release();
- return ret;
- }
- /**
- * implement upper_bound for sorted_vectors containing std::unique_ptr
- */
- typename super_sorted_vector::const_iterator upper_bound( typename Value::element_type const * x ) const
- {
- Value tmp(const_cast<typename Value::element_type*>(x));
- auto ret = super_sorted_vector::upper_bound(tmp);
- // coverity[ resource_leak : FALSE] - this is only a pretend unique_ptr, to avoid allocating a temporary
- tmp.release();
- return ret;
- }
- /**
- * implement lower_bound for sorted_vectors containing std::unique_ptr
- */
- typename super_sorted_vector::const_iterator lower_bound( typename Value::element_type const * x ) const
- {
- Value tmp(const_cast<typename Value::element_type*>(x));
- auto ret = super_sorted_vector::lower_bound(tmp);
- // coverity[ resource_leak : FALSE] - this is only a pretend unique_ptr, to avoid allocating a temporary
- tmp.release();
- return ret;
- }
-};
-
/** Implements an ordering function over a pointer, where the comparison uses the < operator on the pointed-to types.
Very useful for the cases where we put pointers to objects inside a sorted_vector.
*/
-template <class T> struct less_ptr_to
+struct less_ptr_to
{
- bool operator() ( T* const& lhs, T* const& rhs ) const
+ template <class T1, class T2> bool operator()(const T1& lhs, const T2& rhs) const
{
return (*lhs) < (*rhs);
}
};
-template <class T> struct less_uniqueptr_to
-{
- bool operator() ( std::unique_ptr<T> const& lhs, std::unique_ptr<T> const& rhs ) const
- {
- return (*lhs) < (*rhs);
- }
-};
-
-/** the elements are totally ordered by Compare,
- for no 2 elements !Compare(a,b) && !Compare(b,a) is true
- */
-template<class Value, class Compare>
-struct find_unique
-{
- typedef typename sorted_vector<Value, Compare,
- o3tl::find_unique> ::const_iterator const_iterator;
- std::pair<const_iterator, bool> operator()(
- const_iterator first, const_iterator last,
- Value const& v)
- {
- const_iterator const it = std::lower_bound(first, last, v, Compare());
- return std::make_pair(it, (it != last && !Compare()(v, *it)));
- }
-};
-
/** the elements are partially ordered by Compare,
2 elements are allowed if they are not the same element (pointer equal)
*/
-template<class Value, class Compare>
-struct find_partialorder_ptrequals
+template <class Compare> struct find_partialorder_ptrequals
{
- typedef typename sorted_vector<Value, Compare,
- o3tl::find_partialorder_ptrequals>::const_iterator const_iterator;
- std::pair<const_iterator, bool> operator()(
- const_iterator first, const_iterator last,
- Value const& v)
- {
- std::pair<const_iterator, const_iterator> const its =
- std::equal_range(first, last, v, Compare());
- for (const_iterator it = its.first; it != its.second; ++it)
+ template <typename Iterator, typename Comparable>
+ auto operator()(Iterator first, Iterator last, Comparable const& v)
+ {
+ auto const& [begin, end] = std::equal_range(first, last, v, Compare());
+ for (auto it = begin; it != end; ++it)
{
- if (v == *it)
+ if (&*v == &**it)
{
return std::make_pair(it, true);
}
}
- return std::make_pair(its.first, false);
+ return std::make_pair(begin, false);
}
};
+template <class Ref, class Referenced>
+concept is_reference_to = std::is_convertible_v<decltype(*std::declval<Ref>()), Referenced>;
+
} // namespace o3tl
#endif
diff --git a/o3tl/qa/test-sorted_vector.cxx b/o3tl/qa/test-sorted_vector.cxx
index c7fdb0c0455d..8e04e1d2232d 100644
--- a/o3tl/qa/test-sorted_vector.cxx
+++ b/o3tl/qa/test-sorted_vector.cxx
@@ -40,7 +40,7 @@ class sorted_vector_test : public CppUnit::TestFixture
public:
void testBasics()
{
- o3tl::sorted_vector<SwContent*, o3tl::less_ptr_to<SwContent> > aVec;
+ o3tl::sorted_vector<SwContent*, o3tl::less_ptr_to> aVec;
// create 4 test elements
std::unique_ptr<SwContent> p1( new SwContent(1) );
@@ -85,7 +85,7 @@ public:
void testErase()
{
- o3tl::sorted_vector<SwContent*, o3tl::less_ptr_to<SwContent> > aVec;
+ o3tl::sorted_vector<SwContent*, o3tl::less_ptr_to> aVec;
SwContent *p1 = new SwContent(1);
SwContent *p2 = new SwContent(2);
SwContent *p3 = new SwContent(3);
@@ -115,7 +115,7 @@ public:
void testInsertRange()
{
- o3tl::sorted_vector<SwContent*, o3tl::less_ptr_to<SwContent> > aVec1;
+ o3tl::sorted_vector<SwContent*, o3tl::less_ptr_to> aVec1;
std::unique_ptr<SwContent> p1( new SwContent(1) );
std::unique_ptr<SwContent> p2( new SwContent(2) );
std::unique_ptr<SwContent> p3( new SwContent(3) );
@@ -124,7 +124,7 @@ public:
aVec1.insert(p2.get());
aVec1.insert(p3.get());
- o3tl::sorted_vector<SwContent*, o3tl::less_ptr_to<SwContent> > aVec2;
+ o3tl::sorted_vector<SwContent*, o3tl::less_ptr_to> aVec2;
aVec2.insert( aVec1 );
CPPUNIT_ASSERT_EQUAL( static_cast<size_t>(3), aVec2.size() );
@@ -132,7 +132,7 @@ public:
void testLowerBound()
{
- o3tl::sorted_vector<SwContent*, o3tl::less_ptr_to<SwContent> > aVec;
+ o3tl::sorted_vector<SwContent*, o3tl::less_ptr_to> aVec;
std::unique_ptr<SwContent> p1( new SwContent(1) );
std::unique_ptr<SwContent> p2( new SwContent(2) );
std::unique_ptr<SwContent> p3( new SwContent(3) );
@@ -148,7 +148,7 @@ public:
void testBasics_FindPtr()
{
- o3tl::sorted_vector<SwContent*, o3tl::less_ptr_to<SwContent>,
+ o3tl::sorted_vector<SwContent*, o3tl::less_ptr_to,
o3tl::find_partialorder_ptrequals> aVec;
std::unique_ptr<SwContent> p1( new SwContent(1) );
std::unique_ptr<SwContent> p2( new SwContent(2) );
@@ -206,7 +206,7 @@ public:
void testErase_FindPtr()
{
- o3tl::sorted_vector<SwContent*, o3tl::less_ptr_to<SwContent>,
+ o3tl::sorted_vector<SwContent*, o3tl::less_ptr_to,
o3tl::find_partialorder_ptrequals> aVec;
std::unique_ptr<SwContent> p1( new SwContent(1) );
SwContent *p1_2 = new SwContent(1);
@@ -256,7 +256,7 @@ public:
void testUniquePtr1()
{
- o3tl::sorted_vector<std::unique_ptr<OUString>, o3tl::less_uniqueptr_to<OUString>> aVec;
+ o3tl::sorted_vector<std::unique_ptr<OUString>, o3tl::less_ptr_to> aVec;
auto str_c = aVec.insert(std::make_unique<OUString>("c")).first->get();
auto str_b1 = aVec.insert(std::make_unique<OUString>("b")).first->get();
@@ -278,7 +278,7 @@ public:
void testUniquePtr2()
{
- o3tl::sorted_vector<std::unique_ptr<OUString>, o3tl::less_uniqueptr_to<OUString>,
+ o3tl::sorted_vector<std::unique_ptr<OUString>, o3tl::less_ptr_to,
o3tl::find_partialorder_ptrequals> aVec;
auto str_c = aVec.insert(std::make_unique<OUString>("c")).first->get();
diff --git a/sw/inc/docary.hxx b/sw/inc/docary.hxx
index 6f2c2c3c3284..dce6a44b7576 100644
--- a/sw/inc/docary.hxx
+++ b/sw/inc/docary.hxx
@@ -209,7 +209,7 @@ public:
struct CompareSwRedlineTable
{
- bool operator()(SwRangeRedline* const &lhs, SwRangeRedline* const &rhs) const;
+ bool operator()(const SwRangeRedline* lhs, const SwRangeRedline* rhs) const;
};
// Notification type for notifying about redlines to LOK clients
diff --git a/sw/inc/edglbldc.hxx b/sw/inc/edglbldc.hxx
index f7ba790043ef..ede49d8e894e 100644
--- a/sw/inc/edglbldc.hxx
+++ b/sw/inc/edglbldc.hxx
@@ -62,7 +62,7 @@ public:
{ return GetDocPos() < rCmp.GetDocPos(); }
};
-class SwGlblDocContents : public o3tl::sorted_vector<std::unique_ptr<SwGlblDocContent>, o3tl::less_uniqueptr_to<SwGlblDocContent> > {};
+class SwGlblDocContents : public o3tl::sorted_vector<std::unique_ptr<SwGlblDocContent>, o3tl::less_ptr_to > {};
#endif
diff --git a/sw/inc/ndarr.hxx b/sw/inc/ndarr.hxx
index 64149366d63c..a3fabe828d19 100644
--- a/sw/inc/ndarr.hxx
+++ b/sw/inc/ndarr.hxx
@@ -72,7 +72,7 @@ typedef struct _xmlTextWriter *xmlTextWriterPtr;
struct CompareSwOutlineNodes
{
- bool operator()( SwNode* const& lhs, SwNode* const& rhs) const;
+ bool operator()(const SwNode* lhs, const SwNode* rhs) const;
};
class SwOutlineNodes : public o3tl::sorted_vector<SwNode*, CompareSwOutlineNodes>
@@ -80,7 +80,7 @@ class SwOutlineNodes : public o3tl::sorted_vector<SwNode*, CompareSwOutlineNodes
public:
static constexpr auto npos = std::numeric_limits<size_type>::max();
- bool Seek_Entry(SwNode* rP, size_type* pnPos) const;
+ bool Seek_Entry(const SwNode* rP, size_type* pnPos) const;
};
struct SwTableToTextSave;
diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx
index 2c4ba6096c48..32696630e591 100644
--- a/sw/source/core/doc/docredln.cxx
+++ b/sw/source/core/doc/docredln.cxx
@@ -646,7 +646,7 @@ bool SwRedlineTable::InsertWithValidRanges(SwRangeRedline*& p, size_type* pInsPo
return bAnyIns;
}
-bool CompareSwRedlineTable::operator()(SwRangeRedline* const &lhs, SwRangeRedline* const &rhs) const
+bool CompareSwRedlineTable::operator()(const SwRangeRedline* lhs, const SwRangeRedline* rhs) const
{
return *lhs < *rhs;
}
diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx
index 4b0ca5d323f1..af957c8a7318 100644
--- a/sw/source/core/doc/doctxm.cxx
+++ b/sw/source/core/doc/doctxm.cxx
@@ -754,7 +754,7 @@ static bool IsHeadingContained(const SwTextNode* pChptrNd, const SwNode& rNd)
bool bCheckFirst = false;
SwOutlineNodes::size_type nPos;
- if (!rONds.Seek_Entry(const_cast<SwNode*>(pNd), &nPos))
+ if (!rONds.Seek_Entry(pNd, &nPos))
{
if (nPos == 0)
bCheckFirst = true;
@@ -785,7 +785,7 @@ static bool IsHeadingContained(const SwTextNode* pChptrNd, const SwNode& rNd)
if (bIsHeadingContained)
{
const SwNode* aChptrNd = pChptrNd;
- if (!rONds.Seek_Entry(const_cast<SwNode*>(aChptrNd), &nPos) && nPos)
+ if (!rONds.Seek_Entry(aChptrNd, &nPos) && nPos)
nPos--;
// Search for the next outline node with a larger level than the specified chapter node
while (nPos < rONds.size() - 1
diff --git a/sw/source/core/docnode/ndnum.cxx b/sw/source/core/docnode/ndnum.cxx
index af17a2a68e15..58b4cbff6488 100644
--- a/sw/source/core/docnode/ndnum.cxx
+++ b/sw/source/core/docnode/ndnum.cxx
@@ -24,12 +24,12 @@
#include <fldbas.hxx>
#include <osl/diagnose.h>
-bool CompareSwOutlineNodes::operator()( SwNode* const& lhs, SwNode* const& rhs) const
+bool CompareSwOutlineNodes::operator()(const SwNode* lhs, const SwNode* rhs) const
{
return lhs->GetIndex() < rhs->GetIndex();
}
-bool SwOutlineNodes::Seek_Entry(SwNode* rP, size_type* pnPos) const
+bool SwOutlineNodes::Seek_Entry(const SwNode* rP, size_type* pnPos) const
{
const_iterator it = lower_bound(rP);
*pnPos = it - begin();
@@ -79,10 +79,8 @@ void SwNodes::UpdateOutlineIdx( const SwNode& rNd )
if( m_aOutlineNodes.empty() ) // no OutlineNodes present ?
return;
- SwNode* const pSrch = const_cast<SwNode*>(&rNd);
-
SwOutlineNodes::size_type nPos;
- if (!m_aOutlineNodes.Seek_Entry(pSrch, &nPos))
+ if (!m_aOutlineNodes.Seek_Entry(&rNd, &nPos))
return;
if( nPos == m_aOutlineNodes.size() ) // none present for updating ?
return;
diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx
index 0acdc1db91c3..ba3d9fdb6812 100644
--- a/sw/source/core/docnode/node.cxx
+++ b/sw/source/core/docnode/node.cxx
@@ -796,9 +796,8 @@ const SwTextNode* SwNode::FindOutlineNodeOfLevel(sal_uInt8 const nLvl,
if( MAXLEVEL > nLvl && !rONds.empty() )
{
SwOutlineNodes::size_type nPos;
- SwNode* pNd = const_cast<SwNode*>(this);
bool bCheckFirst = false;
- if( !rONds.Seek_Entry( pNd, &nPos ))
+ if (!rONds.Seek_Entry(this, &nPos))
{
if (nPos == 0)
bCheckFirst = true;
@@ -2002,7 +2001,7 @@ bool SwContentNode::IsAnyCondition( SwCollCondition& rTmp ) const
const SwOutlineNodes& rOutlNds = rNds.GetOutLineNds();
if( !rOutlNds.empty() )
{
- if( !rOutlNds.Seek_Entry( const_cast<SwContentNode*>(this), &nPos ) && nPos )
+ if (!rOutlNds.Seek_Entry(this, &nPos) && nPos)
--nPos;
if( nPos < rOutlNds.size() &&
rOutlNds[ nPos ]->GetIndex() < GetIndex() )
diff --git a/sw/source/core/edit/ednumber.cxx b/sw/source/core/edit/ednumber.cxx
index c272aa5f8eec..625cd43cb1c8 100644
--- a/sw/source/core/edit/ednumber.cxx
+++ b/sw/source/core/edit/ednumber.cxx
@@ -556,11 +556,10 @@ bool SwEditShell::IsProtectedOutlinePara() const
if( rNd.IsTextNode() )
{
const SwOutlineNodes& rOutlNd = GetDoc()->GetNodes().GetOutLineNds();
- SwNode* pNd = const_cast<SwNode*>(&rNd);
bool bFirst = true;
SwOutlineNodes::size_type nPos;
int nLvl(0);
- if( !rOutlNd.Seek_Entry( pNd, &nPos ) && nPos )
+ if (!rOutlNd.Seek_Entry(&rNd, &nPos) && nPos)
--nPos;
for( ; nPos < rOutlNd.size(); ++nPos )
diff --git a/sw/source/core/inc/docfld.hxx b/sw/source/core/inc/docfld.hxx
index f09116978fb5..f0b4b261a8fe 100644
--- a/sw/source/core/inc/docfld.hxx
+++ b/sw/source/core/inc/docfld.hxx
@@ -114,7 +114,7 @@ public:
void SetBodyPos( const SwContentFrame& rFrame );
};
-class SetGetExpFields : public o3tl::sorted_vector<std::unique_ptr<SetGetExpField>, o3tl::less_uniqueptr_to<SetGetExpField> >
+class SetGetExpFields : public o3tl::sorted_vector<std::unique_ptr<SetGetExpField>, o3tl::less_ptr_to >
{
};
diff --git a/sw/source/core/inc/swblocks.hxx b/sw/source/core/inc/swblocks.hxx
index 7bd877ad653d..364f5f1a9ee8 100644
--- a/sw/source/core/inc/swblocks.hxx
+++ b/sw/source/core/inc/swblocks.hxx
@@ -49,7 +49,7 @@ public:
bool operator< ( const SwBlockName& r ) const { return m_aShort < r.m_aShort; }
};
-class SwBlockNames : public o3tl::sorted_vector<std::unique_ptr<SwBlockName>, o3tl::less_uniqueptr_to<SwBlockName> > {};
+class SwBlockNames : public o3tl::sorted_vector<std::unique_ptr<SwBlockName>, o3tl::less_ptr_to > {};
class SwImpBlocks
{
diff --git a/sw/source/filter/html/htmlfly.hxx b/sw/source/filter/html/htmlfly.hxx
index 666f7730ecf9..4038ac2a2dcf 100644
--- a/sw/source/filter/html/htmlfly.hxx
+++ b/sw/source/filter/html/htmlfly.hxx
@@ -121,7 +121,7 @@ public:
class SwHTMLPosFlyFrames
: public o3tl::sorted_vector<std::unique_ptr<SwHTMLPosFlyFrame>,
- o3tl::less_uniqueptr_to<SwHTMLPosFlyFrame>,
+ o3tl::less_ptr_to,
o3tl::find_partialorder_ptrequals>
{};
diff --git a/sw/source/filter/html/wrthtml.hxx b/sw/source/filter/html/wrthtml.hxx
index a62bff941a1d..51bd462d08d3 100644
--- a/sw/source/filter/html/wrthtml.hxx
+++ b/sw/source/filter/html/wrthtml.hxx
@@ -204,7 +204,7 @@ struct HTMLControl
}
};
-class HTMLControls : public o3tl::sorted_vector<std::unique_ptr<HTMLControl>, o3tl::less_uniqueptr_to<HTMLControl> > {
+class HTMLControls : public o3tl::sorted_vector<std::unique_ptr<HTMLControl>, o3tl::less_ptr_to > {
};
struct SwHTMLFormatInfo
diff --git a/sw/source/filter/inc/wrtswtbl.hxx b/sw/source/filter/inc/wrtswtbl.hxx
index e3391e7ce74c..83a40c0f681d 100644
--- a/sw/source/filter/inc/wrtswtbl.hxx
+++ b/sw/source/filter/inc/wrtswtbl.hxx
@@ -151,7 +151,7 @@ inline bool SwWriteTableRow::operator<( const SwWriteTableRow& rRow ) const
}
using SwWriteTableRows
- = o3tl::sorted_vector< std::unique_ptr<SwWriteTableRow>, o3tl::less_uniqueptr_to<SwWriteTableRow> >;
+ = o3tl::sorted_vector< std::unique_ptr<SwWriteTableRow>, o3tl::less_ptr_to >;
class SwWriteTableCol
{
@@ -199,7 +199,10 @@ inline bool SwWriteTableCol::operator<( const SwWriteTableCol& rCol ) const
}
struct SwWriteTableColLess {
- bool operator()(std::unique_ptr<SwWriteTableCol> const & lhs, std::unique_ptr<SwWriteTableCol> const & rhs) {
+ template <typename T1, typename T2>
+ requires o3tl::is_reference_to<T1, SwWriteTableCol>
+ && o3tl::is_reference_to<T2, SwWriteTableCol>
+ bool operator()(T1 const& lhs, T2 const& rhs) const {
return lhs->GetPos() < rhs->GetPos();
}
};
diff --git a/sw/source/filter/xml/xmltble.cxx b/sw/source/filter/xml/xmltble.cxx
index 1341bbbe37ad..ab61f071ce79 100644
--- a/sw/source/filter/xml/xmltble.cxx
+++ b/sw/source/filter/xml/xmltble.cxx
@@ -99,7 +99,7 @@ struct SwXMLTableColumnCmpWidth_Impl
}
};
-class SwXMLTableColumns_Impl : public o3tl::sorted_vector<std::unique_ptr<SwXMLTableColumn_Impl>, o3tl::less_uniqueptr_to<SwXMLTableColumn_Impl> > {
+class SwXMLTableColumns_Impl : public o3tl::sorted_vector<std::unique_ptr<SwXMLTableColumn_Impl>, o3tl::less_ptr_to > {
};
}
diff --git a/sw/source/uibase/docvw/OutlineContentVisibilityWin.cxx b/sw/source/uibase/docvw/OutlineContentVisibilityWin.cxx
index 998548550274..b7a21add98be 100644
--- a/sw/source/uibase/docvw/OutlineContentVisibilityWin.cxx
+++ b/sw/source/uibase/docvw/OutlineContentVisibilityWin.cxx
@@ -111,8 +111,7 @@ void SwOutlineContentVisibilityWin::Set()
SwWrtShell& rSh = GetEditWin()->GetView().GetWrtShell();
const SwOutlineNodes& rOutlineNodes = rSh.GetNodes().GetOutLineNds();
- (void)rOutlineNodes.Seek_Entry(static_cast<SwNode*>(const_cast<SwTextNode*>(pTextNode)),
- &m_nOutlinePos);
+ (void)rOutlineNodes.Seek_Entry(pTextNode, &m_nOutlinePos);
// set symbol displayed on button
bool bVisible = true;
diff --git a/sw/source/uibase/inc/dbinsdlg.hxx b/sw/source/uibase/inc/dbinsdlg.hxx
index 035bf49c6181..5694057990eb 100644
--- a/sw/source/uibase/inc/dbinsdlg.hxx
+++ b/sw/source/uibase/inc/dbinsdlg.hxx
@@ -73,7 +73,7 @@ struct SwInsDBColumn
bool operator<( const SwInsDBColumn& rCmp ) const;
};
-class SwInsDBColumns : public o3tl::sorted_vector<std::unique_ptr<SwInsDBColumn>, o3tl::less_uniqueptr_to<SwInsDBColumn> >
+class SwInsDBColumns : public o3tl::sorted_vector<std::unique_ptr<SwInsDBColumn>, o3tl::less_ptr_to >
{
};
diff --git a/sw/source/uibase/inc/redlndlg.hxx b/sw/source/uibase/inc/redlndlg.hxx
index c8cfd8cc8262..d3944e9f81d9 100644
--- a/sw/source/uibase/inc/redlndlg.hxx
+++ b/sw/source/uibase/inc/redlndlg.hxx
@@ -51,7 +51,7 @@ struct SwRedlineDataParent
{ return (pData && pData->GetSeqNo() < rObj.pData->GetSeqNo()); }
};
-class SwRedlineDataParentSortArr : public o3tl::sorted_vector<SwRedlineDataParent*, o3tl::less_ptr_to<SwRedlineDataParent> > {};
+class SwRedlineDataParentSortArr : public o3tl::sorted_vector<SwRedlineDataParent*, o3tl::less_ptr_to > {};
class SW_DLLPUBLIC SwRedlineAcceptDlg final
{
diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx
index fa1c7e10d447..8e301753b236 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -153,7 +153,7 @@ constexpr char NAVI_BOOKMARK_DELIM = '\x01';
}
class SwContentArr
- : public o3tl::sorted_vector<std::unique_ptr<SwContent>, o3tl::less_uniqueptr_to<SwContent>,
+ : public o3tl::sorted_vector<std::unique_ptr<SwContent>, o3tl::less_ptr_to,
o3tl::find_partialorder_ptrequals>
{
};
diff --git a/xmloff/source/style/XMLFontAutoStylePool.cxx b/xmloff/source/style/XMLFontAutoStylePool.cxx
index d7b880208be5..c89ef5019c62 100644
--- a/xmloff/source/style/XMLFontAutoStylePool.cxx
+++ b/xmloff/source/style/XMLFontAutoStylePool.cxx
@@ -120,9 +120,10 @@ inline XMLFontAutoStylePoolEntry_Impl::XMLFontAutoStylePoolEntry_Impl(
namespace {
struct XMLFontAutoStylePoolEntryCmp_Impl {
- bool operator()(
- std::unique_ptr<XMLFontAutoStylePoolEntry_Impl> const& r1,
- std::unique_ptr<XMLFontAutoStylePoolEntry_Impl> const& r2 ) const
+ template <typename T1, typename T2>
+ requires o3tl::is_reference_to<T1, XMLFontAutoStylePoolEntry_Impl>
+ && o3tl::is_reference_to<T2, XMLFontAutoStylePoolEntry_Impl>
+ bool operator()(T1 const& r1, T2 const& r2) const
{
bool bEnc1(r1->GetEncoding() != RTL_TEXTENCODING_SYMBOL);
bool bEnc2(r2->GetEncoding() != RTL_TEXTENCODING_SYMBOL);
diff --git a/xmloff/source/text/XMLTextListAutoStylePool.cxx b/xmloff/source/text/XMLTextListAutoStylePool.cxx
index affca2cc9894..c1483f2adf3b 100644
--- a/xmloff/source/text/XMLTextListAutoStylePool.cxx
+++ b/xmloff/source/text/XMLTextListAutoStylePool.cxx
@@ -120,9 +120,10 @@ namespace {
struct XMLTextListAutoStylePoolEntryCmp_Impl
{
- bool operator()(
- std::unique_ptr<XMLTextListAutoStylePoolEntry_Impl> const& r1,
- std::unique_ptr<XMLTextListAutoStylePoolEntry_Impl> const& r2 ) const
+ template <typename T1, typename T2>
+ requires o3tl::is_reference_to<T1, XMLTextListAutoStylePoolEntry_Impl>
+ && o3tl::is_reference_to<T2, XMLTextListAutoStylePoolEntry_Impl>
+ bool operator()(T1 const& r1, T2 const& r2) const
{
if( r1->IsNamed() )
{