[Libreoffice-commits] core.git: sw/source
Tor Lillqvist
tml at collabora.com
Thu Sep 1 10:24:20 UTC 2016
sw/source/core/doc/docredln.cxx | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
New commits:
commit b4a1c54e6ca203fb364d37dccac5ce3160793989
Author: Tor Lillqvist <tml at collabora.com>
Date: Thu Sep 1 13:21:15 2016 +0300
More informative warning
No idea whether the warning is useful, though, but at least now it
tells what the value of Pos is and how much "too big" that is.
Change-Id: Ib2794f0484a660715c78e1341b1f8c66e3e2f77e
diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx
index 8a2e2be..a293c04 100644
--- a/sw/source/core/doc/docredln.cxx
+++ b/sw/source/core/doc/docredln.cxx
@@ -1631,18 +1631,20 @@ bool SwRangeRedline::operator<( const SwRangeRedline& rCmp ) const
return *Start() == *rCmp.Start() && *End() < *rCmp.End();
}
-const SwRedlineData & SwRangeRedline::GetRedlineData(sal_uInt16 nPos) const
+const SwRedlineData & SwRangeRedline::GetRedlineData(const sal_uInt16 nPos) const
{
SwRedlineData * pCur = pRedlineData;
- while (nPos > 0 && nullptr != pCur->pNext)
+ sal_uInt16 nP = nPos;
+
+ while (nP > 0 && nullptr != pCur->pNext)
{
pCur = pCur->pNext;
- nPos--;
+ nP--;
}
- OSL_ENSURE( 0 == nPos, "Pos is too big" );
+ SAL_WARN_IF( nP != 0, "sw.core", "Pos " << nPos << " is " << nP << " too big");
return *pCur;
}
More information about the Libreoffice-commits
mailing list