зеркало из https://github.com/mozilla/pjs.git
Fix the text & HTML output routines
This commit is contained in:
Родитель
59bcf523dd
Коммит
ced59aee82
|
@ -106,6 +106,31 @@ nsresult NS_InitEditorMode(nsIDOMDocument *aDOMDocument, nsIPresShell* aPresShel
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static nsresult PrintEditorOutput(nsIHTMLEditor* editor, PRInt32 aCommandID)
|
||||||
|
{
|
||||||
|
nsString outString;
|
||||||
|
char* cString;
|
||||||
|
|
||||||
|
switch (aCommandID)
|
||||||
|
{
|
||||||
|
case VIEWER_DISPLAYTEXT:
|
||||||
|
gEditor->OutputText(outString);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case VIEWER_DISPLAYHTML:
|
||||||
|
gEditor->OutputHTML(outString);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
cString = outString.ToNewCString();
|
||||||
|
printf(cString);
|
||||||
|
delete [] cString;
|
||||||
|
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
nsresult NS_DoEditorTest(PRInt32 aCommandID)
|
nsresult NS_DoEditorTest(PRInt32 aCommandID)
|
||||||
{
|
{
|
||||||
if (gEditor)
|
if (gEditor)
|
||||||
|
@ -145,11 +170,8 @@ nsresult NS_DoEditorTest(PRInt32 aCommandID)
|
||||||
gEditor->JoinTableCells(PR_FALSE);
|
gEditor->JoinTableCells(PR_FALSE);
|
||||||
break;
|
break;
|
||||||
case VIEWER_DISPLAYTEXT:
|
case VIEWER_DISPLAYTEXT:
|
||||||
gEditor->OutputText(nsnull);
|
|
||||||
break;
|
|
||||||
case VIEWER_DISPLAYHTML:
|
case VIEWER_DISPLAYHTML:
|
||||||
|
PrintEditorOutput(gEditor, aCommandID);
|
||||||
gEditor->OutputHTML(nsnull);
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return NS_ERROR_NOT_IMPLEMENTED;
|
return NS_ERROR_NOT_IMPLEMENTED;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче