if (autoCopyService) {
if (autoCopy) {
nsSelection::nsSelection(){  PRInt32 i;  for (i = 0;i<nsISelectionController::NUM_SELECTIONTYPES;i++){    mDomSelections[i] = nsnull;  }  for (i = 0;i<nsISelectionController::NUM_SELECTIONTYPES;i++){    mDomSelections[i] = new nsTypedSelection(this);    if (!mDomSelections[i])      return;    mDomSelections[i]->AddRef();    mDomSelections[i]->SetType(GetSelectionTypeFromIndex(i));  }  mBatching = 0;  mChangesDuringBatching = PR_FALSE;  mNotifyFrames = PR_TRUE;  mLimiter = nsnull; //no default limiter.    mMouseDoubleDownState = PR_FALSE;    mHint = HINTLEFT;  mDragSelectingCells = PR_FALSE;  mSelectingTableCellMode = 0;  mSelectedCellIndex = 0;  // Check to see if the autocopy pref is enabled  //   and add the autocopy listener if it is  if (nsContentUtils::GetBoolPref("clipboard.autocopy")) {    nsCOMPtr<nsIAutoCopyService> autoCopyService =       do_GetService("@mozilla.org/autocopy;1");    if (autoCopyService) {      PRInt8 index =        GetIndexFromSelectionType(nsISelectionController::SELECTION_NORMAL);      if (mDomSelections[index]) {        autoCopyService->Listen(mDomSelections[index]);      }    }  }  mDisplaySelection = nsISelectionController::SELECTION_OFF;  mDelayCaretOverExistingSelection = PR_TRUE;  mDelayedMouseEventValid = PR_FALSE;  mSelectionChangeReason = nsISelectionListener::NO_REASON;}