зеркало из https://github.com/mozilla/pjs.git
Bug 670058 Stop drag handling for selection when the dragging frame selection detaches presShell r=smaug
This commit is contained in:
Родитель
ea574b1992
Коммит
1089ca4946
|
@ -378,6 +378,11 @@ public:
|
||||||
return sDraggingFrameSelection;
|
return sDraggingFrameSelection;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Call AbortDragForSelection() when we abort handling the drag as selecting.
|
||||||
|
*/
|
||||||
|
void AbortDragForSelection();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
if we are in table cell selection mode. aka ctrl click in table cell
|
if we are in table cell selection mode. aka ctrl click in table cell
|
||||||
*/
|
*/
|
||||||
|
@ -616,7 +621,11 @@ public:
|
||||||
|
|
||||||
nsIPresShell *GetShell()const { return mShell; }
|
nsIPresShell *GetShell()const { return mShell; }
|
||||||
|
|
||||||
void DisconnectFromPresShell() { StopAutoScrollTimer(); mShell = nsnull; }
|
void DisconnectFromPresShell()
|
||||||
|
{
|
||||||
|
AbortDragForSelection();
|
||||||
|
mShell = nsnull;
|
||||||
|
}
|
||||||
private:
|
private:
|
||||||
nsresult TakeFocus(nsIContent *aNewFocus,
|
nsresult TakeFocus(nsIContent *aNewFocus,
|
||||||
PRUint32 aContentOffset,
|
PRUint32 aContentOffset,
|
||||||
|
|
|
@ -1927,15 +1927,33 @@ nsFrameSelection::SetMouseDownState(PRBool aState)
|
||||||
mMouseDownState = aState;
|
mMouseDownState = aState;
|
||||||
|
|
||||||
if (mMouseDownState) {
|
if (mMouseDownState) {
|
||||||
|
if (sDraggingFrameSelection) {
|
||||||
|
sDraggingFrameSelection->AbortDragForSelection();
|
||||||
|
}
|
||||||
sDraggingFrameSelection = this;
|
sDraggingFrameSelection = this;
|
||||||
} else {
|
} else {
|
||||||
sDraggingFrameSelection = nsnull;
|
if (sDraggingFrameSelection == this) {
|
||||||
|
sDraggingFrameSelection = nsnull;
|
||||||
|
}
|
||||||
mDragSelectingCells = PR_FALSE;
|
mDragSelectingCells = PR_FALSE;
|
||||||
PostReason(nsISelectionListener::MOUSEUP_REASON);
|
PostReason(nsISelectionListener::MOUSEUP_REASON);
|
||||||
NotifySelectionListeners(nsISelectionController::SELECTION_NORMAL); //notify that reason is mouse up please.
|
NotifySelectionListeners(nsISelectionController::SELECTION_NORMAL); //notify that reason is mouse up please.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
nsFrameSelection::AbortDragForSelection()
|
||||||
|
{
|
||||||
|
if (sDraggingFrameSelection == this) {
|
||||||
|
sDraggingFrameSelection = nsnull;
|
||||||
|
mMouseDownState = PR_FALSE;
|
||||||
|
mDragSelectingCells = PR_FALSE;
|
||||||
|
PostReason(nsISelectionListener::NO_REASON);
|
||||||
|
NotifySelectionListeners(nsISelectionController::SELECTION_NORMAL);
|
||||||
|
}
|
||||||
|
StopAutoScrollTimer();
|
||||||
|
}
|
||||||
|
|
||||||
nsISelection*
|
nsISelection*
|
||||||
nsFrameSelection::GetSelection(SelectionType aType) const
|
nsFrameSelection::GetSelection(SelectionType aType) const
|
||||||
{
|
{
|
||||||
|
|
Загрузка…
Ссылка в новой задаче