From 2dd1ffa6e342bc969e4de8e6fa335810831a27c9 Mon Sep 17 00:00:00 2001 From: "jaggernaut%netscape.com" Date: Thu, 6 Sep 2007 22:01:10 +0000 Subject: [PATCH] Bug 53057: Fixing up users of implicit |CharT*| conversion operators for nsCString to use |.get()| instead, rr=dbaron, rs=scc --- suite/browser/src/nsInternetSearchService.cpp | 20 +++++++++---------- suite/browser/src/nsLocalSearchService.cpp | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/suite/browser/src/nsInternetSearchService.cpp b/suite/browser/src/nsInternetSearchService.cpp index 973f881f8e4..39ff8782e34 100755 --- a/suite/browser/src/nsInternetSearchService.cpp +++ b/suite/browser/src/nsInternetSearchService.cpp @@ -642,7 +642,7 @@ InternetSearchDataSource::FireTimer(nsITimer* aTimer, void* aClosure) if (!engineContext) return; nsCOMPtr uri; - if (NS_FAILED(rv = NS_NewURI(getter_AddRefs(uri), updateURL))) return; + if (NS_FAILED(rv = NS_NewURI(getter_AddRefs(uri), updateURL.get()))) return; nsCOMPtr channel; if (NS_FAILED(rv = NS_OpenURI(getter_AddRefs(channel), uri, nsnull))) return; @@ -1037,7 +1037,7 @@ InternetSearchDataSource::GetTarget(nsIRDFResource *source, nsCOMPtr category; nsCAutoString caturiC; caturiC.AssignWithConversion(catURI); - if (NS_FAILED(rv = gRDFService->GetResource(caturiC, + if (NS_FAILED(rv = gRDFService->GetResource(caturiC.get(), getter_AddRefs(category)))) return(rv); @@ -1154,7 +1154,7 @@ InternetSearchDataSource::GetTargets(nsIRDFResource *source, nsCOMPtr category; nsCAutoString caturiC; caturiC.AssignWithConversion(catURI); - if (NS_FAILED(rv = gRDFService->GetResource(caturiC, + if (NS_FAILED(rv = gRDFService->GetResource(caturiC.get(), getter_AddRefs(category)))) return(rv); @@ -2448,7 +2448,7 @@ InternetSearchDataSource::GetInternetSearchURL(const char *searchEngineURI, char *charsetData = nsnull; nsCAutoString queryencodingstrC; queryencodingstrC.AssignWithConversion(queryEncodingStr); - if (NS_SUCCEEDED(rv = textToSubURI->ConvertAndEscape(queryencodingstrC, uni, &charsetData)) && (charsetData)) + if (NS_SUCCEEDED(rv = textToSubURI->ConvertAndEscape(queryencodingstrC.get(), uni, &charsetData)) && (charsetData)) { text.AssignWithConversion(charsetData); Recycle(charsetData); @@ -2641,7 +2641,7 @@ InternetSearchDataSource::FindInternetSearchResults(const char *url, PRBool *sea nsCAutoString aCharset; aCharset.AssignWithConversion(mQueryEncodingStr); PRUnichar *uni = nsnull; - if (NS_SUCCEEDED(rv = textToSubURI->UnEscapeAndConvert(aCharset, escapedSearchText, &uni)) && (uni)) + if (NS_SUCCEEDED(rv = textToSubURI->UnEscapeAndConvert(aCharset.get(), escapedSearchText.get(), &uni)) && (uni)) { char *convertedSearchText = nsnull; if (NS_SUCCEEDED(rv = textToSubURI->ConvertAndEscape("UTF-8", uni, &convertedSearchText))) @@ -2652,7 +2652,7 @@ InternetSearchDataSource::FindInternetSearchResults(const char *url, PRBool *sea unescapedSearchText.ReplaceSubstring("%25", "+"); unescapedSearchText.ReplaceSubstring("%2B25", "%25"); - searchText.AssignWithConversion(unescapedSearchText); + searchText.AssignWithConversion(unescapedSearchText.get()); Recycle(convertedSearchText); } @@ -3557,7 +3557,7 @@ InternetSearchDataSource::DoSearch(nsIRDFResource *source, nsIRDFResource *engin char *charsetData = nsnull; nsCAutoString queryencodingstrC; queryencodingstrC.AssignWithConversion(queryEncodingStr); - if (NS_SUCCEEDED(rv = textToSubURI->ConvertAndEscape(queryencodingstrC, uni, &charsetData)) + if (NS_SUCCEEDED(rv = textToSubURI->ConvertAndEscape(queryencodingstrC.get(), uni, &charsetData)) && (charsetData)) { textTemp.AssignWithConversion(charsetData); @@ -3624,7 +3624,7 @@ InternetSearchDataSource::DoSearch(nsIRDFResource *source, nsIRDFResource *engin nsCAutoString poststrC; poststrC.AssignWithConversion(postStr); if (NS_SUCCEEDED(rv = NS_NewPostDataStream(getter_AddRefs(postDataStream), - PR_FALSE, poststrC, 0))) + PR_FALSE, poststrC.get(), 0))) { nsCOMPtr uploadChannel(do_QueryInterface(httpChannel)); NS_ASSERTION(uploadChannel, "http must support nsIUploadChannel"); @@ -4631,7 +4631,7 @@ InternetSearchDataSource::OnStopRequest(nsIRequest *request, nsISupports *ctxt, } // download it! - AddSearchEngine(updateURL, updateIconURL, nsnull, nsnull); + AddSearchEngine(updateURL.get(), updateIconURL.get(), nsnull, nsnull); } else { @@ -5030,7 +5030,7 @@ InternetSearchDataSource::ParseHTML(nsIURI *aURL, nsIRDFResource *mParent, nsIRD nsCAutoString hrefstrC; hrefstrC.AssignWithConversion(hrefStr); - if (NS_SUCCEEDED(rv = NS_MakeAbsoluteURI(&absURIStr, hrefstrC, aURL)) + if (NS_SUCCEEDED(rv = NS_MakeAbsoluteURI(&absURIStr, hrefstrC.get(), aURL)) && (absURIStr)) { hrefStr.AssignWithConversion(absURIStr); diff --git a/suite/browser/src/nsLocalSearchService.cpp b/suite/browser/src/nsLocalSearchService.cpp index 8968e1f44b4..ca151e35369 100755 --- a/suite/browser/src/nsLocalSearchService.cpp +++ b/suite/browser/src/nsLocalSearchService.cpp @@ -504,7 +504,7 @@ LocalSearchDataSource::parseFindURL(nsIRDFResource *u, nsISupportsArray *array) dsName.AssignWithConversion(tokens[0].value); nsCOMPtr datasource; - rv = gRDFService->GetDataSource(dsName, getter_AddRefs(datasource)); + rv = gRDFService->GetDataSource(dsName.get(), getter_AddRefs(datasource)); if (NS_FAILED(rv)) return rv;