GUI: use the correct index when displaying the disasm/summary columns in BreakpointsView

closes #1696
This commit is contained in:
mrexodia 2017-08-26 13:10:14 +02:00
parent 88fec2a1d3
commit 95bfa7ec0e
No known key found for this signature in database
GPG Key ID: FC89E0AAA0C1AAD8

View File

@ -148,7 +148,8 @@ QString BreakpointsView::paintContent(QPainter* painter, dsint rowBase, int rowO
painter->fillRect(QRect(x, y, w, h), QBrush(col == ColDisasm ? mDisasmSelectionColor : selectionColor));
else if(col == ColDisasm)
painter->fillRect(QRect(x, y, w, h), QBrush(mDisasmBackgroundColor));
auto & bp = mBps.at(bpIndex(rowBase + rowOffset));
auto index = bpIndex(rowBase + rowOffset);
auto & bp = mBps.at(index);
auto cellContent = getCellContent(rowBase + rowOffset, col);
if(col > ColType && !bp.addr && !bp.active)
{
@ -169,12 +170,12 @@ QString BreakpointsView::paintContent(QPainter* painter, dsint rowBase, int rowO
}
else if(col == ColDisasm)
{
RichTextPainter::paintRichText(painter, x + 4, y, w - 4, h, 0, mRich.at(rowBase + rowOffset).first, mFontMetrics);
RichTextPainter::paintRichText(painter, x + 4, y, w - 4, h, 0, mRich.at(index).first, mFontMetrics);
return QString();
}
else if(col == ColSummary)
{
RichTextPainter::paintRichText(painter, x + 4, y, w - 4, h, 0, mRich.at(rowBase + rowOffset).second, mFontMetrics);
RichTextPainter::paintRichText(painter, x + 4, y, w - 4, h, 0, mRich.at(index).second, mFontMetrics);
return QString();
}
return cellContent;