Make nsTypedSelection ctors initialize all members (fixes an UMR) and reorder members to save space. b=417895 r+sr=roc a=blocking1.9

This commit is contained in:
mats.palmgren@bredband.net 2008-02-26 07:04:14 -08:00
Родитель 4b9ac0e3e8
Коммит 5b64b41a7c
1 изменённых файлов: 23 добавлений и 23 удалений

Просмотреть файл

@ -343,8 +343,6 @@ private:
// If this requirement is added, the current design makes the most sense, we
// can just remove the array sorted by endings.
nsTArray<RangeData> mRanges;
nsTArray<PRInt32> mRangeEndings; // references info mRanges
#ifdef DEBUG
PRBool ValidateRanges();
#endif
@ -366,19 +364,20 @@ private:
nsIDOMNode* aEndNode, PRInt32 aEndOffset,
PRInt32 aStartSearchingHere);
nsTArray<RangeData> mRanges;
nsTArray<PRInt32> mRangeEndings; // references info mRanges
nsCOMPtr<nsIDOMRange> mAnchorFocusRange;
nsCOMPtr<nsIDOMRange> mOriginalAnchorRange; //used as a point with range gravity for security
nsDirection mDirection; //FALSE = focus, anchor; TRUE = anchor, focus
PRBool mFixupState; //was there a fixup?
nsFrameSelection *mFrameSelection;
nsWeakPtr mPresShellWeak; //weak reference to presshell.
SelectionType mType;//type of this nsTypedSelection;
nsRefPtr<nsAutoScrollTimer> mAutoScrollTimer; // timer for autoscrolling.
nsWeakPtr mPresShellWeak;
nsRefPtr<nsAutoScrollTimer> mAutoScrollTimer;
nsCOMArray<nsISelectionListener> mSelectionListeners;
PRPackedBool mTrueDirection;
nsRevocableEventPtr<ScrollSelectionIntoViewEvent> mScrollEvent;
CachedOffsetForFrame *mCachedOffsetForFrame;
nsDirection mDirection;
SelectionType mType;
PRPackedBool mTrueDirection;
PRPackedBool mFixupState;
};
// Stack-class to turn on/off selection batching for table selection
@ -3987,24 +3986,25 @@ nsFrameSelection::GetDelayedCaretData()
// note: this can return a nil anchor node
nsTypedSelection::nsTypedSelection(nsFrameSelection *aList)
{
mFrameSelection = aList;
mFixupState = PR_FALSE;
mDirection = eDirNext;
mCachedOffsetForFrame = nsnull;
}
nsTypedSelection::nsTypedSelection()
: mFrameSelection(nsnull)
, mCachedOffsetForFrame(nsnull)
, mDirection(eDirNext)
, mType(nsISelectionController::SELECTION_NORMAL)
, mTrueDirection(PR_FALSE)
, mFixupState(PR_FALSE)
{
mFrameSelection = nsnull;
mFixupState = PR_FALSE;
mDirection = eDirNext;
mCachedOffsetForFrame = nsnull;
}
nsTypedSelection::nsTypedSelection(nsFrameSelection *aList)
: mFrameSelection(aList)
, mCachedOffsetForFrame(nsnull)
, mDirection(eDirNext)
, mType(nsISelectionController::SELECTION_NORMAL)
, mTrueDirection(PR_FALSE)
, mFixupState(PR_FALSE)
{
}
nsTypedSelection::~nsTypedSelection()
{