Bug 4618. Fix compilation problem on Solaris native compile. a=chofmann@netscape.com

This commit is contained in:
waterson%netscape.com 1999-04-08 01:53:31 +00:00
parent c22cf7974d
commit 540407e20f
4 changed files with 20 additions and 20 deletions

View File

@ -271,7 +271,9 @@ nsXULAttribute::SetValue(const nsString& aValue)
{
nsCOMPtr<nsIDOMElement> element( do_QueryInterface(mContent) );
if (element) {
return element->SetAttribute(GetQualifiedName(), aValue);
nsAutoString qualifiedName;
GetQualifiedName(qualifiedName);
return element->SetAttribute(qualifiedName, aValue);
}
else {
return NS_ERROR_FAILURE;
@ -318,22 +320,20 @@ nsXULAttribute::SetScriptObject(void *aScriptObject)
// Implementation methods
const nsString&
nsXULAttribute::GetQualifiedName()
void
nsXULAttribute::GetQualifiedName(nsString& aQualifiedName)
{
nsAutoString result;
aQualifiedName.Truncate();
if ((mNameSpaceID != kNameSpaceID_None) &&
(mNameSpaceID != kNameSpaceID_Unknown)) {
nsIAtom* prefix;
if (NS_SUCCEEDED(mContent->GetNameSpacePrefixFromId(mNameSpaceID, prefix))) {
result.Append(prefix->GetUnicode());
result.Append(':');
aQualifiedName.Append(prefix->GetUnicode());
aQualifiedName.Append(':');
NS_RELEASE(prefix);
}
}
result.Append(mName->GetUnicode());
return result;
aQualifiedName.Append(mName->GetUnicode());
}

View File

@ -100,7 +100,7 @@ public:
NS_IMETHOD SetScriptObject(void *aScriptObject);
// Implementation methods
const nsString& GetQualifiedName();
void GetQualifiedName(nsString& aAttributeName);
PRInt32 GetNameSpaceID();
nsIAtom* GetName();

View File

@ -271,7 +271,9 @@ nsXULAttribute::SetValue(const nsString& aValue)
{
nsCOMPtr<nsIDOMElement> element( do_QueryInterface(mContent) );
if (element) {
return element->SetAttribute(GetQualifiedName(), aValue);
nsAutoString qualifiedName;
GetQualifiedName(qualifiedName);
return element->SetAttribute(qualifiedName, aValue);
}
else {
return NS_ERROR_FAILURE;
@ -318,22 +320,20 @@ nsXULAttribute::SetScriptObject(void *aScriptObject)
// Implementation methods
const nsString&
nsXULAttribute::GetQualifiedName()
void
nsXULAttribute::GetQualifiedName(nsString& aQualifiedName)
{
nsAutoString result;
aQualifiedName.Truncate();
if ((mNameSpaceID != kNameSpaceID_None) &&
(mNameSpaceID != kNameSpaceID_Unknown)) {
nsIAtom* prefix;
if (NS_SUCCEEDED(mContent->GetNameSpacePrefixFromId(mNameSpaceID, prefix))) {
result.Append(prefix->GetUnicode());
result.Append(':');
aQualifiedName.Append(prefix->GetUnicode());
aQualifiedName.Append(':');
NS_RELEASE(prefix);
}
}
result.Append(mName->GetUnicode());
return result;
aQualifiedName.Append(mName->GetUnicode());
}

View File

@ -100,7 +100,7 @@ public:
NS_IMETHOD SetScriptObject(void *aScriptObject);
// Implementation methods
const nsString& GetQualifiedName();
void GetQualifiedName(nsString& aAttributeName);
PRInt32 GetNameSpaceID();
nsIAtom* GetName();