if you want a pointer to the characters, you're going to have to |.get()| it

This commit is contained in:
scc%mozilla.org 2000-09-13 04:50:55 +00:00
Родитель cfbee28623
Коммит 70ad30814f
9 изменённых файлов: 25 добавлений и 19 удалений

Просмотреть файл

@ -153,7 +153,8 @@ nsElementMap::Add(const nsAReadableString& aID, nsIContent* aContent)
if (! mMap) if (! mMap)
return NS_ERROR_NOT_INITIALIZED; return NS_ERROR_NOT_INITIALIZED;
const PRUnichar *id = nsPromiseFlatString(aID); nsPromiseFlatString flatID(aID);
const PRUnichar *id = flatID.get();
ContentListItem* head = ContentListItem* head =
NS_STATIC_CAST(ContentListItem*, PL_HashTableLookup(mMap, id)); NS_STATIC_CAST(ContentListItem*, PL_HashTableLookup(mMap, id));
@ -251,7 +252,8 @@ nsElementMap::Remove(const nsAReadableString& aID, nsIContent* aContent)
if (! mMap) if (! mMap)
return NS_ERROR_NOT_INITIALIZED; return NS_ERROR_NOT_INITIALIZED;
const PRUnichar *id = nsPromiseFlatString(aID); nsPromiseFlatString flatID(aID);
const PRUnichar *id = flatID.get();
#ifdef PR_LOGGING #ifdef PR_LOGGING
if (PR_LOG_TEST(gMapLog, PR_LOG_ALWAYS)) { if (PR_LOG_TEST(gMapLog, PR_LOG_ALWAYS)) {
@ -330,7 +332,7 @@ nsElementMap::Find(const nsAReadableString& aID, nsISupportsArray* aResults)
aResults->Clear(); aResults->Clear();
ContentListItem* item = ContentListItem* item =
NS_REINTERPRET_CAST(ContentListItem*, PL_HashTableLookup(mMap, (const PRUnichar *)nsPromiseFlatString(aID))); NS_REINTERPRET_CAST(ContentListItem*, PL_HashTableLookup(mMap, (const PRUnichar *)nsPromiseFlatString(aID).get()));
while (item) { while (item) {
aResults->AppendElement(item->mContent); aResults->AppendElement(item->mContent);
@ -348,7 +350,7 @@ nsElementMap::FindFirst(const nsAReadableString& aID, nsIContent** aResult)
return NS_ERROR_NOT_INITIALIZED; return NS_ERROR_NOT_INITIALIZED;
ContentListItem* item = ContentListItem* item =
NS_REINTERPRET_CAST(ContentListItem*, PL_HashTableLookup(mMap, (const PRUnichar *)nsPromiseFlatString(aID))); NS_REINTERPRET_CAST(ContentListItem*, PL_HashTableLookup(mMap, (const PRUnichar *)nsPromiseFlatString(aID).get()));
if (item) { if (item) {
*aResult = item->mContent; *aResult = item->mContent;

Просмотреть файл

@ -507,7 +507,7 @@ nsXULCommandDispatcher::Matches(const nsString& aList,
if (aList.Equals(NS_LITERAL_STRING("*"))) if (aList.Equals(NS_LITERAL_STRING("*")))
return PR_TRUE; // match _everything_! return PR_TRUE; // match _everything_!
PRInt32 indx = aList.Find((const PRUnichar *)nsPromiseFlatString(aElement)); PRInt32 indx = aList.Find((const PRUnichar *)nsPromiseFlatString(aElement).get());
if (indx == -1) if (indx == -1)
return PR_FALSE; // not in the list at all return PR_FALSE; // not in the list at all
@ -548,7 +548,8 @@ nsXULCommandDispatcher::GetParentWindowFromDocument(nsIDOMDocument* aDocument, n
NS_IMETHODIMP NS_IMETHODIMP
nsXULCommandDispatcher::GetControllerForCommand(const nsAReadableString& aCommand, nsIController** _retval) nsXULCommandDispatcher::GetControllerForCommand(const nsAReadableString& aCommand, nsIController** _retval)
{ {
const PRUnichar *command = nsPromiseFlatString(aCommand); nsPromiseFlatString flatCommand(aCommand);
const PRUnichar *command = flatCommand.get();
*_retval = nsnull; *_retval = nsnull;
nsCOMPtr<nsIControllers> controllers; nsCOMPtr<nsIControllers> controllers;

Просмотреть файл

@ -875,8 +875,8 @@ nsXULDocument::SetDocumentCharacterSet(const nsAReadableString& aCharSetID)
PRInt32 n = mCharSetObservers.Count(); PRInt32 n = mCharSetObservers.Count();
for (PRInt32 i = 0; i < n; i++) { for (PRInt32 i = 0; i < n; i++) {
nsIObserver* observer = (nsIObserver*) mCharSetObservers.ElementAt(i); nsIObserver* observer = (nsIObserver*) mCharSetObservers.ElementAt(i);
observer->Observe((nsIDocument*) this, NS_LITERAL_STRING("charset"), observer->Observe((nsIDocument*) this, NS_LITERAL_STRING("charset").get(),
nsPromiseFlatString(aCharSetID)); nsPromiseFlatString(aCharSetID).get());
} }
} }
return NS_OK; return NS_OK;

Просмотреть файл

@ -7033,7 +7033,7 @@ nsXULTemplateBuilder::GetFlags()
nsAutoString flags; nsAutoString flags;
mRoot->GetAttribute(kNameSpaceID_None, nsXULAtoms::flags, flags); mRoot->GetAttribute(kNameSpaceID_None, nsXULAtoms::flags, flags);
if (flags.Find(NS_LITERAL_STRING("dont-test-empty")) >= 0) if (flags.Find(NS_LITERAL_STRING("dont-test-empty").get()) >= 0)
mFlags |= eDontTestEmpty; mFlags |= eDontTestEmpty;
return NS_OK; return NS_OK;

Просмотреть файл

@ -363,7 +363,7 @@ RDFContainerUtilsImpl::RDFContainerUtilsImpl()
gRDFService->GetResource(RDF_NAMESPACE_URI "Bag", &kRDF_Bag); gRDFService->GetResource(RDF_NAMESPACE_URI "Bag", &kRDF_Bag);
gRDFService->GetResource(RDF_NAMESPACE_URI "Seq", &kRDF_Seq); gRDFService->GetResource(RDF_NAMESPACE_URI "Seq", &kRDF_Seq);
gRDFService->GetResource(RDF_NAMESPACE_URI "Alt", &kRDF_Alt); gRDFService->GetResource(RDF_NAMESPACE_URI "Alt", &kRDF_Alt);
gRDFService->GetLiteral(NS_LITERAL_STRING("1"), &kOne); gRDFService->GetLiteral(NS_LITERAL_STRING("1").get(), &kOne);
} }
} }
} }

Просмотреть файл

@ -153,7 +153,8 @@ nsElementMap::Add(const nsAReadableString& aID, nsIContent* aContent)
if (! mMap) if (! mMap)
return NS_ERROR_NOT_INITIALIZED; return NS_ERROR_NOT_INITIALIZED;
const PRUnichar *id = nsPromiseFlatString(aID); nsPromiseFlatString flatID(aID);
const PRUnichar *id = flatID.get();
ContentListItem* head = ContentListItem* head =
NS_STATIC_CAST(ContentListItem*, PL_HashTableLookup(mMap, id)); NS_STATIC_CAST(ContentListItem*, PL_HashTableLookup(mMap, id));
@ -251,7 +252,8 @@ nsElementMap::Remove(const nsAReadableString& aID, nsIContent* aContent)
if (! mMap) if (! mMap)
return NS_ERROR_NOT_INITIALIZED; return NS_ERROR_NOT_INITIALIZED;
const PRUnichar *id = nsPromiseFlatString(aID); nsPromiseFlatString flatID(aID);
const PRUnichar *id = flatID.get();
#ifdef PR_LOGGING #ifdef PR_LOGGING
if (PR_LOG_TEST(gMapLog, PR_LOG_ALWAYS)) { if (PR_LOG_TEST(gMapLog, PR_LOG_ALWAYS)) {
@ -330,7 +332,7 @@ nsElementMap::Find(const nsAReadableString& aID, nsISupportsArray* aResults)
aResults->Clear(); aResults->Clear();
ContentListItem* item = ContentListItem* item =
NS_REINTERPRET_CAST(ContentListItem*, PL_HashTableLookup(mMap, (const PRUnichar *)nsPromiseFlatString(aID))); NS_REINTERPRET_CAST(ContentListItem*, PL_HashTableLookup(mMap, (const PRUnichar *)nsPromiseFlatString(aID).get()));
while (item) { while (item) {
aResults->AppendElement(item->mContent); aResults->AppendElement(item->mContent);
@ -348,7 +350,7 @@ nsElementMap::FindFirst(const nsAReadableString& aID, nsIContent** aResult)
return NS_ERROR_NOT_INITIALIZED; return NS_ERROR_NOT_INITIALIZED;
ContentListItem* item = ContentListItem* item =
NS_REINTERPRET_CAST(ContentListItem*, PL_HashTableLookup(mMap, (const PRUnichar *)nsPromiseFlatString(aID))); NS_REINTERPRET_CAST(ContentListItem*, PL_HashTableLookup(mMap, (const PRUnichar *)nsPromiseFlatString(aID).get()));
if (item) { if (item) {
*aResult = item->mContent; *aResult = item->mContent;

Просмотреть файл

@ -507,7 +507,7 @@ nsXULCommandDispatcher::Matches(const nsString& aList,
if (aList.Equals(NS_LITERAL_STRING("*"))) if (aList.Equals(NS_LITERAL_STRING("*")))
return PR_TRUE; // match _everything_! return PR_TRUE; // match _everything_!
PRInt32 indx = aList.Find((const PRUnichar *)nsPromiseFlatString(aElement)); PRInt32 indx = aList.Find((const PRUnichar *)nsPromiseFlatString(aElement).get());
if (indx == -1) if (indx == -1)
return PR_FALSE; // not in the list at all return PR_FALSE; // not in the list at all
@ -548,7 +548,8 @@ nsXULCommandDispatcher::GetParentWindowFromDocument(nsIDOMDocument* aDocument, n
NS_IMETHODIMP NS_IMETHODIMP
nsXULCommandDispatcher::GetControllerForCommand(const nsAReadableString& aCommand, nsIController** _retval) nsXULCommandDispatcher::GetControllerForCommand(const nsAReadableString& aCommand, nsIController** _retval)
{ {
const PRUnichar *command = nsPromiseFlatString(aCommand); nsPromiseFlatString flatCommand(aCommand);
const PRUnichar *command = flatCommand.get();
*_retval = nsnull; *_retval = nsnull;
nsCOMPtr<nsIControllers> controllers; nsCOMPtr<nsIControllers> controllers;

Просмотреть файл

@ -875,8 +875,8 @@ nsXULDocument::SetDocumentCharacterSet(const nsAReadableString& aCharSetID)
PRInt32 n = mCharSetObservers.Count(); PRInt32 n = mCharSetObservers.Count();
for (PRInt32 i = 0; i < n; i++) { for (PRInt32 i = 0; i < n; i++) {
nsIObserver* observer = (nsIObserver*) mCharSetObservers.ElementAt(i); nsIObserver* observer = (nsIObserver*) mCharSetObservers.ElementAt(i);
observer->Observe((nsIDocument*) this, NS_LITERAL_STRING("charset"), observer->Observe((nsIDocument*) this, NS_LITERAL_STRING("charset").get(),
nsPromiseFlatString(aCharSetID)); nsPromiseFlatString(aCharSetID).get());
} }
} }
return NS_OK; return NS_OK;

Просмотреть файл

@ -7033,7 +7033,7 @@ nsXULTemplateBuilder::GetFlags()
nsAutoString flags; nsAutoString flags;
mRoot->GetAttribute(kNameSpaceID_None, nsXULAtoms::flags, flags); mRoot->GetAttribute(kNameSpaceID_None, nsXULAtoms::flags, flags);
if (flags.Find(NS_LITERAL_STRING("dont-test-empty")) >= 0) if (flags.Find(NS_LITERAL_STRING("dont-test-empty").get()) >= 0)
mFlags |= eDontTestEmpty; mFlags |= eDontTestEmpty;
return NS_OK; return NS_OK;