no point in turning off the link handler if we are allready in text only mode.

This commit is contained in:
mjudge%netscape.com 2000-05-15 05:18:45 +00:00
Родитель 13667e1d72
Коммит c2c1b3d08f
4 изменённых файлов: 28 добавлений и 12 удалений

Просмотреть файл

@ -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; }