call Init on the document encoder

git-svn-id: svn://10.0.0.236/trunk@34130 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
akkana%netscape.com
1999-06-08 00:02:25 +00:00
parent ee09a04094
commit 89a8428f49
2 changed files with 24 additions and 0 deletions

View File

@@ -24,6 +24,7 @@
#include "nsIDOMNodeList.h"
#include "nsIDOMNSRange.h"
#include "nsIDOMDocument.h"
#include "nsIDocument.h"
#include "nsIDOMEventReceiver.h"
#include "nsIDOMKeyListener.h"
#include "nsIDOMMouseListener.h"
@@ -533,6 +534,17 @@ NS_IMETHODIMP nsHTMLEditor::OutputHTMLToString(nsString& aOutputString)
if (NS_FAILED(rv))
return rv;
nsCOMPtr<nsIDOMDocument> domdoc;
rv = GetDocument(getter_AddRefs(domdoc));
if (NS_FAILED(rv))
return rv;
nsCOMPtr<nsIDocument> doc = do_QueryInterface(domdoc);
nsString mimetype ("text/html");
rv = encoder->Init(doc, mimetype);
if (NS_FAILED(rv))
return rv;
return encoder->EncodeToString(aOutputString);
#else
return nsTextEditor::OutputHTMLToString(aOutputString);