Bug 657160 - Remove NS_NewCaret; r=ehsan,roc

This commit is contained in:
Ms2ger 2011-05-15 12:17:09 +02:00
Родитель 87c61fd2e9
Коммит ac07777124
4 изменённых файлов: 10 добавлений и 35 удалений

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

@ -552,14 +552,10 @@ nsEditorEventListener::DragEnter(nsIDOMDragEvent* aDragEvent)
nsCOMPtr<nsIPresShell> presShell = GetPresShell(); nsCOMPtr<nsIPresShell> presShell = GetPresShell();
NS_ENSURE_TRUE(presShell, NS_OK); NS_ENSURE_TRUE(presShell, NS_OK);
if (!mCaret) if (!mCaret) {
{ mCaret = new nsCaret();
NS_NewCaret(getter_AddRefs(mCaret)); mCaret->Init(presShell);
if (mCaret) mCaret->SetCaretReadOnly(PR_TRUE);
{
mCaret->Init(presShell);
mCaret->SetCaretReadOnly(PR_TRUE);
}
} }
presShell->SetCaret(mCaret); presShell->SetCaret(mCaret);

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

@ -1183,17 +1183,3 @@ nsCaret::SetIgnoreUserModify(PRBool aIgnoreUserModify)
} }
mIgnoreUserModify = 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 -*- /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
* vim: set ts=2 sw=2 et tw=78: /* vim: set ts=2 sw=2 et tw=78: */
* /* ***** BEGIN LICENSE BLOCK *****
* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
* *
* The contents of this file are subject to the Mozilla Public License Version * 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 // handy stack-based class for temporarily disabling the caret
class StCaretHider class StCaretHider

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

@ -1850,12 +1850,9 @@ PresShell::Init(nsIDocument* aDocument,
// Important: this has to happen after the selection has been set up // Important: this has to happen after the selection has been set up
#ifdef SHOW_CARET #ifdef SHOW_CARET
// make the caret // make the caret
nsresult err = NS_NewCaret(getter_AddRefs(mCaret)); mCaret = new nsCaret();
if (NS_SUCCEEDED(err)) mCaret->Init(this);
{ mOriginalCaret = mCaret;
mCaret->Init(this);
mOriginalCaret = mCaret;
}
//SetCaretEnabled(PR_TRUE); // make it show in browser windows //SetCaretEnabled(PR_TRUE); // make it show in browser windows
#endif #endif