Fixed the file size check for the selection items - accidently compared
blocks with bytes. Switched the block offset to using the "block" instead of "position" field in the kMsgPositionUpdate message. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6854 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1432,8 +1432,8 @@ ProbeView::UpdateSelectionMenuItems(int64 start, int64 end)
|
|||||||
snprintf(buffer, sizeof(buffer), "Native: %Ld (0x%0*Lx)", position, size * 2, position);
|
snprintf(buffer, sizeof(buffer), "Native: %Ld (0x%0*Lx)", position, size * 2, position);
|
||||||
|
|
||||||
fNativeMenuItem->SetLabel(buffer);
|
fNativeMenuItem->SetLabel(buffer);
|
||||||
fNativeMenuItem->SetEnabled(position >= 0 && position < fEditor.FileSize());
|
fNativeMenuItem->SetEnabled(position >= 0 && (position * fEditor.BlockSize()) < fEditor.FileSize());
|
||||||
fNativeMenuItem->Message()->ReplaceInt64("position", position * fEditor.BlockSize());
|
fNativeMenuItem->Message()->ReplaceInt64("block", position);
|
||||||
|
|
||||||
position = B_SWAP_INT64(position) >> (8 * (8 - size));
|
position = B_SWAP_INT64(position) >> (8 * (8 - size));
|
||||||
if (fDataView->Base() == kHexBase)
|
if (fDataView->Base() == kHexBase)
|
||||||
@@ -1442,8 +1442,8 @@ ProbeView::UpdateSelectionMenuItems(int64 start, int64 end)
|
|||||||
snprintf(buffer, sizeof(buffer), "Swapped: %Ld (0x%0*Lx)", position, size * 2, position);
|
snprintf(buffer, sizeof(buffer), "Swapped: %Ld (0x%0*Lx)", position, size * 2, position);
|
||||||
|
|
||||||
fSwappedMenuItem->SetLabel(buffer);
|
fSwappedMenuItem->SetLabel(buffer);
|
||||||
fSwappedMenuItem->SetEnabled(position >= 0 && position < fEditor.FileSize());
|
fSwappedMenuItem->SetEnabled(position >= 0 && (position * fEditor.BlockSize()) < fEditor.FileSize());
|
||||||
fSwappedMenuItem->Message()->ReplaceInt64("position", position * fEditor.BlockSize());
|
fSwappedMenuItem->Message()->ReplaceInt64("block", position);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user