mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-31 14:15:30 +00:00
make a plaintext editor instead fo an html editor if TEXT_EDITOR is defined.
This commit is contained in:
parent
e74189c52f
commit
b79a08d2b3
@ -113,6 +113,9 @@ static NS_DEFINE_IID(kIStreamObserverIID, NS_ISTREAMOBSERVER_IID);
|
||||
static NS_DEFINE_IID(kIWebShellWindowIID, NS_IWEBSHELL_WINDOW_IID);
|
||||
static NS_DEFINE_IID(kIDocumentViewerIID, NS_IDOCUMENT_VIEWER_IID);
|
||||
|
||||
static NS_DEFINE_IID(kITextEditorIID, NS_ITEXTEDITOR_IID);
|
||||
static NS_DEFINE_CID(kTextEditorCID, NS_TEXTEDITOR_CID);
|
||||
|
||||
static NS_DEFINE_IID(kIHTMLEditorIID, NS_IHTMLEDITOR_IID);
|
||||
static NS_DEFINE_CID(kHTMLEditorCID, NS_HTMLEDITOR_CID);
|
||||
|
||||
@ -265,9 +268,15 @@ nsEditorAppCore::DoEditorMode(nsIWebShell *aWebShell)
|
||||
nsIPresShell* presShell = GetPresShellFor(aWebShell);
|
||||
if( presShell )
|
||||
{
|
||||
#ifdef TEXT_EDITOR
|
||||
nsITextEditor *editor = nsnull;
|
||||
nsresult result = nsComponentManager::CreateInstance(kTextEditorCID, nsnull,
|
||||
kITextEditorIID, (void **)&editor);
|
||||
#else
|
||||
nsIHTMLEditor *editor = nsnull;
|
||||
nsresult result = nsComponentManager::CreateInstance(kHTMLEditorCID, nsnull,
|
||||
kIHTMLEditorIID, (void **)&editor);
|
||||
#endif // TEXT_EDITOR
|
||||
if(!editor)
|
||||
result = NS_ERROR_OUT_OF_MEMORY;
|
||||
if (NS_SUCCEEDED(result))
|
||||
|
@ -37,6 +37,9 @@ class nsIURL;
|
||||
class nsIWebShellWindow;
|
||||
class nsIPresShell;
|
||||
class nsIHTMLEditor;
|
||||
class nsITextEditor;
|
||||
|
||||
//#define TEXT_EDITOR 1
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// nsEditorAppCore:
|
||||
@ -107,7 +110,11 @@ class nsEditorAppCore : public nsBaseAppCore,
|
||||
nsIWebShellWindow *mWebShellWin;
|
||||
nsIWebShell * mWebShell;
|
||||
|
||||
#ifdef TEXT_EDITOR
|
||||
nsITextEditor * mEditor;
|
||||
#else
|
||||
nsIHTMLEditor * mEditor;
|
||||
#endif // TEXT_EDITOR
|
||||
nsIDOMDocument* mDomDoc;
|
||||
nsIDOMNode* mCurrentNode;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user