diff --git a/chrome/src/nsChromeRegistry.cpp b/chrome/src/nsChromeRegistry.cpp index 71869b1ca5a..877673cd4e4 100644 --- a/chrome/src/nsChromeRegistry.cpp +++ b/chrome/src/nsChromeRegistry.cpp @@ -478,12 +478,10 @@ NS_IMETHODIMP nsChromeRegistry::GetOverlayDataSource(nsIURI *aChromeURL, nsIRDFD overlayFile += "overlays.rdf"; nsStringKey skey(overlayFile); - void *data = mDataSourceTable->Get(&skey); - if (data) + nsCOMPtr supports = getter_AddRefs(NS_STATIC_CAST(nsISupports*, mDataSourceTable->Get(&skey))); + if (supports) { - nsCOMPtr dataSource; - nsISupports *supports = NS_STATIC_CAST(nsISupports*, data); - dataSource = do_QueryInterface(supports, &rv); + nsCOMPtr dataSource = do_QueryInterface(supports, &rv); if (NS_SUCCEEDED(rv)) { *aResult = dataSource; @@ -600,13 +598,10 @@ nsChromeRegistry::InitializeDataSource(nsString &aPackage, { // current.rdf and overlays.rdf are loaded in pairs and so if one is loaded, the other should be too. nsStringKey skey(chromeFile); - void *data = mDataSourceTable->Get(&skey); - if (data) + nsCOMPtr supports = getter_AddRefs(NS_STATIC_CAST(nsISupports*, mDataSourceTable->Get(&skey))); + if (supports) { - nsCOMPtr dataSource; - nsISupports *supports = NS_STATIC_CAST(nsISupports*, data); - - dataSource = do_QueryInterface(supports); + nsCOMPtr dataSource = do_QueryInterface(supports); if (dataSource) { *aResult = dataSource; diff --git a/rdf/chrome/src/nsChromeRegistry.cpp b/rdf/chrome/src/nsChromeRegistry.cpp index 71869b1ca5a..877673cd4e4 100644 --- a/rdf/chrome/src/nsChromeRegistry.cpp +++ b/rdf/chrome/src/nsChromeRegistry.cpp @@ -478,12 +478,10 @@ NS_IMETHODIMP nsChromeRegistry::GetOverlayDataSource(nsIURI *aChromeURL, nsIRDFD overlayFile += "overlays.rdf"; nsStringKey skey(overlayFile); - void *data = mDataSourceTable->Get(&skey); - if (data) + nsCOMPtr supports = getter_AddRefs(NS_STATIC_CAST(nsISupports*, mDataSourceTable->Get(&skey))); + if (supports) { - nsCOMPtr dataSource; - nsISupports *supports = NS_STATIC_CAST(nsISupports*, data); - dataSource = do_QueryInterface(supports, &rv); + nsCOMPtr dataSource = do_QueryInterface(supports, &rv); if (NS_SUCCEEDED(rv)) { *aResult = dataSource; @@ -600,13 +598,10 @@ nsChromeRegistry::InitializeDataSource(nsString &aPackage, { // current.rdf and overlays.rdf are loaded in pairs and so if one is loaded, the other should be too. nsStringKey skey(chromeFile); - void *data = mDataSourceTable->Get(&skey); - if (data) + nsCOMPtr supports = getter_AddRefs(NS_STATIC_CAST(nsISupports*, mDataSourceTable->Get(&skey))); + if (supports) { - nsCOMPtr dataSource; - nsISupports *supports = NS_STATIC_CAST(nsISupports*, data); - - dataSource = do_QueryInterface(supports); + nsCOMPtr dataSource = do_QueryInterface(supports); if (dataSource) { *aResult = dataSource;