nsServiceManager::ReleaseService(kCClipboardCID, clipboard);
NS_IMETHODIMP nsHTMLEditor::Paste(PRInt32 aSelectionType){  ForceCompositionEnd();  // Get Clipboard Service  nsresult rv;  nsCOMPtr<nsIClipboard> clipboard( do_GetService( kCClipboardCID, &rv ) );  if ( NS_FAILED(rv) )    return rv;      // Get the nsITransferable interface for getting the data from the clipboard  nsCOMPtr<nsITransferable> trans;  rv = PrepareTransferable(getter_AddRefs(trans));  if (NS_SUCCEEDED(rv) && trans)  {    // Get the Data from the clipboard      if (NS_SUCCEEDED(clipboard->GetData(trans, aSelectionType)) && IsModifiable())    {      // also get additional html copy hints, if present      nsAutoString contextStr, infoStr;      nsCOMPtr<nsISupports> contextDataObj, infoDataObj;      PRUint32 contextLen, infoLen;      nsCOMPtr<nsISupportsWString> textDataObj;            nsCOMPtr<nsITransferable> contextTrans = do_CreateInstance(kCTransferableCID);      NS_ENSURE_TRUE(contextTrans, NS_ERROR_NULL_POINTER);      contextTrans->AddDataFlavor(kHTMLContext);      clipboard->GetData(contextTrans, aSelectionType);      contextTrans->GetTransferData(kHTMLContext, getter_AddRefs(contextDataObj), &contextLen);      nsCOMPtr<nsITransferable> infoTrans = do_CreateInstance(kCTransferableCID);      NS_ENSURE_TRUE(infoTrans, NS_ERROR_NULL_POINTER);      infoTrans->AddDataFlavor(kHTMLInfo);      clipboard->GetData(infoTrans, aSelectionType);      infoTrans->GetTransferData(kHTMLInfo, getter_AddRefs(infoDataObj), &infoLen);            if (contextDataObj)      {        PRUnichar* text = nsnull;        textDataObj = do_QueryInterface(contextDataObj);        textDataObj->ToString ( &text );        contextStr.Assign ( text, contextLen / 2 );        if (text)          nsMemory::Free(text);      }            if (infoDataObj)      {        PRUnichar* text = nsnull;        textDataObj = do_QueryInterface(infoDataObj);        textDataObj->ToString ( &text );        infoStr.Assign ( text, infoLen / 2 );        if (text)          nsMemory::Free(text);      }      rv = InsertFromTransferable(trans, contextStr, infoStr);    }  }  return rv;}