mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-11 01:57:00 +00:00
Bug 906150 - initialize an empty RangeData at each point of use in nsSelection.cpp; r=smaug
This commit is contained in:
parent
48f413a43c
commit
a928ea6f0d
@ -129,8 +129,6 @@ struct CachedOffsetForFrame {
|
||||
bool mCanCacheFrameOffset; // cached frame offset is valid?
|
||||
};
|
||||
|
||||
static RangeData sEmptyData(nullptr);
|
||||
|
||||
// Stack-class to turn on/off selection batching for table selection
|
||||
class MOZ_STACK_CLASS nsSelectionBatcher MOZ_FINAL
|
||||
{
|
||||
@ -4525,7 +4523,8 @@ Selection::GetRangeCount(int32_t* aRangeCount)
|
||||
NS_IMETHODIMP
|
||||
Selection::GetRangeAt(int32_t aIndex, nsIDOMRange** aReturn)
|
||||
{
|
||||
*aReturn = mRanges.SafeElementAt(aIndex, sEmptyData).mRange;
|
||||
RangeData empty(nullptr);
|
||||
*aReturn = mRanges.SafeElementAt(aIndex, empty).mRange;
|
||||
if (!*aReturn) {
|
||||
return NS_ERROR_DOM_INDEX_SIZE_ERR;
|
||||
}
|
||||
@ -4538,7 +4537,8 @@ Selection::GetRangeAt(int32_t aIndex, nsIDOMRange** aReturn)
|
||||
nsRange*
|
||||
Selection::GetRangeAt(int32_t aIndex)
|
||||
{
|
||||
return mRanges.SafeElementAt(aIndex, sEmptyData).mRange;
|
||||
RangeData empty(nullptr);
|
||||
return mRanges.SafeElementAt(aIndex, empty).mRange;
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
x
Reference in New Issue
Block a user