mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-04 04:58:00 +00:00
fix for #92673, crash when deleting messages that were selected
using ctrl shift select. r=jan varga, sr=hyatt
This commit is contained in:
parent
463b3575dd
commit
3f2920f219
@ -66,8 +66,25 @@ struct nsOutlinerRange
|
||||
};
|
||||
|
||||
void RemoveRange(PRInt32 aStart, PRInt32 aEnd) {
|
||||
// Do the start and end encompass us?
|
||||
if (mMin >= aStart && mMax <= aEnd) {
|
||||
// They do. We should simply be excised from the list.
|
||||
if (mPrev)
|
||||
mPrev->mNext = mNext;
|
||||
else
|
||||
mSelection->mFirstRange = mNext;
|
||||
|
||||
nsOutlinerRange* next = mNext;
|
||||
if (next)
|
||||
next->mPrev = mPrev;
|
||||
mPrev = mNext = nsnull;
|
||||
delete this;
|
||||
if (next)
|
||||
next->RemoveRange(aStart, aEnd);
|
||||
return;
|
||||
}
|
||||
// See if this range overlaps.
|
||||
if (aStart >= mMin && aStart <= mMax) {
|
||||
else if (aStart >= mMin && aStart <= mMax) {
|
||||
// We start within this range.
|
||||
// Do we also end within this range?
|
||||
if (aEnd >= mMin && aEnd <= mMax) {
|
||||
@ -95,25 +112,7 @@ struct nsOutlinerRange
|
||||
return; // We're done, since we contained the end.
|
||||
}
|
||||
else {
|
||||
// Neither the start nor the end was contained inside us.
|
||||
// Do the start and end encompass us instead?
|
||||
if (mMin >= aStart && mMax <= aEnd) {
|
||||
// They do. We should simply be excised from the list.
|
||||
if (mPrev)
|
||||
mPrev->mNext = mNext;
|
||||
else
|
||||
mSelection->mFirstRange = mNext;
|
||||
|
||||
nsOutlinerRange* next = mNext;
|
||||
if (next)
|
||||
next->mPrev = mPrev;
|
||||
mPrev = mNext = nsnull;
|
||||
delete this;
|
||||
if (next)
|
||||
next->RemoveRange(aStart, aEnd);
|
||||
return;
|
||||
}
|
||||
|
||||
// Neither the start nor the end was contained inside us, move on.
|
||||
if (mNext)
|
||||
mNext->RemoveRange(aStart, aEnd);
|
||||
}
|
||||
|
@ -66,8 +66,25 @@ struct nsOutlinerRange
|
||||
};
|
||||
|
||||
void RemoveRange(PRInt32 aStart, PRInt32 aEnd) {
|
||||
// Do the start and end encompass us?
|
||||
if (mMin >= aStart && mMax <= aEnd) {
|
||||
// They do. We should simply be excised from the list.
|
||||
if (mPrev)
|
||||
mPrev->mNext = mNext;
|
||||
else
|
||||
mSelection->mFirstRange = mNext;
|
||||
|
||||
nsOutlinerRange* next = mNext;
|
||||
if (next)
|
||||
next->mPrev = mPrev;
|
||||
mPrev = mNext = nsnull;
|
||||
delete this;
|
||||
if (next)
|
||||
next->RemoveRange(aStart, aEnd);
|
||||
return;
|
||||
}
|
||||
// See if this range overlaps.
|
||||
if (aStart >= mMin && aStart <= mMax) {
|
||||
else if (aStart >= mMin && aStart <= mMax) {
|
||||
// We start within this range.
|
||||
// Do we also end within this range?
|
||||
if (aEnd >= mMin && aEnd <= mMax) {
|
||||
@ -95,25 +112,7 @@ struct nsOutlinerRange
|
||||
return; // We're done, since we contained the end.
|
||||
}
|
||||
else {
|
||||
// Neither the start nor the end was contained inside us.
|
||||
// Do the start and end encompass us instead?
|
||||
if (mMin >= aStart && mMax <= aEnd) {
|
||||
// They do. We should simply be excised from the list.
|
||||
if (mPrev)
|
||||
mPrev->mNext = mNext;
|
||||
else
|
||||
mSelection->mFirstRange = mNext;
|
||||
|
||||
nsOutlinerRange* next = mNext;
|
||||
if (next)
|
||||
next->mPrev = mPrev;
|
||||
mPrev = mNext = nsnull;
|
||||
delete this;
|
||||
if (next)
|
||||
next->RemoveRange(aStart, aEnd);
|
||||
return;
|
||||
}
|
||||
|
||||
// Neither the start nor the end was contained inside us, move on.
|
||||
if (mNext)
|
||||
mNext->RemoveRange(aStart, aEnd);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user