diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2024-02-16 23:58:01 +0600 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2024-02-17 10:07:38 +0100 |
commit | 1f5efbf8b9ba3fd5887c58574dfed3bf31cd020e (patch) | |
tree | 766fdcfb4d76b101c168e70ef342b07cb6e146df /sw/source/uibase | |
parent | 39048e0c0e9af455197ff57cc2947f8fb23e8542 (diff) |
Generalize search algorithms in sorted_vector
This allows to simplify the code somewhat, and also to relax requirements
to the arguments, e.g. allowing to pass const objects to search in vector
containing non-const objects.
Change-Id: Id34911a8694bbdec275d22b51ca4a0845c9fa4c4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163519
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sw/source/uibase')
-rw-r--r-- | sw/source/uibase/docvw/OutlineContentVisibilityWin.cxx | 3 | ||||
-rw-r--r-- | sw/source/uibase/inc/dbinsdlg.hxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/inc/redlndlg.hxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/utlui/content.cxx | 2 |
4 files changed, 4 insertions, 5 deletions
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> { }; |