rv = nsServiceManager::GetService(NS_OBSERVERSERVICE_CONTRACTID,
rv = nsServiceManager::GetService(NS_OBSERVERSERVICE_PROGID,
void nsAppShellService::RegisterObserver(PRBool aRegister){  nsresult           rv;  nsISupports        *glop;  nsAutoString topicA; topicA.AssignWithConversion(gEQActivatedNotification);  nsAutoString topicB; topicB.AssignWithConversion(gEQDestroyedNotification);  // here's a silly dance. seems better to do it than not, though...  nsCOMPtr<nsIObserver> weObserve(do_QueryInterface(NS_STATIC_CAST(nsIObserver *, this)));  NS_ASSERTION(weObserve, "who's been chopping bits off nsAppShellService?");  rv = nsServiceManager::GetService(NS_OBSERVERSERVICE_CONTRACTID,                           NS_GET_IID(nsIObserverService), &glop);  if (NS_SUCCEEDED(rv)) {    nsIObserverService *os = NS_STATIC_CAST(nsIObserverService*,glop);    if (aRegister) {      os->AddObserver(weObserve, topicA.get());      os->AddObserver(weObserve, topicB.get());      os->AddObserver(weObserve, gSkinSelectedTopic.get());      os->AddObserver(weObserve, gLocaleSelectedTopic.get());    } else {      os->RemoveObserver(weObserve, topicA.get());      os->RemoveObserver(weObserve, topicB.get());      os->RemoveObserver(weObserve, gSkinSelectedTopic.get());      os->RemoveObserver(weObserve, gLocaleSelectedTopic.get());    }    nsServiceManager::ReleaseService(NS_OBSERVERSERVICE_CONTRACTID, glop);  }}