Fixed two bugs:
- when undoing the first change, any later change would make that first change reappear - in hex mode editing, changes were not merged because they changed the same byte Updated version info. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13801 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
da1f176a9a
commit
08f833c027
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2004, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
|
||||
* Copyright 2004-2005, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
|
||||
|
@ -290,6 +290,19 @@ ReplaceChange::Merge(DataChange *_change)
|
|||
if (change == NULL)
|
||||
return false;
|
||||
|
||||
if (change->fOffset + change->fSize == fOffset + fSize && change->fSize == 1) {
|
||||
// this is a special case - the new change changed the last byte of
|
||||
// the old change: we do this since the same byte is changed twice
|
||||
// in hex mode editing.
|
||||
fNewData[fSize - 1] = change->fNewData[0];
|
||||
#ifdef TRACE_DATA_EDITOR
|
||||
printf("Merge one byte %p (offset = %Ld, size = %lu):\n", this, fOffset, fSize);
|
||||
dump_block(fOldData, fSize, "old:");
|
||||
dump_block(fNewData, fSize, "new:");
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
// are the changes adjacent?
|
||||
|
||||
if (change->fOffset + change->fSize != fOffset
|
||||
|
@ -721,9 +734,6 @@ DataEditor::Save()
|
|||
void
|
||||
DataEditor::RemoveRedos()
|
||||
{
|
||||
if (fLastChange == NULL)
|
||||
return;
|
||||
|
||||
int32 start = fChanges.IndexOf(fLastChange) + 1;
|
||||
|
||||
for (int32 i = fChanges.CountItems(); i-- > start; ) {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2004, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
|
||||
* Copyright 2004-2005, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
|
||||
|
@ -452,7 +452,7 @@ DiskProbe::AboutRequested()
|
|||
{
|
||||
BAlert *alert = new BAlert("about", "DiskProbe\n"
|
||||
"\twritten by Axel Dörfler\n"
|
||||
"\tCopyright 2004, Haiku.\n\n"
|
||||
"\tCopyright 2004-2005, Haiku.\n\n"
|
||||
"original Be version by Robert Polic\n", "Ok");
|
||||
BTextView *view = alert->TextView();
|
||||
BFont font;
|
||||
|
|
Loading…
Reference in New Issue