From e57fd5b0a34169a33af9f306f87775649b18bb7c Mon Sep 17 00:00:00 2001 From: "chuang%netscape.com" Date: Tue, 18 Jul 2000 22:31:10 +0000 Subject: [PATCH] Fix absync bug 1425 - add record key for migrated address book. r=rhp --- mailnews/addrbook/src/nsAddrDatabase.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/mailnews/addrbook/src/nsAddrDatabase.cpp b/mailnews/addrbook/src/nsAddrDatabase.cpp index 261d5eaf53d0..2849420e66df 100644 --- a/mailnews/addrbook/src/nsAddrDatabase.cpp +++ b/mailnews/addrbook/src/nsAddrDatabase.cpp @@ -954,6 +954,8 @@ nsresult nsAddrDatabase::UpdateLastRecordKey() pDataRow->CutStrongRef(GetEnv()); return NS_OK; } + else if (!pDataRow) + err = InitLastRecorKey(); else return NS_ERROR_NOT_AVAILABLE; return err; @@ -2566,7 +2568,13 @@ NS_IMETHODIMP nsAddrDatabase::GetNewListRow(nsIMdbRow * *newRow) NS_IMETHODIMP nsAddrDatabase::AddCardRowToDB(nsIMdbRow *newRow) { if (m_mdbPabTable) - return m_mdbPabTable->AddRow(GetEnv(), newRow); + { + nsresult err = NS_OK; + err = m_mdbPabTable->AddRow(GetEnv(), newRow); + if (NS_SUCCEEDED(err)) + AddRecordKeyColumnToRow(newRow); + return err; + } else return NS_ERROR_FAILURE; }