summaryrefslogtreecommitdiff
path: root/sw/inc
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2024-02-17 16:41:41 +0600
committerMike Kaganski <mike.kaganski@collabora.com>2024-02-17 13:50:51 +0100
commitb065496b23f249d9c08a6267d2aaa2fd1c81e56a (patch)
treeeac0f8160b37b511311dd00ab8e108b0f1eed946 /sw/inc
parent8baacea92374319e6f796dca4d1aec7663647105 (diff)
Remove more unneeded const_cast
Change-Id: If62cf2011ae63501cdf5e87a6ee7402aa74b2b3b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163525 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sw/inc')
-rw-r--r--sw/inc/docary.hxx7
1 files changed, 2 insertions, 5 deletions
diff --git a/sw/inc/docary.hxx b/sw/inc/docary.hxx
index dce6a44b7576..5cd132f0ef44 100644
--- a/sw/inc/docary.hxx
+++ b/sw/inc/docary.hxx
@@ -131,7 +131,7 @@ public:
erase( begin() + aStartIdx, begin() + aEndIdx);
}
- size_t GetPos(Value const& p) const
+ size_t GetPos(typename std::remove_pointer_t<Value> const* const p) const
{
const_iterator const it = std::find(begin(), end(), p);
return it == end() ? SIZE_MAX : it - begin();
@@ -159,9 +159,6 @@ public:
virtual Value GetFormat(size_t idx) const override
{ return SwVectorModifyBase<Value>::operator[](idx); }
- size_t GetPos(const SwFormat *p) const
- { return SwVectorModifyBase<Value>::GetPos( static_cast<Value>( const_cast<SwFormat*>( p ) ) ); }
-
// Override return type to reduce casting
virtual Value FindFormatByName(const OUString& rName) const override
{ return static_cast<Value>(SwFormatsBase::FindFormatByName(rName)); }
@@ -230,7 +227,7 @@ private:
mutable sal_uInt32 m_nMaxMovedID = 1; //every move-redline pair get a unique ID, so they can find each other.
public:
~SwRedlineTable();
- bool Contains(const SwRangeRedline* p) const { return maVector.find(const_cast<SwRangeRedline*>(p)) != maVector.end(); }
+ bool Contains(const SwRangeRedline* p) const { return maVector.find(p) != maVector.end(); }
size_type GetPos(const SwRangeRedline* p) const;
bool Insert(SwRangeRedline*& p);