return( rv);
return rv;
NS_IMETHODIMP ImportAddressImpl::ImportAddressBook(	nsIImportABDescriptor *pSource, 													nsIAddrDatabase *	pDestination, 													nsIImportFieldMap *	fieldMap, 													PRBool isAddrLocHome, 													PRUnichar **		pErrorLog,													PRUnichar **		pSuccessLog,													PRBool *			fatalError){    NS_PRECONDITION(pSource != nsnull, "null ptr");    NS_PRECONDITION(pDestination != nsnull, "null ptr");    NS_PRECONDITION(fatalError != nsnull, "null ptr");		nsCOMPtr<nsIStringBundle>	bundle( dont_AddRef( nsTextStringBundle::GetStringBundleProxy()));	m_bytesImported = 0;	nsString	success;	nsString	error;    if (!pSource || !pDestination || !fatalError) {		IMPORT_LOG0( "*** Bad param passed to text address import\n");		nsTextStringBundle::GetStringByID( TEXTIMPORT_ADDRESS_BADPARAM, error, bundle);		if (fatalError)			*fatalError = PR_TRUE;		SetLogs( success, error, pErrorLog, pSuccessLog);	    return( NS_ERROR_NULL_POINTER);	}   	ClearSampleFile();    PRBool		addrAbort = PR_FALSE;    nsString	name;    PRUnichar *	pName;    if (NS_SUCCEEDED( pSource->GetPreferredName( &pName))) {    	name = pName;    	nsCRT::free( pName);    }    	PRUint32 addressSize = 0;	pSource->GetSize( &addressSize);	if (addressSize == 0) {		IMPORT_LOG0( "Address book size is 0, skipping import.\n");		ReportSuccess( name, &success);		SetLogs( success, error, pErrorLog, pSuccessLog);		return( NS_OK);	}    	nsIFileSpec	*	inFile;    if (NS_FAILED( pSource->GetFileSpec( &inFile))) {		ReportError( TEXTIMPORT_ADDRESS_BADSOURCEFILE, name, &error);		SetLogs( success, error, pErrorLog, pSuccessLog);		    	return( NS_ERROR_FAILURE);    }#ifdef IMPORT_DEBUG	char *pPath;	inFile->GetNativePath( &pPath);    	IMPORT_LOG1( "Import address book: %s\n", pPath);	nsCRT::free( pPath);#endif	    nsresult rv = NS_OK;	PRBool	isLDIF = PR_FALSE;	rv = nsTextAddress::IsLDIFFile( inFile, &isLDIF);	if (NS_FAILED( rv)) {		inFile->Release();		ReportError( TEXTIMPORT_ADDRESS_CONVERTERROR, name, &error);		SetLogs( success, error, pErrorLog, pSuccessLog);		return( rv);	}	    if (isLDIF) {		// This get's tricky, the database really requires the thing		// to have an .ldi extension so if it doesn't we may need to		// copy the file to a temp file with the correct name, then		// import it!		rv = m_text.ImportLDIF( &addrAbort, name.get(), inFile, pDestination, error);	}	else {			rv = m_text.ImportAddresses( &addrAbort, name.get(), inFile, pDestination, fieldMap, error, &m_bytesImported);		SaveFieldMap( fieldMap);	}    inFile->Release();	        	if (NS_SUCCEEDED( rv) && error.IsEmpty()) {		ReportSuccess( name, &success);	}	else {		ReportError( TEXTIMPORT_ADDRESS_CONVERTERROR, name, &error);	}	SetLogs( success, error, pErrorLog, pSuccessLog);	IMPORT_LOG0( "*** Text address import done\n");    return( rv);}