[Libreoffice-commits] core.git: editeng/source
Eike Rathke
erack at redhat.com
Wed Apr 26 14:03:53 UTC 2017
editeng/source/editeng/editdoc.cxx | 4 ++++
1 file changed, 4 insertions(+)
New commits:
commit 662f372d3e5751f92609a1e2535ee1388a8fd1cf
Author: Eike Rathke <erack at redhat.com>
Date: Wed Apr 26 16:01:53 2017 +0200
ParaPortionList::SafeGetObject: SAL_WARN_IF nPos out of bounds
Change-Id: Id21e86a0db5be9f12c377d5bb48265dd2e12b9bb
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;
}
More information about the Libreoffice-commits
mailing list