summaryrefslogtreecommitdiff
path: root/editeng
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-08-02 15:58:52 +0100
committerCaolán McNamara <caolanm@redhat.com>2018-08-02 22:16:21 +0200
commit1cb3195fa7859618736002dedc3bd0ff7e164c35 (patch)
tree40c2e2ba540f5a0d867694de71396f0924fce72c /editeng
parent668e68d3dfe7f187c51c5ff9af752a8d0369b426 (diff)
coverity#1438198 silence using invalid iterator
Change-Id: Ibccf6d3838335ae2d8a3a7f8187df8f2e173f043 Reviewed-on: https://gerrit.libreoffice.org/58482 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'editeng')
-rw-r--r--editeng/source/editeng/impedit2.cxx7
1 files changed, 5 insertions, 2 deletions
diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx
index 38d99f120830..c075a8ae6f59 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -1737,8 +1737,11 @@ void ImpEditEngine::InitScriptTypes( sal_Int32 nPara )
++nIdx;
// Remove any entries *inside* the current run:
- while ( nIdx < rTypes.size() && rTypes[nIdx].nEndPos <= nEnd )
- rTypes.erase( rTypes.begin()+nIdx );
+ while (nIdx < rTypes.size() && rTypes[nIdx].nEndPos <= nEnd)
+ {
+ // coverity[use_iterator] - we're protected from a bad iterator by the above condition
+ rTypes.erase(rTypes.begin() + nIdx);
+ }
// special case:
if(nIdx < rTypes.size() && rTypes[nIdx].nStartPos < nStart && rTypes[nIdx].nEndPos > nEnd)