The argument of SwpHints::Insert should not be const
Change-Id: Ic71a53140ae43c5936b0a63213e5c7d068bed45f
Reviewed-on: https://gerrit.libreoffice.org/79850
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
diff --git a/sw/inc/ndhints.hxx b/sw/inc/ndhints.hxx
index 697b113..ceead82 100644
--- a/sw/inc/ndhints.hxx
+++ b/sw/inc/ndhints.hxx
@@ -124,7 +124,7 @@ private:
const SetAttrMode nMode );
bool MergePortions( SwTextNode& rNode );
void Insert( const SwTextAttr *pHt );
void Insert(SwTextAttr* pHt);
SW_DLLPUBLIC void Resort() const;
SW_DLLPUBLIC void ResortStartMap() const;
SW_DLLPUBLIC void ResortEndMap() const;
diff --git a/sw/source/core/txtnode/ndhints.cxx b/sw/source/core/txtnode/ndhints.cxx
index 8e3ee60..6c73067 100644
--- a/sw/source/core/txtnode/ndhints.cxx
+++ b/sw/source/core/txtnode/ndhints.cxx
@@ -144,12 +144,12 @@ bool CompareSwpHtEnd::operator()( const SwTextAttr* lhs, const SwTextAttr* rhs )
return ( nHt1 < nHt2 );
}
void SwpHints::Insert( const SwTextAttr *pHt )
void SwpHints::Insert(SwTextAttr* pHt)
{
assert(std::find(m_HintsByStart.begin(), m_HintsByStart.end(), const_cast<SwTextAttr*>(pHt))
assert(std::find(m_HintsByStart.begin(), m_HintsByStart.end(), pHt)
== m_HintsByStart.end()); // "Insert: hint already in HtStart"
assert( pHt->m_pHints == nullptr );
const_cast<SwTextAttr*>(pHt)->m_pHints = this;
pHt->m_pHints = this;
if (m_bStartMapNeedsSorting)
ResortStartMap();
@@ -158,14 +158,14 @@ void SwpHints::Insert( const SwTextAttr *pHt )
if (m_bWhichMapNeedsSorting)
ResortWhichMap();
auto it1 = std::lower_bound(m_HintsByStart.begin(), m_HintsByStart.end(), const_cast<SwTextAttr*>(pHt), CompareSwpHtStart);
m_HintsByStart.insert(it1, const_cast<SwTextAttr*>(pHt));
auto it1 = std::lower_bound(m_HintsByStart.begin(), m_HintsByStart.end(), pHt, CompareSwpHtStart);
m_HintsByStart.insert(it1, pHt);
auto it2 = std::lower_bound(m_HintsByEnd.begin(), m_HintsByEnd.end(), const_cast<SwTextAttr*>(pHt), CompareSwpHtEnd());
m_HintsByEnd.insert(it2, const_cast<SwTextAttr*>(pHt));
auto it2 = std::lower_bound(m_HintsByEnd.begin(), m_HintsByEnd.end(), pHt, CompareSwpHtEnd());
m_HintsByEnd.insert(it2, pHt);
auto it3 = std::lower_bound(m_HintsByWhichAndStart.begin(), m_HintsByWhichAndStart.end(), const_cast<SwTextAttr*>(pHt), CompareSwpHtWhichStart());
m_HintsByWhichAndStart.insert(it3, const_cast<SwTextAttr*>(pHt));
auto it3 = std::lower_bound(m_HintsByWhichAndStart.begin(), m_HintsByWhichAndStart.end(), pHt, CompareSwpHtWhichStart());
m_HintsByWhichAndStart.insert(it3, pHt);
}
bool SwpHints::Contains( const SwTextAttr *pHt ) const