From faa6b71493a3a6be674a01243fc2f52db4398214 Mon Sep 17 00:00:00 2001 From: Luboš Luňák Date: Tue, 29 Mar 2022 12:34:47 +0200 Subject: do not provide non-const iterators for ScMarkData internals MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It's a bad idea, and it's actually not needed. Change-Id: Ic1022bc4774a33abbc37158539881a15792bc282 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132266 Tested-by: Jenkins Reviewed-by: Luboš Luňák --- sc/inc/markdata.hxx | 3 --- sc/source/ui/view/viewdata.cxx | 4 ++-- 2 files changed, 2 insertions(+), 5 deletions(-) (limited to 'sc') diff --git a/sc/inc/markdata.hxx b/sc/inc/markdata.hxx index ddc550f4bd42..80d683f168b1 100644 --- a/sc/inc/markdata.hxx +++ b/sc/inc/markdata.hxx @@ -158,11 +158,8 @@ public: const ScRangeList& GetRightEnvelope() const { return aRightEnvelope; } // iterators for table access - typedef std::set::iterator iterator; typedef std::set::const_iterator const_iterator; typedef std::set::const_reverse_iterator const_reverse_iterator; - iterator begin() { return maTabMarked.begin(); } - iterator end() { return maTabMarked.end(); } const_iterator begin() const { return maTabMarked.begin(); } const_iterator end() const { return maTabMarked.end(); } const_reverse_iterator rbegin() const { return maTabMarked.rbegin(); } diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx index b77172ce9ba8..d7aa279c7413 100644 --- a/sc/source/ui/view/viewdata.cxx +++ b/sc/source/ui/view/viewdata.cxx @@ -1022,7 +1022,7 @@ void ScViewData::SetZoomType( SvxZoomType eNew, bool bAll ) std::vector< SCTAB > vTabs; // Empty for all tabs if ( !bAll ) // get selected tabs { - ScMarkData::iterator itr = maMarkData.begin(), itrEnd = maMarkData.end(); + ScMarkData::const_iterator itr = maMarkData.begin(), itrEnd = maMarkData.end(); vTabs.insert(vTabs.begin(), itr, itrEnd); } SetZoomType( eNew, vTabs ); @@ -1096,7 +1096,7 @@ void ScViewData::SetZoom( const Fraction& rNewX, const Fraction& rNewY, bool bAl std::vector< SCTAB > vTabs; if ( !bAll ) // get selected tabs { - ScMarkData::iterator itr = maMarkData.begin(), itrEnd = maMarkData.end(); + ScMarkData::const_iterator itr = maMarkData.begin(), itrEnd = maMarkData.end(); vTabs.insert(vTabs.begin(), itr, itrEnd); } SetZoom( rNewX, rNewY, vTabs ); -- cgit