sw/source/ui/wrtsh/wrtsh1.cxx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
New commits: commit 8b6402b926f5237f9e3730ffc8770e5472cb5903 Author: Caolán McNamara <caol...@redhat.com> Date: Wed Sep 11 11:15:40 2013 +0100 CID#736213 clip nLevel to legal bounds Change-Id: I805425885ea86fdaf658d89f955a47769782c0cd diff --git a/sw/source/ui/wrtsh/wrtsh1.cxx b/sw/source/ui/wrtsh/wrtsh1.cxx index a029164..0cda8cf 100644 --- a/sw/source/ui/wrtsh/wrtsh1.cxx +++ b/sw/source/ui/wrtsh/wrtsh1.cxx @@ -1325,8 +1325,15 @@ void SwWrtShell::NumOrBulletOff() if (pTxtNode) { - sal_uInt16 nLevel = sal::static_int_cast<sal_uInt16, sal_Int32>(pTxtNode->GetActualListLevel()); - SwNumFmt aFmt(aNumRule.Get(nLevel)); + int nLevel = pTxtNode->GetActualListLevel(); + + if (nLevel < 0) + nLevel = 0; + + if (nLevel >= MAXLEVEL) + nLevel = MAXLEVEL - 1; + + SwNumFmt aFmt(aNumRule.Get(static_cast<sal_uInt16>(nLevel))); aFmt.SetNumberingType(SVX_NUM_NUMBER_NONE); aNumRule.Set(nLevel, aFmt);
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits