Merge kipp's string cleanup from browser app core

This commit is contained in:
law%netscape.com 1999-09-14 23:19:53 +00:00
parent 450edd80d1
commit 41ca89ff79

View File

@ -316,7 +316,8 @@ NS_IMETHODIMP
nsBrowserAppCore::Stop()
{
mContentAreaWebShell->Stop();
setAttribute( mWebShell, "Browser:Throbber", "busy", "false" );
nsAutoString v( "false" );
setAttribute( mWebShell, "Browser:Throbber", "busy", v );
return NS_OK;
}
@ -1552,13 +1553,15 @@ nsBrowserAppCore::OnStartDocumentLoad(nsIDocumentLoader* aLoader, nsIURI* aURL,
// Kick start the throbber
setAttribute( mWebShell, "Browser:Throbber", "busy", "true" );
nsAutoString trueStr("true");
nsAutoString emptyStr;
setAttribute( mWebShell, "Browser:Throbber", "busy", trueStr );
// Enable the Stop buton
setAttribute( mWebShell, "canStop", "disabled", "" );
setAttribute( mWebShell, "canStop", "disabled", emptyStr );
//Disable the reload button
setAttribute(mWebShell, "canReload", "disabled", "true");
setAttribute(mWebShell, "canReload", "disabled", trueStr);
#ifdef NECKO
nsCRT::free(url);
@ -1590,7 +1593,7 @@ nsBrowserAppCore::OnStartDocumentLoad(nsIDocumentLoader* aLoader, nsIURI* aURL,
}
else
{
setAttribute(mWebShell, "Browser:ProtocolIcon", "uri", "");
setAttribute(mWebShell, "Browser:ProtocolIcon", "uri", emptyStr);
}
NS_RELEASE(chrome);
@ -2394,9 +2397,9 @@ nsBrowserAppCore::BeginObserving() {
(nsISupports**)&svc );
if ( NS_SUCCEEDED( rv ) && svc ) {
// Add/Remove object as observer of web shell window topics.
nsString topic1 = prefix;
nsAutoString topic1(prefix);
topic1 += ";status";
nsString topic2 = prefix;
nsAutoString topic2(prefix);
topic2 += ";progress";
rv = svc->AddObserver( this, topic1.GetUnicode() );
rv = svc->AddObserver( this, topic2.GetUnicode() );
@ -2416,9 +2419,9 @@ nsBrowserAppCore::EndObserving() {
(nsISupports**)&svc );
if ( NS_SUCCEEDED( rv ) && svc ) {
// Add/Remove object as observer of web shell window topics.
nsString topic1 = prefix;
nsAutoString topic1(prefix);
topic1 += ";status";
nsString topic2 = prefix;
nsAutoString topic2(prefix);
topic2 += ";progress";
rv = svc->RemoveObserver( this, topic1.GetUnicode() );
rv = svc->RemoveObserver( this, topic2.GetUnicode() );
@ -2449,7 +2452,8 @@ nsBrowserAppCore::Observe( nsISupports *aSubject,
// Get topic substring.
if ( topic1 == aTopic ) {
// Update status text.
rv = setAttribute( mWebShell, "Browser:Status", "value", someData );
nsAutoString v(someData);
rv = setAttribute( mWebShell, "Browser:Status", "value", v );
} else if ( topic2 == aTopic ) {
// We don't process this, yet.
}