зеркало из https://github.com/mozilla/pjs.git
Bug 657160 - Remove NS_NewCaret; r=ehsan,roc
This commit is contained in:
Родитель
87c61fd2e9
Коммит
ac07777124
|
@ -552,14 +552,10 @@ nsEditorEventListener::DragEnter(nsIDOMDragEvent* aDragEvent)
|
|||
nsCOMPtr<nsIPresShell> presShell = GetPresShell();
|
||||
NS_ENSURE_TRUE(presShell, NS_OK);
|
||||
|
||||
if (!mCaret)
|
||||
{
|
||||
NS_NewCaret(getter_AddRefs(mCaret));
|
||||
if (mCaret)
|
||||
{
|
||||
mCaret->Init(presShell);
|
||||
mCaret->SetCaretReadOnly(PR_TRUE);
|
||||
}
|
||||
if (!mCaret) {
|
||||
mCaret = new nsCaret();
|
||||
mCaret->Init(presShell);
|
||||
mCaret->SetCaretReadOnly(PR_TRUE);
|
||||
}
|
||||
|
||||
presShell->SetCaret(mCaret);
|
||||
|
|
|
@ -1183,17 +1183,3 @@ nsCaret::SetIgnoreUserModify(PRBool aIgnoreUserModify)
|
|||
}
|
||||
mIgnoreUserModify = aIgnoreUserModify;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
nsresult NS_NewCaret(nsCaret** aInstancePtrResult)
|
||||
{
|
||||
NS_PRECONDITION(aInstancePtrResult, "null ptr");
|
||||
|
||||
nsCaret* caret = new nsCaret();
|
||||
if (nsnull == caret)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
NS_ADDREF(caret);
|
||||
*aInstancePtrResult = caret;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
* vim: set ts=2 sw=2 et tw=78:
|
||||
*
|
||||
* ***** BEGIN LICENSE BLOCK *****
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set ts=2 sw=2 et tw=78: */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
|
@ -298,9 +297,6 @@ protected:
|
|||
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewCaret(nsCaret** aInstancePtrResult);
|
||||
|
||||
// handy stack-based class for temporarily disabling the caret
|
||||
|
||||
class StCaretHider
|
||||
|
|
|
@ -1850,12 +1850,9 @@ PresShell::Init(nsIDocument* aDocument,
|
|||
// Important: this has to happen after the selection has been set up
|
||||
#ifdef SHOW_CARET
|
||||
// make the caret
|
||||
nsresult err = NS_NewCaret(getter_AddRefs(mCaret));
|
||||
if (NS_SUCCEEDED(err))
|
||||
{
|
||||
mCaret->Init(this);
|
||||
mOriginalCaret = mCaret;
|
||||
}
|
||||
mCaret = new nsCaret();
|
||||
mCaret->Init(this);
|
||||
mOriginalCaret = mCaret;
|
||||
|
||||
//SetCaretEnabled(PR_TRUE); // make it show in browser windows
|
||||
#endif
|
||||
|
|
Загрузка…
Ссылка в новой задаче