зеркало из https://github.com/mozilla/pjs.git
no point in turning off the link handler if we are allready in text only mode.
This commit is contained in:
Родитель
13667e1d72
Коммит
c2c1b3d08f
|
@ -844,11 +844,7 @@ nsEditor::Init(nsIDOMDocument *aDoc, nsIPresShell* aPresShell, nsIContent *aRoot
|
|||
if (aRoot)
|
||||
mBodyElement = do_QueryInterface(aRoot);
|
||||
|
||||
// disable links
|
||||
nsCOMPtr<nsIPresContext> context;
|
||||
ps->GetPresContext(getter_AddRefs(context));
|
||||
if (!context) return NS_ERROR_NULL_POINTER;
|
||||
context->SetLinkHandler(0);
|
||||
|
||||
|
||||
// Set up the DTD
|
||||
// XXX - in the long run we want to get this from the document, but there
|
||||
|
@ -879,7 +875,11 @@ nsEditor::Init(nsIDOMDocument *aDoc, nsIPresShell* aPresShell, nsIContent *aRoot
|
|||
aSelCon->SetDisplaySelection(nsISelectionController::SELECTION_ON);
|
||||
|
||||
// Set the selection to the beginning:
|
||||
BeginningOfDocument();
|
||||
|
||||
//hack to get around this for now.
|
||||
nsCOMPtr<nsIPresShell> shell = do_QueryReferent(mSelConWeak);
|
||||
if (shell)
|
||||
BeginningOfDocument();
|
||||
|
||||
NS_POSTCONDITION(mDocWeak && mPresShellWeak, "bad state");
|
||||
|
||||
|
|
|
@ -74,6 +74,7 @@
|
|||
#include "nsIDocumentEncoder.h"
|
||||
#include "nsIDOMDocumentFragment.h"
|
||||
#include "nsIPresShell.h"
|
||||
#include "nsIPresContext.h"
|
||||
#include "nsIImage.h"
|
||||
#include "nsAOLCiter.h"
|
||||
#include "nsInternetCiter.h"
|
||||
|
@ -398,6 +399,13 @@ NS_IMETHODIMP nsHTMLEditor::Init(nsIDOMDocument *aDoc,
|
|||
result = nsEditor::Init(aDoc, aPresShell, aRoot, aSelCon, aFlags);
|
||||
if (NS_FAILED(result)) { return result; }
|
||||
|
||||
// disable links
|
||||
nsCOMPtr<nsIPresContext> context;
|
||||
aPresShell->GetPresContext(getter_AddRefs(context));
|
||||
if (!context) return NS_ERROR_NULL_POINTER;
|
||||
if (!(mFlags & eEditorPlaintextMask))
|
||||
context->SetLinkHandler(0);
|
||||
|
||||
nsCOMPtr<nsIDOMElement> bodyElement;
|
||||
result = nsEditor::GetRootElement(getter_AddRefs(bodyElement));
|
||||
if (NS_FAILED(result)) { return result; }
|
||||
|
|
|
@ -844,11 +844,7 @@ nsEditor::Init(nsIDOMDocument *aDoc, nsIPresShell* aPresShell, nsIContent *aRoot
|
|||
if (aRoot)
|
||||
mBodyElement = do_QueryInterface(aRoot);
|
||||
|
||||
// disable links
|
||||
nsCOMPtr<nsIPresContext> context;
|
||||
ps->GetPresContext(getter_AddRefs(context));
|
||||
if (!context) return NS_ERROR_NULL_POINTER;
|
||||
context->SetLinkHandler(0);
|
||||
|
||||
|
||||
// Set up the DTD
|
||||
// XXX - in the long run we want to get this from the document, but there
|
||||
|
@ -879,7 +875,11 @@ nsEditor::Init(nsIDOMDocument *aDoc, nsIPresShell* aPresShell, nsIContent *aRoot
|
|||
aSelCon->SetDisplaySelection(nsISelectionController::SELECTION_ON);
|
||||
|
||||
// Set the selection to the beginning:
|
||||
BeginningOfDocument();
|
||||
|
||||
//hack to get around this for now.
|
||||
nsCOMPtr<nsIPresShell> shell = do_QueryReferent(mSelConWeak);
|
||||
if (shell)
|
||||
BeginningOfDocument();
|
||||
|
||||
NS_POSTCONDITION(mDocWeak && mPresShellWeak, "bad state");
|
||||
|
||||
|
|
|
@ -74,6 +74,7 @@
|
|||
#include "nsIDocumentEncoder.h"
|
||||
#include "nsIDOMDocumentFragment.h"
|
||||
#include "nsIPresShell.h"
|
||||
#include "nsIPresContext.h"
|
||||
#include "nsIImage.h"
|
||||
#include "nsAOLCiter.h"
|
||||
#include "nsInternetCiter.h"
|
||||
|
@ -398,6 +399,13 @@ NS_IMETHODIMP nsHTMLEditor::Init(nsIDOMDocument *aDoc,
|
|||
result = nsEditor::Init(aDoc, aPresShell, aRoot, aSelCon, aFlags);
|
||||
if (NS_FAILED(result)) { return result; }
|
||||
|
||||
// disable links
|
||||
nsCOMPtr<nsIPresContext> context;
|
||||
aPresShell->GetPresContext(getter_AddRefs(context));
|
||||
if (!context) return NS_ERROR_NULL_POINTER;
|
||||
if (!(mFlags & eEditorPlaintextMask))
|
||||
context->SetLinkHandler(0);
|
||||
|
||||
nsCOMPtr<nsIDOMElement> bodyElement;
|
||||
result = nsEditor::GetRootElement(getter_AddRefs(bodyElement));
|
||||
if (NS_FAILED(result)) { return result; }
|
||||
|
|
Загрузка…
Ссылка в новой задаче