diff options
author | Matteo Casalin <matteo.casalin@yahoo.com> | 2015-08-15 15:03:35 +0200 |
---|---|---|
committer | Matteo Casalin <matteo.casalin@yahoo.com> | 2015-08-16 09:10:20 +0200 |
commit | 9d0f86326cbf6b986176c5b5fe7660fa510c8d70 (patch) | |
tree | 22c1a2a0f286ad25752c09d89c1587234acf387f /svtools | |
parent | 7d5f47aff58fbe57ff24a4e4052bc1149fc5829d (diff) |
Rework loops so to have exit condition on correct unsigned value
Change-Id: I91e647d6b1aebe8342f95c88fc81bd2c5a43ce71
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/edit/editsyntaxhighlighter.cxx | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/svtools/source/edit/editsyntaxhighlighter.cxx b/svtools/source/edit/editsyntaxhighlighter.cxx index 224017a5e153..cf734c0cf6ff 100644 --- a/svtools/source/edit/editsyntaxhighlighter.cxx +++ b/svtools/source/edit/editsyntaxhighlighter.cxx @@ -43,7 +43,7 @@ void MultiLineEditSyntaxHighlight::DoBracketHilight(sal_uInt16 nKey) { TextSelection aCurrentPos = GetTextView()->GetSelection(); sal_Int32 nStartPos = aCurrentPos.GetStart().GetIndex(); - sal_Int32 nStartPara = aCurrentPos.GetStart().GetPara(); + const sal_uInt32 nStartPara = aCurrentPos.GetStart().GetPara(); sal_uInt16 nCount = 0; int nChar = -1; @@ -74,7 +74,8 @@ void MultiLineEditSyntaxHighlight::DoBracketHilight(sal_uInt16 nKey) if (nChar != -1) { - for (sal_Int32 nPara = nStartPara; nPara >= 0; --nPara) + sal_uInt32 nPara = nStartPara; + do { if (nPara == nStartPara && nStartPos == 0) continue; @@ -102,7 +103,7 @@ void MultiLineEditSyntaxHighlight::DoBracketHilight(sal_uInt16 nKey) if (aLine[i] == nKey) ++nCount; } - } + } while (nPara--); } } |