- New dialog and editor shell API for Insert HTML Source

- Add wrapcolumn setting to document encoders, and use it in the editor
- Fix numbered lists in the html to text sink stream.


git-svn-id: svn://10.0.0.236/trunk@37529 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
akkana%netscape.com
1999-06-30 19:26:08 +00:00
parent 7a1b68ea24
commit 2fb45d996c
23 changed files with 440 additions and 52 deletions

View File

@@ -1382,6 +1382,36 @@ nsEditorShell::InsertText(const PRUnichar *textToInsert)
return err;
}
NS_IMETHODIMP
nsEditorShell::InsertSource(const PRUnichar *aSourceToInsert)
{
nsresult err = NS_NOINTERFACE;
nsAutoString sourceToInsert(aSourceToInsert);
switch (mEditorType)
{
case ePlainTextEditorType:
{
nsCOMPtr<nsITextEditor> textEditor = do_QueryInterface(mEditor);
if (textEditor)
err = textEditor->InsertText(sourceToInsert);
}
break;
case eHTMLTextEditorType:
{
nsCOMPtr<nsIHTMLEditor> htmlEditor = do_QueryInterface(mEditor);
if (htmlEditor)
err = htmlEditor->InsertHTML(sourceToInsert);
}
break;
default:
err = NS_NOINTERFACE;
}
return err;
}
NS_IMETHODIMP
nsEditorShell::InsertBreak()
{
@@ -1592,7 +1622,12 @@ nsEditorShell::GetWrapColumn(PRInt32* aWrapColumn)
{
nsCOMPtr<nsITextEditor> textEditor = do_QueryInterface(mEditor);
if (textEditor)
err = textEditor->GetBodyWrapWidth(aWrapColumn);
{
PRUint32 wc;
err = textEditor->GetBodyWrapWidth(&wc);
if (NS_SUCCEEDED(err))
*aWrapColumn = (PRInt32)wc;
}
}
break;
default: