diff options
author | Eike Rathke <erack@redhat.com> | 2017-04-26 16:01:53 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2017-04-26 16:03:26 +0200 |
commit | 662f372d3e5751f92609a1e2535ee1388a8fd1cf (patch) | |
tree | 65d36a467cc031b473599e5321cc3583fef3ac27 /editeng | |
parent | b2fdb61446bc072ae1b6db380a584a87a1173f11 (diff) |
ParaPortionList::SafeGetObject: SAL_WARN_IF nPos out of bounds
Change-Id: Id21e86a0db5be9f12c377d5bb48265dd2e12b9bb
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/editeng/editdoc.cxx | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/editeng/source/editeng/editdoc.cxx b/editeng/source/editeng/editdoc.cxx index 26728ffbd853..1ba99bf61fd5 100644 --- a/editeng/source/editeng/editdoc.cxx +++ b/editeng/source/editeng/editdoc.cxx @@ -826,11 +826,15 @@ sal_Int32 ParaPortionList::FindParagraph(long nYOffset) const const ParaPortion* ParaPortionList::SafeGetObject(sal_Int32 nPos) const { + SAL_WARN_IF( nPos < 0 || nPos >= (sal_Int32)maPortions.size(), "editeng", + "ParaPortionList::SafeGetObject - nPos out of bounds: " << nPos << " size: " << maPortions.size()); return 0 <= nPos && nPos < (sal_Int32)maPortions.size() ? maPortions[nPos].get() : nullptr; } ParaPortion* ParaPortionList::SafeGetObject(sal_Int32 nPos) { + SAL_WARN_IF( nPos < 0 || nPos >= (sal_Int32)maPortions.size(), "editeng", + "ParaPortionList::SafeGetObject - nPos out of bounds: " << nPos << " size: " << maPortions.size()); return 0 <= nPos && nPos < (sal_Int32)maPortions.size() ? maPortions[nPos].get() : nullptr; } |