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:
Axel Dörfler
2004-03-02 11:43:22 +00:00
parent f7d4bc0920
commit 0513501c11
+4 -4
View File
@@ -1432,8 +1432,8 @@ ProbeView::UpdateSelectionMenuItems(int64 start, int64 end)
snprintf(buffer, sizeof(buffer), "Native: %Ld (0x%0*Lx)", position, size * 2, position);
fNativeMenuItem->SetLabel(buffer);
fNativeMenuItem->SetEnabled(position >= 0 && position < fEditor.FileSize());
fNativeMenuItem->Message()->ReplaceInt64("position", position * fEditor.BlockSize());
fNativeMenuItem->SetEnabled(position >= 0 && (position * fEditor.BlockSize()) < fEditor.FileSize());
fNativeMenuItem->Message()->ReplaceInt64("block", position);
position = B_SWAP_INT64(position) >> (8 * (8 - size));
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);
fSwappedMenuItem->SetLabel(buffer);
fSwappedMenuItem->SetEnabled(position >= 0 && position < fEditor.FileSize());
fSwappedMenuItem->Message()->ReplaceInt64("position", position * fEditor.BlockSize());
fSwappedMenuItem->SetEnabled(position >= 0 && (position * fEditor.BlockSize()) < fEditor.FileSize());
fSwappedMenuItem->Message()->ReplaceInt64("block", position);
}