зеркало из https://github.com/mozilla/pjs.git
Bug 412197 Move nsIAbDirectory::listNickName and nsIAbDirectory::description from wstring to AString. r/sr=bienvenu
This commit is contained in:
Родитель
81ff3a9827
Коммит
c37dbadf51
|
@ -59,7 +59,7 @@ interface nsISupportsArray;
|
|||
#define kABFileName_CurrentSuffix ".mab" /* v3 address book extension */
|
||||
%}
|
||||
|
||||
[scriptable, uuid(2c0af941-5b77-4f26-923b-f3c5de286046)]
|
||||
[scriptable, uuid(55acf262-81e3-4ffe-bfd1-8b328adb49b4)]
|
||||
interface nsIAbDirectory : nsISupports {
|
||||
|
||||
/**
|
||||
|
@ -201,9 +201,17 @@ interface nsIAbDirectory : nsISupports {
|
|||
*/
|
||||
void addMailList(in nsIAbDirectory list);
|
||||
|
||||
// Specific to a directory which is a mail list
|
||||
attribute wstring listNickName;
|
||||
attribute wstring description;
|
||||
/**
|
||||
* Nick Name of the mailing list. This attribute is only really used when
|
||||
* the nsIAbDirectory represents a mailing list.
|
||||
*/
|
||||
attribute AString listNickName;
|
||||
|
||||
/**
|
||||
* Description of the mailing list. This attribute is only really used when
|
||||
* the nsIAbDirectory represents a mailing list.
|
||||
*/
|
||||
attribute AString description;
|
||||
|
||||
/**
|
||||
* Edits an existing mailing list (specified as listCard) into its parent
|
||||
|
|
|
@ -69,9 +69,6 @@ public:
|
|||
|
||||
protected:
|
||||
|
||||
nsresult GetAttributeName(const nsAString &aName, nsString& value);
|
||||
nsresult SetAttributeName(const nsAString &aName, nsString& attribute);
|
||||
|
||||
nsString m_PhoneticFirstName;
|
||||
nsString m_PhoneticLastName;
|
||||
nsString m_FirstName;
|
||||
|
|
|
@ -184,39 +184,29 @@ NS_IMETHODIMP nsAbDirProperty::SetLastModifiedDate(PRUint32 aLastModifiedDate)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult nsAbDirProperty::GetAttributeName(PRUnichar **aName, nsString& value)
|
||||
NS_IMETHODIMP nsAbDirProperty::GetListNickName(nsAString &aListNickName)
|
||||
{
|
||||
if (aName)
|
||||
{
|
||||
*aName = ToNewUnicode(value);
|
||||
if (!(*aName))
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
else
|
||||
return NS_OK;
|
||||
}
|
||||
else
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
|
||||
aListNickName = m_ListNickName;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult nsAbDirProperty::SetAttributeName(const PRUnichar *aName, nsString& arrtibute)
|
||||
NS_IMETHODIMP nsAbDirProperty::SetListNickName(const nsAString &aListNickName)
|
||||
{
|
||||
if (aName)
|
||||
arrtibute = aName;
|
||||
return NS_OK;
|
||||
m_ListNickName = aListNickName;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsAbDirProperty::GetListNickName(PRUnichar * *aListNickName)
|
||||
{ return GetAttributeName(aListNickName, m_ListNickName); }
|
||||
NS_IMETHODIMP nsAbDirProperty::GetDescription(nsAString &aDescription)
|
||||
{
|
||||
aDescription = m_Description;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsAbDirProperty::SetListNickName(const PRUnichar * aListNickName)
|
||||
{ return SetAttributeName(aListNickName, m_ListNickName); }
|
||||
|
||||
NS_IMETHODIMP nsAbDirProperty::GetDescription(PRUnichar * *aDescription)
|
||||
{ return GetAttributeName(aDescription, m_Description); }
|
||||
|
||||
NS_IMETHODIMP nsAbDirProperty::SetDescription(const PRUnichar * aDescription)
|
||||
{ return SetAttributeName(aDescription, m_Description); }
|
||||
NS_IMETHODIMP nsAbDirProperty::SetDescription(const nsAString &aDescription)
|
||||
{
|
||||
m_Description = aDescription;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsAbDirProperty::GetIsMailList(PRBool *aIsMailList)
|
||||
{
|
||||
|
@ -255,10 +245,10 @@ NS_IMETHODIMP nsAbDirProperty::CopyMailList(nsIAbDirectory* srcList)
|
|||
nsString str;
|
||||
srcList->GetDirName(str);
|
||||
SetDirName(str);
|
||||
srcList->GetListNickName(getter_Copies(str));
|
||||
SetListNickName(str.get());
|
||||
srcList->GetDescription(getter_Copies(str));
|
||||
SetDescription(str.get());
|
||||
srcList->GetListNickName(str);
|
||||
SetListNickName(str);
|
||||
srcList->GetDescription(str);
|
||||
SetDescription(str);
|
||||
|
||||
nsCOMPtr <nsISupportsArray> pAddressLists;
|
||||
srcList->GetAddressLists(getter_AddRefs(pAddressLists));
|
||||
|
|
|
@ -74,9 +74,6 @@ protected:
|
|||
*/
|
||||
nsresult InitDirectoryPrefs();
|
||||
|
||||
nsresult GetAttributeName(PRUnichar **aName, nsString& value);
|
||||
nsresult SetAttributeName(const PRUnichar *aName, nsString& arrtibute);
|
||||
|
||||
PRUint32 m_LastModifiedDate;
|
||||
|
||||
nsString m_ListDirName;
|
||||
|
|
|
@ -1614,10 +1614,10 @@ nsresult nsAddrDatabase::AddListAttributeColumnsToRow(nsIAbDirectory *list, nsIM
|
|||
if (!unicodeStr.IsEmpty())
|
||||
AddUnicodeToColumn(listRow, m_ListNameColumnToken, m_LowerListNameColumnToken, unicodeStr.get());
|
||||
|
||||
list->GetListNickName(getter_Copies(unicodeStr));
|
||||
list->GetListNickName(unicodeStr);
|
||||
AddListNickName(listRow, NS_ConvertUTF16toUTF8(unicodeStr).get());
|
||||
|
||||
list->GetDescription(getter_Copies(unicodeStr));
|
||||
list->GetDescription(unicodeStr);
|
||||
AddListDescription(listRow, NS_ConvertUTF16toUTF8(unicodeStr).get());
|
||||
|
||||
// XXX todo, this code has problems if you manually enter duplicate emails.
|
||||
|
@ -2899,12 +2899,12 @@ nsresult nsAddrDatabase::GetListFromDB(nsIAbDirectory *newList, nsIMdbRow* listR
|
|||
err = GetStringColumn(listRow, m_ListNickNameColumnToken, tempString);
|
||||
if (NS_SUCCEEDED(err) && !tempString.IsEmpty())
|
||||
{
|
||||
newList->SetListNickName(tempString.get());
|
||||
newList->SetListNickName(tempString);
|
||||
}
|
||||
err = GetStringColumn(listRow, m_ListDescriptionColumnToken, tempString);
|
||||
if (NS_SUCCEEDED(err) && !tempString.IsEmpty())
|
||||
{
|
||||
newList->SetDescription(tempString.get());
|
||||
newList->SetDescription(tempString);
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIAbMDBDirectory> dbnewList(do_QueryInterface(newList, &err));
|
||||
|
|
|
@ -4323,7 +4323,7 @@ nsresult nsMsgCompose::BuildMailListArray(nsIAbDirectory* parentDir,
|
|||
nsString listDescription;
|
||||
|
||||
directory->GetDirName(listName);
|
||||
directory->GetDescription(getter_Copies(listDescription));
|
||||
directory->GetDescription(listDescription);
|
||||
|
||||
nsMsgMailList* mailList = new nsMsgMailList(listName,
|
||||
listDescription, directory);
|
||||
|
|
|
@ -210,7 +210,7 @@ STDMETHODIMP CPalmSyncImp::nsGetABList(BOOL aIsUnicode, short * aABListCount,
|
|||
PRUint32 palmSyncTimeStamp;
|
||||
PRInt32 dirType, palmCategoryIndex;
|
||||
|
||||
rv = directory->GetDescription(getter_Copies(description));
|
||||
rv = directory->GetDescription(description);
|
||||
if(NS_FAILED(rv)) return E_FAIL;
|
||||
rv = directory->GetFileName(fileName);
|
||||
if(NS_FAILED(rv)) return E_FAIL;
|
||||
|
|
|
@ -203,7 +203,7 @@ nsresult nsAbPalmHotSync::GetABInterface()
|
|||
{
|
||||
// TODO: may need to skip mailing list?? but maybe not since there's no mailing list on the top level.
|
||||
|
||||
rv = directory->GetDescription(getter_Copies(description));
|
||||
rv = directory->GetDescription(description);
|
||||
if(NS_FAILED(rv)) return E_FAIL;
|
||||
rv = directory->GetFileName(fileName);
|
||||
if(NS_FAILED(rv)) return E_FAIL;
|
||||
|
|
Загрузка…
Ссылка в новой задаче