Cause the caret to become visible in the presentation shell when instantiating an editor.

git-svn-id: svn://10.0.0.236/trunk@20658 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
sfraser%netscape.com 1999-02-13 04:48:09 +00:00
parent 17e456ea85
commit 971ead2abc
2 changed files with 18 additions and 0 deletions

View File

@ -39,6 +39,7 @@
#include "nsIEnumerator.h"
#include "nsIAtom.h"
#include "nsVoidArray.h"
#include "nsICaret.h"
#include "nsIContent.h" // for temp method GetColIndexForCell, to be removed
#include "nsITableCellLayout.h" // for temp method GetColIndexForCell, to be removed
@ -249,6 +250,14 @@ nsEditor::Init(nsIDOMDocument *aDoc, nsIPresShell* aPresShell)
mPresShell->GetViewManager(&mViewManager);
mUpdateCount=0;
/* Show the caret */
nsCOMPtr<nsICaret> caret;
if (NS_SUCCEEDED(mPresShell->GetCaret(getter_AddRefs(caret))))
{
caret->SetCaretVisible(PR_TRUE);
caret->SetCaretReadOnly(PR_FALSE);
}
NS_POSTCONDITION(mDoc && mPresShell, "bad state");
return NS_OK;

View File

@ -39,6 +39,7 @@
#include "nsIEnumerator.h"
#include "nsIAtom.h"
#include "nsVoidArray.h"
#include "nsICaret.h"
#include "nsIContent.h" // for temp method GetColIndexForCell, to be removed
#include "nsITableCellLayout.h" // for temp method GetColIndexForCell, to be removed
@ -249,6 +250,14 @@ nsEditor::Init(nsIDOMDocument *aDoc, nsIPresShell* aPresShell)
mPresShell->GetViewManager(&mViewManager);
mUpdateCount=0;
/* Show the caret */
nsCOMPtr<nsICaret> caret;
if (NS_SUCCEEDED(mPresShell->GetCaret(getter_AddRefs(caret))))
{
caret->SetCaretVisible(PR_TRUE);
caret->SetCaretReadOnly(PR_FALSE);
}
NS_POSTCONDITION(mDoc && mPresShell, "bad state");
return NS_OK;