Bug 1504981 - Port bug 1504566: replace XPCOM use of nsHTMLCopyEncoder. rs=bustage-fix
authorJorg K <jorgk@jorgk.com>
Tue, 06 Nov 2018 12:17:45 +0100
changeset 33664 c50ee3de6f300b2479a6f9d415ffedb749646de1
parent 33663 0a2c3922830231ab2119d601bafe527983999d5c
child 33665 066cb8e1041ff8bf16dc231b95d06e75ad761008
push id388
push userclokep@gmail.com
push dateMon, 28 Jan 2019 20:54:56 +0000
reviewersbustage-fix
bugs1504981, 1504566
Bug 1504981 - Port bug 1504566: replace XPCOM use of nsHTMLCopyEncoder. rs=bustage-fix
mailnews/compose/src/nsMsgComposeService.cpp
--- a/mailnews/compose/src/nsMsgComposeService.cpp
+++ b/mailnews/compose/src/nsMsgComposeService.cpp
@@ -322,18 +322,17 @@ nsMsgComposeService::GetOrigWindowSelect
   }
 
   nsCOMPtr<nsIContentViewer> contentViewer;
   rv = docShell->GetContentViewer(getter_AddRefs(contentViewer));
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsCOMPtr<nsIDocument> domDocument(contentViewer->GetDocument());
 
-  nsCOMPtr<nsIDocumentEncoder> docEncoder(do_CreateInstance(NS_HTMLCOPY_ENCODER_CONTRACTID, &rv));
-  NS_ENSURE_SUCCESS(rv, rv);
+  nsCOMPtr<nsIDocumentEncoder> docEncoder = do_createHTMLCopyEncoder();
 
   rv = docEncoder->Init(domDocument, NS_LITERAL_STRING("text/html"), 0);
   NS_ENSURE_SUCCESS(rv, rv);
 
   rv = docEncoder->SetSelection(sel);
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsAutoString selHTML;