Fix crash in context menu for edit formats.

Ensure type is in range.

Change-Id: I850eab05d365fca4fbf86ca3e7753e117d3f2f2a
Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
Friedemann Kleint
2012-12-28 18:51:32 +01:00
committed by hjk
parent 82b781f5a7
commit 9043898f6f

View File

@@ -616,8 +616,10 @@ void WatchTreeView::contextMenuEvent(QContextMenuEvent *ev)
const QStringList alternativeFormats =
mi0.data(LocalsTypeFormatListRole).toStringList();
const int typeFormat =
int typeFormat =
mi0.data(LocalsTypeFormatRole).toInt();
if (typeFormat >= alternativeFormats.size())
typeFormat = -1;
const int individualFormat =
mi0.data(LocalsIndividualFormatRole).toInt();
const int unprintableBase = handler->unprintableBase();