Fixed an nsString usage oopsie

This commit is contained in:
kipp%netscape.com 1999-09-02 18:02:52 +00:00
Родитель b1ed8de092
Коммит ca2b2003c6
5 изменённых файлов: 28 добавлений и 21 удалений

Просмотреть файл

@ -2458,13 +2458,14 @@ PRBool CSSParserImpl::ParseURL(PRInt32& aErrorCode, nsCSSValue& aValue)
// XXX editors won't like this - too bad for now
nsAutoString absURL;
if (nsnull != mURL) {
nsString baseURL;
nsAutoString baseURL;
nsresult rv;
#ifdef NECKO
nsCOMPtr<nsIURI> base;
rv = mURL->Clone(getter_AddRefs(base));
if (NS_SUCCEEDED(rv))
rv = NS_MakeAbsoluteURI(nsCAutoString(tk->mIdent), base, absURL);
nsCOMPtr<nsIURI> base;
rv = mURL->Clone(getter_AddRefs(base));
if (NS_SUCCEEDED(rv)) {
rv = NS_MakeAbsoluteURI(tk->mIdent, base, absURL);
}
#else
rv = NS_MakeAbsoluteURL(mURL, baseURL, tk->mIdent, absURL);
#endif // NECKO

Просмотреть файл

@ -39,11 +39,13 @@ void nsXULAtoms::AddRefAtoms() {
/* XUL Atoms registers the XUL name space ID because it's a convenient
place to do this, if you don't want a permanent, "well-known" ID.
*/
if (NS_SUCCEEDED(NS_NewNameSpaceManager(&gNameSpaceManager)))
if (NS_SUCCEEDED(NS_NewNameSpaceManager(&gNameSpaceManager))) {
// gNameSpaceManager->CreateRootNameSpace(namespace);
gNameSpaceManager->RegisterNameSpace(kXULNameSpace, nameSpaceID);
else
nsAutoString nameSpace(kXULNameSpace);
gNameSpaceManager->RegisterNameSpace(nameSpace, nameSpaceID);
} else {
NS_ASSERTION(0, "failed to create xul atoms namespace manager");
}
// now register the atoms
#define XUL_ATOM(_name, _value) _name = NS_NewAtom(_value);

Просмотреть файл

@ -2458,13 +2458,14 @@ PRBool CSSParserImpl::ParseURL(PRInt32& aErrorCode, nsCSSValue& aValue)
// XXX editors won't like this - too bad for now
nsAutoString absURL;
if (nsnull != mURL) {
nsString baseURL;
nsAutoString baseURL;
nsresult rv;
#ifdef NECKO
nsCOMPtr<nsIURI> base;
rv = mURL->Clone(getter_AddRefs(base));
if (NS_SUCCEEDED(rv))
rv = NS_MakeAbsoluteURI(nsCAutoString(tk->mIdent), base, absURL);
nsCOMPtr<nsIURI> base;
rv = mURL->Clone(getter_AddRefs(base));
if (NS_SUCCEEDED(rv)) {
rv = NS_MakeAbsoluteURI(tk->mIdent, base, absURL);
}
#else
rv = NS_MakeAbsoluteURL(mURL, baseURL, tk->mIdent, absURL);
#endif // NECKO

Просмотреть файл

@ -2458,13 +2458,14 @@ PRBool CSSParserImpl::ParseURL(PRInt32& aErrorCode, nsCSSValue& aValue)
// XXX editors won't like this - too bad for now
nsAutoString absURL;
if (nsnull != mURL) {
nsString baseURL;
nsAutoString baseURL;
nsresult rv;
#ifdef NECKO
nsCOMPtr<nsIURI> base;
rv = mURL->Clone(getter_AddRefs(base));
if (NS_SUCCEEDED(rv))
rv = NS_MakeAbsoluteURI(nsCAutoString(tk->mIdent), base, absURL);
nsCOMPtr<nsIURI> base;
rv = mURL->Clone(getter_AddRefs(base));
if (NS_SUCCEEDED(rv)) {
rv = NS_MakeAbsoluteURI(tk->mIdent, base, absURL);
}
#else
rv = NS_MakeAbsoluteURL(mURL, baseURL, tk->mIdent, absURL);
#endif // NECKO

Просмотреть файл

@ -39,11 +39,13 @@ void nsXULAtoms::AddRefAtoms() {
/* XUL Atoms registers the XUL name space ID because it's a convenient
place to do this, if you don't want a permanent, "well-known" ID.
*/
if (NS_SUCCEEDED(NS_NewNameSpaceManager(&gNameSpaceManager)))
if (NS_SUCCEEDED(NS_NewNameSpaceManager(&gNameSpaceManager))) {
// gNameSpaceManager->CreateRootNameSpace(namespace);
gNameSpaceManager->RegisterNameSpace(kXULNameSpace, nameSpaceID);
else
nsAutoString nameSpace(kXULNameSpace);
gNameSpaceManager->RegisterNameSpace(nameSpace, nameSpaceID);
} else {
NS_ASSERTION(0, "failed to create xul atoms namespace manager");
}
// now register the atoms
#define XUL_ATOM(_name, _value) _name = NS_NewAtom(_value);