From e9cb2b63a85a64e0da8d7aa6aaebc2ab9560547a Mon Sep 17 00:00:00 2001 From: "mjudge%netscape.com" Date: Tue, 16 Apr 2002 23:26:22 +0000 Subject: [PATCH] fix for up down behavior after typing or selecting sr=kin a=scc r=jfrancis git-svn-id: svn://10.0.0.236/trunk@119176 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/content/base/src/nsSelection.cpp | 3 +++ mozilla/layout/generic/nsSelection.cpp | 3 +++ 2 files changed, 6 insertions(+) diff --git a/mozilla/content/base/src/nsSelection.cpp b/mozilla/content/base/src/nsSelection.cpp index 57af6ad1fe8..8f5ed910613 100644 --- a/mozilla/content/base/src/nsSelection.cpp +++ b/mozilla/content/base/src/nsSelection.cpp @@ -2765,7 +2765,9 @@ nsSelection::TakeFocus(nsIContent *aNewFocus, PRUint32 aContentOffset, } else { + PRBool oldDesiredXSet = mDesiredXSet; //need to keep old desired X if it was set. mDomSelections[index]->Collapse(domNode, aContentOffset); + mDesiredXSet = oldDesiredXSet; //now reset desired X back. mBatching = batching; mChangesDuringBatching = changes; } @@ -5892,6 +5894,7 @@ nsTypedSelection::Collapse(nsIDOMNode* aParentNode, PRInt32 aOffset) { if (!aParentNode) return NS_ERROR_INVALID_ARG; + mFrameSelection->InvalidateDesiredX(); if (!IsValidSelectionPoint(mFrameSelection, aParentNode)) return NS_ERROR_FAILURE; nsresult result; diff --git a/mozilla/layout/generic/nsSelection.cpp b/mozilla/layout/generic/nsSelection.cpp index 57af6ad1fe8..8f5ed910613 100644 --- a/mozilla/layout/generic/nsSelection.cpp +++ b/mozilla/layout/generic/nsSelection.cpp @@ -2765,7 +2765,9 @@ nsSelection::TakeFocus(nsIContent *aNewFocus, PRUint32 aContentOffset, } else { + PRBool oldDesiredXSet = mDesiredXSet; //need to keep old desired X if it was set. mDomSelections[index]->Collapse(domNode, aContentOffset); + mDesiredXSet = oldDesiredXSet; //now reset desired X back. mBatching = batching; mChangesDuringBatching = changes; } @@ -5892,6 +5894,7 @@ nsTypedSelection::Collapse(nsIDOMNode* aParentNode, PRInt32 aOffset) { if (!aParentNode) return NS_ERROR_INVALID_ARG; + mFrameSelection->InvalidateDesiredX(); if (!IsValidSelectionPoint(mFrameSelection, aParentNode)) return NS_ERROR_FAILURE; nsresult result;