diff options
-rw-r--r-- | o3tl/inc/o3tl/sorted_vector.hxx | 12 | ||||
-rw-r--r-- | sw/source/core/doc/acmplwrd.cxx | 5 |
2 files changed, 16 insertions, 1 deletions
diff --git a/o3tl/inc/o3tl/sorted_vector.hxx b/o3tl/inc/o3tl/sorted_vector.hxx index b3ffc4ff8d41..bf1cca5eb937 100644 --- a/o3tl/inc/o3tl/sorted_vector.hxx +++ b/o3tl/inc/o3tl/sorted_vector.hxx @@ -67,6 +67,18 @@ public: base_t::erase( begin_nonconst() + index ); } + // hack: public erase with const_iterator, should not change sort order + void erase(const_iterator const& position) + { + base_t::erase(begin_nonconst() + (position - begin())); + } + + void erase(const_iterator const& first, const_iterator const& last) + { + base_t::erase(begin_nonconst() + (first - begin()), + begin_nonconst() + (last - begin())); + } + // ACCESSORS // Only return a const iterator, so that the vector cannot be directly updated. diff --git a/sw/source/core/doc/acmplwrd.cxx b/sw/source/core/doc/acmplwrd.cxx index 138dcd115f7e..87c070288412 100644 --- a/sw/source/core/doc/acmplwrd.cxx +++ b/sw/source/core/doc/acmplwrd.cxx @@ -318,8 +318,11 @@ void SwAutoCompleteWord::SetMaxCount( sal_uInt16 nNewMax ) sal_uInt16 nLRUIndex = nNewMax-1; while( nNewMax < aWordLst.size() && nLRUIndex < aLRULst.size()) { - SvStringsISortDtor::iterator it = aWordLst.find( aLRULst[ nLRUIndex++ ] ); + SvStringsISortDtor::const_iterator it = + aWordLst.find( aLRULst[ nLRUIndex++ ] ); OSL_ENSURE( aWordLst.end() != it, "String not found" ); + //FIXME this is utterly horrid: SwAutoCompleteString should + // NOT derive from String SwAutoCompleteString* pDel = (SwAutoCompleteString*) *it; aWordLst.erase( it ); delete pDel; |