зеркало из https://github.com/mozilla/pjs.git
Bug 258642 Unused functions [PRUni]charPtrArrayTo[C]StringArray & [C]StringArrayTo[PRUni]charPtrArray
patch by mikael@parknert.se r=neil sr=bienvenu
This commit is contained in:
Родитель
93c8848740
Коммит
7aa9391f40
|
@ -92,7 +92,6 @@ CPPSRCS = \
|
||||||
nsAddbookUrl.cpp \
|
nsAddbookUrl.cpp \
|
||||||
nsAbDirFactoryService.cpp \
|
nsAbDirFactoryService.cpp \
|
||||||
nsAbMDBDirFactory.cpp \
|
nsAbMDBDirFactory.cpp \
|
||||||
nsAbUtils.cpp \
|
|
||||||
nsAbDirectoryQuery.cpp \
|
nsAbDirectoryQuery.cpp \
|
||||||
nsAbDirectoryQueryProxy.cpp \
|
nsAbDirectoryQueryProxy.cpp \
|
||||||
nsAbDirSearchListener.cpp \
|
nsAbDirSearchListener.cpp \
|
||||||
|
|
|
@ -40,7 +40,6 @@
|
||||||
|
|
||||||
#include "nsIPrefService.h"
|
#include "nsIPrefService.h"
|
||||||
#include "nsAbBSDirectory.h"
|
#include "nsAbBSDirectory.h"
|
||||||
#include "nsAbUtils.h"
|
|
||||||
|
|
||||||
#include "nsRDFCID.h"
|
#include "nsRDFCID.h"
|
||||||
#include "nsIRDFService.h"
|
#include "nsIRDFService.h"
|
||||||
|
|
|
@ -176,12 +176,14 @@ NS_IMETHODIMP nsAbDirectoryQueryArguments::SetQuerySubDirectories(PRBool aQueryS
|
||||||
NS_IMETHODIMP nsAbDirectoryQueryArguments::SetReturnProperties(PRUint32 returnPropertiesSize,
|
NS_IMETHODIMP nsAbDirectoryQueryArguments::SetReturnProperties(PRUint32 returnPropertiesSize,
|
||||||
const char** returnPropertiesArray)
|
const char** returnPropertiesArray)
|
||||||
{
|
{
|
||||||
nsresult rv;
|
NS_ENSURE_ARG_POINTER(returnPropertiesArray);
|
||||||
rv = CharPtrArrayToCStringArray::Convert(mReturnProperties,
|
|
||||||
returnPropertiesSize,
|
|
||||||
returnPropertiesArray);
|
|
||||||
|
|
||||||
return rv;
|
mReturnProperties.Clear();
|
||||||
|
|
||||||
|
for (PRUint32 i = 0; i < returnPropertiesSize; i++)
|
||||||
|
mReturnProperties.AppendCString(nsDependentCString(returnPropertiesArray[i]));
|
||||||
|
|
||||||
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* void getReturnProperties (out unsigned long returnPropertiesSize,
|
/* void getReturnProperties (out unsigned long returnPropertiesSize,
|
||||||
|
@ -189,11 +191,19 @@ NS_IMETHODIMP nsAbDirectoryQueryArguments::SetReturnProperties(PRUint32 returnPr
|
||||||
NS_IMETHODIMP nsAbDirectoryQueryArguments::GetReturnProperties(PRUint32* returnPropertiesSize,
|
NS_IMETHODIMP nsAbDirectoryQueryArguments::GetReturnProperties(PRUint32* returnPropertiesSize,
|
||||||
char*** returnPropertiesArray)
|
char*** returnPropertiesArray)
|
||||||
{
|
{
|
||||||
nsresult rv;
|
NS_ENSURE_ARG_POINTER(returnPropertiesSize);
|
||||||
rv = CStringArrayToCharPtrArray::Convert (mReturnProperties,
|
NS_ENSURE_ARG_POINTER(returnPropertiesArray);
|
||||||
returnPropertiesSize, returnPropertiesArray);
|
|
||||||
|
|
||||||
return rv;
|
PRUint32 size = mReturnProperties.Count();
|
||||||
|
*returnPropertiesSize = size;
|
||||||
|
*returnPropertiesArray = NS_STATIC_CAST(char**, nsMemory::Alloc (sizeof (char* ) * size));
|
||||||
|
if (!(*returnPropertiesArray))
|
||||||
|
return NS_ERROR_OUT_OF_MEMORY;
|
||||||
|
|
||||||
|
for (PRUint32 i = 0; i < size; i++)
|
||||||
|
(*returnPropertiesArray)[i] = ToNewCString(*mReturnProperties[i]);
|
||||||
|
|
||||||
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMPL_THREADSAFE_ISUPPORTS1(nsAbDirectoryQueryPropertyValue, nsIAbDirectoryQueryPropertyValue)
|
NS_IMPL_THREADSAFE_ISUPPORTS1(nsAbDirectoryQueryPropertyValue, nsIAbDirectoryQueryPropertyValue)
|
||||||
|
|
|
@ -40,7 +40,6 @@
|
||||||
|
|
||||||
#include "nsAbLDAPDirectory.h"
|
#include "nsAbLDAPDirectory.h"
|
||||||
#include "nsAbLDAPProperties.h"
|
#include "nsAbLDAPProperties.h"
|
||||||
#include "nsAbUtils.h"
|
|
||||||
|
|
||||||
#include "nsAbQueryStringToExpression.h"
|
#include "nsAbQueryStringToExpression.h"
|
||||||
|
|
||||||
|
@ -362,13 +361,8 @@ NS_IMETHODIMP nsAbLDAPDirectory::StartSearch ()
|
||||||
|
|
||||||
// Set the return properties to
|
// Set the return properties to
|
||||||
// return nsIAbCard interfaces
|
// return nsIAbCard interfaces
|
||||||
nsCStringArray properties;
|
const char *arr = "card:nsIAbCard";
|
||||||
properties.AppendCString (nsCAutoString ("card:nsIAbCard"));
|
rv = arguments->SetReturnProperties (1, &arr);
|
||||||
CharPtrArrayGuard returnProperties (PR_FALSE);
|
|
||||||
rv = CStringArrayToCharPtrArray::Convert (properties,returnProperties.GetSizeAddr(),
|
|
||||||
returnProperties.GetArrayAddr(), PR_FALSE);
|
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
|
||||||
rv = arguments->SetReturnProperties (returnProperties.GetSize(), returnProperties.GetArray());
|
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
rv = arguments->SetQuerySubDirectories (PR_TRUE);
|
rv = arguments->SetQuerySubDirectories (PR_TRUE);
|
||||||
|
|
|
@ -54,7 +54,6 @@
|
||||||
#include "nsAbDirectoryQuery.h"
|
#include "nsAbDirectoryQuery.h"
|
||||||
#include "nsIAbDirectoryQueryProxy.h"
|
#include "nsIAbDirectoryQueryProxy.h"
|
||||||
#include "nsAbQueryStringToExpression.h"
|
#include "nsAbQueryStringToExpression.h"
|
||||||
#include "nsAbUtils.h"
|
|
||||||
#include "nsArrayEnumerator.h"
|
#include "nsArrayEnumerator.h"
|
||||||
#include "nsAbMDBCardProperty.h"
|
#include "nsAbMDBCardProperty.h"
|
||||||
|
|
||||||
|
@ -909,13 +908,8 @@ NS_IMETHODIMP nsAbMDBDirectory::StartSearch()
|
||||||
|
|
||||||
// Set the return properties to
|
// Set the return properties to
|
||||||
// return nsIAbCard interfaces
|
// return nsIAbCard interfaces
|
||||||
nsCStringArray properties;
|
const char *arr = "card:nsIAbCard";
|
||||||
properties.AppendCString(nsCAutoString("card:nsIAbCard"));
|
rv = arguments->SetReturnProperties(1, &arr);
|
||||||
CharPtrArrayGuard returnProperties(PR_FALSE);
|
|
||||||
rv = CStringArrayToCharPtrArray::Convert(properties,returnProperties.GetSizeAddr(),
|
|
||||||
returnProperties.GetArrayAddr(), PR_FALSE);
|
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
|
||||||
rv = arguments->SetReturnProperties(returnProperties.GetSize(), returnProperties.GetArray());
|
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
// don't search the subdirectories
|
// don't search the subdirectories
|
||||||
|
|
|
@ -995,14 +995,9 @@ NS_IMETHODIMP nsAbOutlookDirectory::StartSearch(void)
|
||||||
NS_ENSURE_SUCCESS(retCode, retCode) ;
|
NS_ENSURE_SUCCESS(retCode, retCode) ;
|
||||||
retCode = arguments->SetExpression(expression) ;
|
retCode = arguments->SetExpression(expression) ;
|
||||||
NS_ENSURE_SUCCESS(retCode, retCode) ;
|
NS_ENSURE_SUCCESS(retCode, retCode) ;
|
||||||
nsCStringArray properties ;
|
|
||||||
CharPtrArrayGuard returnProperties(PR_FALSE) ;
|
|
||||||
|
|
||||||
properties.AppendCString(nsCAutoString("card:nsIAbCard")) ;
|
const char *arr = "card:nsIAbCard";
|
||||||
retCode = CStringArrayToCharPtrArray::Convert(properties, returnProperties.GetSizeAddr(),
|
retCode = arguments->SetReturnProperties(1, &arr);
|
||||||
returnProperties.GetArrayAddr(), PR_FALSE) ;
|
|
||||||
NS_ENSURE_SUCCESS(retCode, retCode) ;
|
|
||||||
retCode = arguments->SetReturnProperties(returnProperties.GetSize(), returnProperties.GetArray()) ;
|
|
||||||
NS_ENSURE_SUCCESS(retCode, retCode) ;
|
NS_ENSURE_SUCCESS(retCode, retCode) ;
|
||||||
retCode = arguments->SetQuerySubDirectories(PR_TRUE) ;
|
retCode = arguments->SetQuerySubDirectories(PR_TRUE) ;
|
||||||
NS_ENSURE_SUCCESS(retCode, retCode) ;
|
NS_ENSURE_SUCCESS(retCode, retCode) ;
|
||||||
|
|
|
@ -41,7 +41,6 @@
|
||||||
#include "nsIAbDirectory.h"
|
#include "nsIAbDirectory.h"
|
||||||
#include "nsIAddrBookSession.h"
|
#include "nsIAddrBookSession.h"
|
||||||
#include "nsIAbCard.h"
|
#include "nsIAbCard.h"
|
||||||
#include "nsAbUtils.h"
|
|
||||||
|
|
||||||
#include "rdf.h"
|
#include "rdf.h"
|
||||||
#include "nsIRDFService.h"
|
#include "nsIRDFService.h"
|
||||||
|
|
|
@ -105,40 +105,10 @@ private:
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
nsMemory::Free(mArray);
|
nsMemory::Free(mArray);
|
||||||
mArray=nsnull;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Helper class to convert an nsCStringArray
|
|
||||||
* to an array of char*
|
|
||||||
* By default strings will be copied, unless
|
|
||||||
* the copyElements parameter is set to PR_FALSE.
|
|
||||||
*/
|
|
||||||
class CStringArrayToCharPtrArray
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
static nsresult Convert (nsCStringArray& array,
|
|
||||||
PRUint32* returnPropertiesSize,
|
|
||||||
char*** returnPropertiesArray,
|
|
||||||
PRBool copyElements = PR_TRUE);
|
|
||||||
};
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Helper class to convert an array of char*
|
|
||||||
* to an nsCStringArray
|
|
||||||
*/
|
|
||||||
class CharPtrArrayToCStringArray
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
static nsresult Convert (nsCStringArray& array,
|
|
||||||
PRUint32 returnPropertiesSize,
|
|
||||||
const char** returnPropertiesArray);
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Wrapper class to automatically free an array of
|
* Wrapper class to automatically free an array of
|
||||||
* PRUnichar* when class goes out of scope
|
* PRUnichar* when class goes out of scope
|
||||||
|
@ -199,36 +169,8 @@ private:
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
nsMemory::Free(mArray);
|
nsMemory::Free(mArray);
|
||||||
mArray=nsnull;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
|
||||||
* Helper class to convert an nsStringArray
|
|
||||||
* to an array of PRUnichar*
|
|
||||||
* By default strings will be copied, unless
|
|
||||||
* the copyElements parameter is set to PR_FALSE.
|
|
||||||
*/
|
|
||||||
class StringArrayToPRUnicharPtrArray
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
static nsresult Convert (nsStringArray& array,
|
|
||||||
PRUint32* returnPropertiesSize,
|
|
||||||
PRUnichar*** returnPropertiesArray,
|
|
||||||
PRBool copyElements = PR_TRUE);
|
|
||||||
};
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Helper class to convert an array of PRUnichar*
|
|
||||||
* to an nsStringArray
|
|
||||||
*/
|
|
||||||
class PRUnicharPtrArrayToStringArray
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
static nsresult Convert (nsStringArray& returnPropertiesArray,
|
|
||||||
PRUint32 returnPropertiesSize,
|
|
||||||
const PRUnichar** array);
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif /* nsAbUtils_h__ */
|
#endif /* nsAbUtils_h__ */
|
||||||
|
|
|
@ -44,7 +44,6 @@
|
||||||
#define USES_IID_IDistList
|
#define USES_IID_IDistList
|
||||||
|
|
||||||
#include "nsAbWinHelper.h"
|
#include "nsAbWinHelper.h"
|
||||||
#include "nsAbUtils.h"
|
|
||||||
#include "nsMapiAddressBook.h"
|
#include "nsMapiAddressBook.h"
|
||||||
#include "nsWabAddressBook.h"
|
#include "nsWabAddressBook.h"
|
||||||
#include "nsCRT.h"
|
#include "nsCRT.h"
|
||||||
|
|
|
@ -36,7 +36,6 @@
|
||||||
*
|
*
|
||||||
* ***** END LICENSE BLOCK ***** */
|
* ***** END LICENSE BLOCK ***** */
|
||||||
#include "nsMapiAddressBook.h"
|
#include "nsMapiAddressBook.h"
|
||||||
#include "nsAbUtils.h"
|
|
||||||
#include "nsAutoLock.h"
|
#include "nsAutoLock.h"
|
||||||
|
|
||||||
#include "prlog.h"
|
#include "prlog.h"
|
||||||
|
|
|
@ -36,7 +36,6 @@
|
||||||
*
|
*
|
||||||
* ***** END LICENSE BLOCK ***** */
|
* ***** END LICENSE BLOCK ***** */
|
||||||
#include "nsWabAddressBook.h"
|
#include "nsWabAddressBook.h"
|
||||||
#include "nsAbUtils.h"
|
|
||||||
#include "nsAutoLock.h"
|
#include "nsAutoLock.h"
|
||||||
#include "prlog.h"
|
#include "prlog.h"
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче