nsCOMPtr<nsIPref> prefs(do_GetService(kPrefServiceCID, &rv));
nsCOMPtr<nsIPref> prefs(do_GetService(NS_PREF_CONTRACTID, &rv));
NS_IMETHODIMP ImportAddressImpl::InitFieldMap(nsIFileSpec *location, nsIImportFieldMap *fieldMap){	// Let's remember the last one the user used!	// This should be normal for someone importing multiple times, it's usually	// from the same file format.		nsresult rv;	nsCOMPtr<nsIPref> prefs(do_GetService(kPrefServiceCID, &rv));	if (NS_SUCCEEDED( rv)) {		nsXPIDLCString	prefStr;		rv = prefs->CopyCharPref( "mailnews.import.text.fieldmap", getter_Copies(prefStr));		if (NS_SUCCEEDED( rv)) {			const char *pStr = (const char *)prefStr;			if (pStr) {				fieldMap->SetFieldMapSize( 0);				long		fNum;				PRBool		active;				long		fIndex = 0;				while (*pStr) {					while (*pStr && (*pStr != '+') && (*pStr != '-'))						pStr++;					if (*pStr == '+')						active = PR_TRUE;					else if (*pStr == '-')						active = PR_FALSE;					else						break;					fNum = 0;					while (*pStr && ((*pStr < '0') || (*pStr > '9')))						pStr++;					if (!(*pStr))						break;					while (*pStr && (*pStr >= '0') && (*pStr <= '9')) {						fNum *= 10;						fNum += (*pStr - '0');						pStr++;					}					while (*pStr && (*pStr != ','))						pStr++;					if (*pStr == ',')						pStr++;					fieldMap->SetFieldMap( -1, fNum);					fieldMap->SetFieldActive( fIndex, active);					fIndex++;				}				if (!fIndex) {					int num;					fieldMap->GetNumMozFields( &num);					fieldMap->DefaultFieldMap( num);				}			}		}	}	return( NS_OK);}