From f92fecf1e5781977ef31022e872887cac33a073c Mon Sep 17 00:00:00 2001 From: "mjudge%netscape.com" Date: Fri, 23 Jun 2000 04:00:45 +0000 Subject: [PATCH] fix for 42188, r=akkana 42347. use selection controller to tell the doc if it should display non-text-selection. --- editor/base/nsEditor.cpp | 3 ++- editor/base/nsHTMLEditor.cpp | 5 ++--- editor/libeditor/base/nsEditor.cpp | 3 ++- editor/libeditor/html/nsHTMLEditor.cpp | 5 ++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/editor/base/nsEditor.cpp b/editor/base/nsEditor.cpp index 8c287835daec..b6c446647c24 100644 --- a/editor/base/nsEditor.cpp +++ b/editor/base/nsEditor.cpp @@ -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: diff --git a/editor/base/nsHTMLEditor.cpp b/editor/base/nsHTMLEditor.cpp index a9c44c4c3059..09199b49bdbc 100644 --- a/editor/base/nsHTMLEditor.cpp +++ b/editor/base/nsHTMLEditor.cpp @@ -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 ps = do_QueryReferent(mPresShellWeak); - nsCOMPtr selCont (do_QueryInterface(ps)); + if (!mSelConWeak) return NS_ERROR_NOT_INITIALIZED; + nsCOMPtr selCont (do_QueryReferent(mSelConWeak)); if (!selCont) return NS_ERROR_NO_INTERFACE; diff --git a/editor/libeditor/base/nsEditor.cpp b/editor/libeditor/base/nsEditor.cpp index 8c287835daec..b6c446647c24 100644 --- a/editor/libeditor/base/nsEditor.cpp +++ b/editor/libeditor/base/nsEditor.cpp @@ -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: diff --git a/editor/libeditor/html/nsHTMLEditor.cpp b/editor/libeditor/html/nsHTMLEditor.cpp index a9c44c4c3059..09199b49bdbc 100644 --- a/editor/libeditor/html/nsHTMLEditor.cpp +++ b/editor/libeditor/html/nsHTMLEditor.cpp @@ -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 ps = do_QueryReferent(mPresShellWeak); - nsCOMPtr selCont (do_QueryInterface(ps)); + if (!mSelConWeak) return NS_ERROR_NOT_INITIALIZED; + nsCOMPtr selCont (do_QueryReferent(mSelConWeak)); if (!selCont) return NS_ERROR_NO_INTERFACE;