diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/ByteAddressContainer.cpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/ByteAddressContainer.cpp index 5844cc8d..ff50b005 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/ByteAddressContainer.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/ByteAddressContainer.cpp @@ -23,13 +23,13 @@ void ByteAddressContainer::adjustAddressLabels( for (const auto& mappingPair : byteItemsByRowIndex) { const auto rowIndex = static_cast(mappingPair.first); - const auto& byteWidgets = mappingPair.second; + const auto& byteItems = mappingPair.second; - if (byteWidgets.empty()) { + if (byteItems.empty()) { continue; } - ByteAddressItem* addressLabel; + ByteAddressItem* addressLabel = nullptr; if (static_cast(rowIndex) > layoutItemMaxIndex) { addressLabel = new ByteAddressItem(this); this->addressItemsByRowIndex.insert(std::pair(rowIndex, addressLabel)); @@ -38,10 +38,11 @@ void ByteAddressContainer::adjustAddressLabels( addressLabel = this->addressItemsByRowIndex.at(rowIndex); } - addressLabel->setAddressHex(byteWidgets.front()->relativeAddressHex); + const auto& firstByteItem = byteItems.front(); + addressLabel->setAddressHex(firstByteItem->relativeAddressHex); addressLabel->setPos( 0, - margins.top() + static_cast(rowIndex * (ByteAddressItem::HEIGHT + ByteItem::BOTTOM_MARGIN)) + firstByteItem->pos().y() ); }