From 28fa63a8f5050a13f7892a96b812b9a4fa7f8b77 Mon Sep 17 00:00:00 2001 From: "timeless%mozdev.org" Date: Sat, 6 May 2006 22:09:20 +0000 Subject: [PATCH] Bug 335953 Make code outside intl use NS_CHARSETALIAS_CONTRACTID instead of NS_CHARSETALIAS_CID r=bz sr=bz --- browser/components/bookmarks/src/nsBookmarksService.cpp | 3 +-- content/base/src/nsDocument.cpp | 5 ++--- content/base/src/nsXMLHttpRequest.cpp | 3 +-- content/html/content/src/nsFormSubmission.cpp | 3 +-- content/html/document/src/nsHTMLDocument.cpp | 1 - content/xml/document/src/nsXMLDocument.cpp | 1 - parser/htmlparser/src/nsScanner.cpp | 4 +--- xpfe/components/bookmarks/src/nsBookmarksService.cpp | 3 +-- 8 files changed, 7 insertions(+), 16 deletions(-) diff --git a/browser/components/bookmarks/src/nsBookmarksService.cpp b/browser/components/bookmarks/src/nsBookmarksService.cpp index c6f61fc3d1ac..58f85e5e6486 100644 --- a/browser/components/bookmarks/src/nsBookmarksService.cpp +++ b/browser/components/bookmarks/src/nsBookmarksService.cpp @@ -190,7 +190,6 @@ static NS_DEFINE_CID(kCharsetConverterManagerCID, NS_ICHARSETCONVERTERMANAGER_CI static NS_DEFINE_CID(kStringBundleServiceCID, NS_STRINGBUNDLESERVICE_CID); static NS_DEFINE_CID(kPlatformCharsetCID, NS_PLATFORMCHARSET_CID); static NS_DEFINE_CID(kCacheServiceCID, NS_CACHESERVICE_CID); -static NS_DEFINE_CID(kCharsetAliasCID, NS_CHARSETALIAS_CID); static const char kURINC_BookmarksTopRoot[] = "NC:BookmarksTopRoot"; static const char kURINC_BookmarksRoot[] = "NC:BookmarksRoot"; @@ -226,7 +225,7 @@ bm_AddRefGlobals() NS_ASSERTION(NS_SUCCEEDED(rv), "unable to get RDF container utils"); if (NS_FAILED(rv)) return rv; - rv = CallGetService(kCharsetAliasCID, &gCharsetAlias); + rv = CallGetService(NS_CHARSETALIAS_CONTRACTID, &gCharsetAlias); NS_ASSERTION(NS_SUCCEEDED(rv), "unable to get charset alias service"); if (NS_FAILED(rv)) return rv; diff --git a/content/base/src/nsDocument.cpp b/content/base/src/nsDocument.cpp index 4e8d05e69bb7..8ec87d5a202e 100644 --- a/content/base/src/nsDocument.cpp +++ b/content/base/src/nsDocument.cpp @@ -155,7 +155,6 @@ static NS_DEFINE_CID(kDOMEventGroupCID, NS_DOMEVENTGROUP_CID); static PRLogModuleInfo* gDocumentLeakPRLog; #endif -static NS_DEFINE_CID(kCharsetAliasCID, NS_CHARSETALIAS_CID); static NS_DEFINE_CID(kDateTimeFormatCID, NS_DATETIMEFORMAT_CID); void @@ -1315,7 +1314,7 @@ nsDocument::SetDocumentCharacterSet(const nsACString& aCharSetID) mCharacterSet = aCharSetID; #ifdef DEBUG - nsCOMPtr calias(do_GetService(kCharsetAliasCID)); + nsCOMPtr calias(do_GetService(NS_CHARSETALIAS_CONTRACTID)); if (calias) { nsCAutoString canonicalName; calias->GetPreferred(aCharSetID, canonicalName); @@ -1468,7 +1467,7 @@ nsDocument::TryChannelCharset(nsIChannel *aChannel, nsCAutoString charsetVal; nsresult rv = aChannel->GetContentCharset(charsetVal); if (NS_SUCCEEDED(rv)) { - nsCOMPtr calias(do_GetService(kCharsetAliasCID)); + nsCOMPtr calias(do_GetService(NS_CHARSETALIAS_CONTRACTID)); if (calias) { nsCAutoString preferred; rv = calias->GetPreferred(charsetVal, diff --git a/content/base/src/nsXMLHttpRequest.cpp b/content/base/src/nsXMLHttpRequest.cpp index 1d33badaf5a2..916a77e371c4 100644 --- a/content/base/src/nsXMLHttpRequest.cpp +++ b/content/base/src/nsXMLHttpRequest.cpp @@ -88,7 +88,6 @@ static const char* kLoadAsData = "loadAsData"; #define READYSTATE_STR "readystatechange" // CIDs -static NS_DEFINE_CID(kCharsetAliasCID, NS_CHARSETALIAS_CID); static NS_DEFINE_CID(kIDOMDOMImplementationCID, NS_DOM_IMPLEMENTATION_CID); static NS_DEFINE_CID(kCharsetConverterManagerCID, NS_ICHARSETCONVERTERMANAGER_CID); static NS_DEFINE_CID(kEventQueueServiceCID, NS_EVENTQUEUESERVICE_CID); @@ -535,7 +534,7 @@ nsXMLHttpRequest::DetectCharset(nsACString& aCharset) rv = channel->GetContentCharset(charsetVal); if (NS_SUCCEEDED(rv)) { - nsCOMPtr calias(do_GetService(kCharsetAliasCID,&rv)); + nsCOMPtr calias(do_GetService(NS_CHARSETALIAS_CONTRACTID,&rv)); if(NS_SUCCEEDED(rv) && calias) { rv = calias->GetPreferred(charsetVal, aCharset); } diff --git a/content/html/content/src/nsFormSubmission.cpp b/content/html/content/src/nsFormSubmission.cpp index 35258b95df82..94630d928eea 100644 --- a/content/html/content/src/nsFormSubmission.cpp +++ b/content/html/content/src/nsFormSubmission.cpp @@ -74,7 +74,6 @@ //end static NS_DEFINE_CID(kFormProcessorCID, NS_FORMPROCESSOR_CID); -static NS_DEFINE_CID(kCharsetAliasCID, NS_CHARSETALIAS_CID); /** * Helper superclass implementation of nsIFormSubmission, providing common @@ -1248,7 +1247,7 @@ nsFormSubmission::GetSubmitCharset(nsGenericHTMLElement* aForm, PRInt32 offset=0; PRInt32 spPos=0; // get charset from charsets one by one - nsCOMPtr calias(do_GetService(kCharsetAliasCID, &rv)); + nsCOMPtr calias(do_GetService(NS_CHARSETALIAS_CONTRACTID, &rv)); if (NS_FAILED(rv)) { return; } diff --git a/content/html/document/src/nsHTMLDocument.cpp b/content/html/document/src/nsHTMLDocument.cpp index 0f1a8d7ca62b..01bc9d623b88 100644 --- a/content/html/document/src/nsHTMLDocument.cpp +++ b/content/html/document/src/nsHTMLDocument.cpp @@ -155,7 +155,6 @@ const PRInt32 kBackward = 1; static NS_DEFINE_CID(kCookieServiceCID, NS_COOKIESERVICE_CID); static NS_DEFINE_CID(kRDFServiceCID, NS_RDFSERVICE_CID); -static NS_DEFINE_CID(kCharsetAliasCID, NS_CHARSETALIAS_CID); // Returns the name atom of aContent, if the content is a named item // and has a name atom. diff --git a/content/xml/document/src/nsXMLDocument.cpp b/content/xml/document/src/nsXMLDocument.cpp index 832a1b46bc59..487ef528ca08 100644 --- a/content/xml/document/src/nsXMLDocument.cpp +++ b/content/xml/document/src/nsXMLDocument.cpp @@ -97,7 +97,6 @@ static const char kLoadAsData[] = "loadAsData"; static NS_DEFINE_CID(kEventQueueServiceCID, NS_EVENTQUEUESERVICE_CID); -static NS_DEFINE_CID(kCharsetAliasCID, NS_CHARSETALIAS_CID); // ================================================================== diff --git a/parser/htmlparser/src/nsScanner.cpp b/parser/htmlparser/src/nsScanner.cpp index 2391b3e10d81..6a01255e0b6d 100644 --- a/parser/htmlparser/src/nsScanner.cpp +++ b/parser/htmlparser/src/nsScanner.cpp @@ -50,8 +50,6 @@ #include "nsCRT.h" #include "nsParser.h" -static NS_DEFINE_CID(kCharsetAliasCID, NS_CHARSETALIAS_CID); - nsReadEndCondition::nsReadEndCondition(const PRUnichar* aTerminateChars) : mChars(aTerminateChars), mFilter(PRUnichar(~0)) // All bits set { @@ -196,7 +194,7 @@ nsresult nsScanner::SetDocumentCharset(const nsACString& aCharset , PRInt32 aSou if( aSource < mCharsetSource) // priority is lower the the current one , just return res; - nsCOMPtr calias(do_GetService(kCharsetAliasCID, &res)); + nsCOMPtr calias(do_GetService(NS_CHARSETALIAS_CONTRACTID, &res)); NS_ASSERTION( nsnull != calias, "cannot find charset alias"); if( NS_SUCCEEDED(res) && (nsnull != calias)) { diff --git a/xpfe/components/bookmarks/src/nsBookmarksService.cpp b/xpfe/components/bookmarks/src/nsBookmarksService.cpp index 0d13560a6010..89bbbbd4fe75 100644 --- a/xpfe/components/bookmarks/src/nsBookmarksService.cpp +++ b/xpfe/components/bookmarks/src/nsBookmarksService.cpp @@ -167,7 +167,6 @@ static NS_DEFINE_CID(kCharsetConverterManagerCID, NS_ICHARSETCONVERTERMANAGER_CI static NS_DEFINE_CID(kStringBundleServiceCID, NS_STRINGBUNDLESERVICE_CID); static NS_DEFINE_CID(kPlatformCharsetCID, NS_PLATFORMCHARSET_CID); static NS_DEFINE_CID(kCacheServiceCID, NS_CACHESERVICE_CID); -static NS_DEFINE_CID(kCharsetAliasCID, NS_CHARSETALIAS_CID); static NS_DEFINE_CID(kCollationFactoryCID, NS_COLLATIONFACTORY_CID); #define URINC_BOOKMARKS_TOPROOT_STRING "NC:BookmarksTopRoot" @@ -211,7 +210,7 @@ bm_AddRefGlobals() return rv; } - rv = CallGetService(kCharsetAliasCID, &gCharsetAlias); + rv = CallGetService(NS_CHARSETALIAS_CONTRACTID, &gCharsetAlias); if (NS_FAILED(rv)) { NS_ERROR("unable to get charset alias service"); return rv;