fix for 42188, r=akkana 42347. use selection controller to tell the doc if it should display non-text-selection.

This commit is contained in:
mjudge%netscape.com 2000-06-23 04:00:45 +00:00
parent b564d158b3
commit f92fecf1e5
4 changed files with 8 additions and 8 deletions

View File

@ -860,7 +860,6 @@ nsEditor::Init(nsIDOMDocument *aDoc, nsIPresShell* aPresShell, nsIContent *aRoot
if (!mViewManager) {return NS_ERROR_NULL_POINTER;}
mViewManager->Release(); //we want a weak link
ps->SetDisplayNonTextSelection(PR_TRUE);//we want to see all the selection reflected to user
mUpdateCount=0;
InsertTextTxn::ClassInit();
@ -873,6 +872,8 @@ nsEditor::Init(nsIDOMDocument *aDoc, nsIPresShell* aPresShell, nsIContent *aRoot
/* Show the caret */
aSelCon->SetCaretReadOnly(PR_FALSE);
aSelCon->SetDisplaySelection(nsISelectionController::SELECTION_ON);
aSelCon->SetDisplayNonTextSelection(PR_TRUE);//we want to see all the selection reflected to user
// Set the selection to the beginning:

View File

@ -2286,9 +2286,8 @@ NS_IMETHODIMP nsHTMLEditor::DeleteSelection(nsIEditor::EDirection aAction)
if (aAction == eNextWord || aAction == ePreviousWord
|| aAction == eToBeginningOfLine || aAction == eToEndOfLine)
{
if (!mPresShellWeak) return NS_ERROR_NOT_INITIALIZED;
nsCOMPtr<nsIPresShell> ps = do_QueryReferent(mPresShellWeak);
nsCOMPtr<nsISelectionController> selCont (do_QueryInterface(ps));
if (!mSelConWeak) return NS_ERROR_NOT_INITIALIZED;
nsCOMPtr<nsISelectionController> selCont (do_QueryReferent(mSelConWeak));
if (!selCont)
return NS_ERROR_NO_INTERFACE;

View File

@ -860,7 +860,6 @@ nsEditor::Init(nsIDOMDocument *aDoc, nsIPresShell* aPresShell, nsIContent *aRoot
if (!mViewManager) {return NS_ERROR_NULL_POINTER;}
mViewManager->Release(); //we want a weak link
ps->SetDisplayNonTextSelection(PR_TRUE);//we want to see all the selection reflected to user
mUpdateCount=0;
InsertTextTxn::ClassInit();
@ -873,6 +872,8 @@ nsEditor::Init(nsIDOMDocument *aDoc, nsIPresShell* aPresShell, nsIContent *aRoot
/* Show the caret */
aSelCon->SetCaretReadOnly(PR_FALSE);
aSelCon->SetDisplaySelection(nsISelectionController::SELECTION_ON);
aSelCon->SetDisplayNonTextSelection(PR_TRUE);//we want to see all the selection reflected to user
// Set the selection to the beginning:

View File

@ -2286,9 +2286,8 @@ NS_IMETHODIMP nsHTMLEditor::DeleteSelection(nsIEditor::EDirection aAction)
if (aAction == eNextWord || aAction == ePreviousWord
|| aAction == eToBeginningOfLine || aAction == eToEndOfLine)
{
if (!mPresShellWeak) return NS_ERROR_NOT_INITIALIZED;
nsCOMPtr<nsIPresShell> ps = do_QueryReferent(mPresShellWeak);
nsCOMPtr<nsISelectionController> selCont (do_QueryInterface(ps));
if (!mSelConWeak) return NS_ERROR_NOT_INITIALIZED;
nsCOMPtr<nsISelectionController> selCont (do_QueryReferent(mSelConWeak));
if (!selCont)
return NS_ERROR_NO_INTERFACE;