mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-30 01:59:29 +00:00
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:
parent
b564d158b3
commit
f92fecf1e5
@ -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:
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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:
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user