mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-02 01:48:05 +00:00
Fabricate a unique name for anonymous schema types. b=199555, r=rayw@netscape.com, sr=jst@netscape.com
This commit is contained in:
parent
5d6a25ae63
commit
f2fed9e715
@ -443,16 +443,28 @@ FindOrConstructInterface(nsIInterfaceInfoSuperManager* iism,
|
||||
nsAutoString ns;
|
||||
nsCOMPtr<nsIGenericInterfaceInfo> newInfo;
|
||||
nsID tempID;
|
||||
PRBool haveUniqueID = PR_FALSE;
|
||||
|
||||
rv = aComplexType->GetName(name);
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
|
||||
if (name.IsEmpty()) {
|
||||
// Fabricate a unique name for anonymous type.
|
||||
// Bug 199555
|
||||
::NewUniqueID(&tempID);
|
||||
nsXPIDLCString idStr;
|
||||
idStr += tempID.ToString();
|
||||
name.AssignWithConversion(idStr);
|
||||
haveUniqueID = PR_TRUE;
|
||||
}
|
||||
else {
|
||||
rv = aComplexType->GetTargetNamespace(ns);
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
}
|
||||
|
||||
BuildInterfaceName(qualifier, name, ns, qualifiedName);
|
||||
|
||||
@ -465,6 +477,7 @@ FindOrConstructInterface(nsIInterfaceInfoSuperManager* iism,
|
||||
|
||||
// Need to create the interface.
|
||||
|
||||
if (!haveUniqueID)
|
||||
::NewUniqueID(&tempID);
|
||||
rv = aSet->CreateAndAppendInterface(qualifiedName.get(), tempID,
|
||||
iidx.Get(IIDX::IDX_nsISupports),
|
||||
|
@ -492,7 +492,9 @@ EncodeSimpleValue(nsISOAPEncoding * aEncoding,
|
||||
rc = aSchemaType->GetTargetNamespace(typeNS);
|
||||
if (NS_FAILED(rc))
|
||||
return rc;
|
||||
needType = !(typeName.Equals(kAnyTypeSchemaType) && typeNS.Equals(nsSOAPUtils::kXSURI));
|
||||
needType = (!typeName.IsEmpty() &&
|
||||
!(typeName.Equals(kAnyTypeSchemaType) &&
|
||||
typeNS.Equals(nsSOAPUtils::kXSURI)));
|
||||
}
|
||||
nsAutoString name; // First choose the appropriate name and namespace for the element.
|
||||
nsAutoString ns;
|
||||
|
@ -443,16 +443,28 @@ FindOrConstructInterface(nsIInterfaceInfoSuperManager* iism,
|
||||
nsAutoString ns;
|
||||
nsCOMPtr<nsIGenericInterfaceInfo> newInfo;
|
||||
nsID tempID;
|
||||
PRBool haveUniqueID = PR_FALSE;
|
||||
|
||||
rv = aComplexType->GetName(name);
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
|
||||
if (name.IsEmpty()) {
|
||||
// Fabricate a unique name for anonymous type.
|
||||
// Bug 199555
|
||||
::NewUniqueID(&tempID);
|
||||
nsXPIDLCString idStr;
|
||||
idStr += tempID.ToString();
|
||||
name.AssignWithConversion(idStr);
|
||||
haveUniqueID = PR_TRUE;
|
||||
}
|
||||
else {
|
||||
rv = aComplexType->GetTargetNamespace(ns);
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
}
|
||||
|
||||
BuildInterfaceName(qualifier, name, ns, qualifiedName);
|
||||
|
||||
@ -465,6 +477,7 @@ FindOrConstructInterface(nsIInterfaceInfoSuperManager* iism,
|
||||
|
||||
// Need to create the interface.
|
||||
|
||||
if (!haveUniqueID)
|
||||
::NewUniqueID(&tempID);
|
||||
rv = aSet->CreateAndAppendInterface(qualifiedName.get(), tempID,
|
||||
iidx.Get(IIDX::IDX_nsISupports),
|
||||
|
@ -492,7 +492,9 @@ EncodeSimpleValue(nsISOAPEncoding * aEncoding,
|
||||
rc = aSchemaType->GetTargetNamespace(typeNS);
|
||||
if (NS_FAILED(rc))
|
||||
return rc;
|
||||
needType = !(typeName.Equals(kAnyTypeSchemaType) && typeNS.Equals(nsSOAPUtils::kXSURI));
|
||||
needType = (!typeName.IsEmpty() &&
|
||||
!(typeName.Equals(kAnyTypeSchemaType) &&
|
||||
typeNS.Equals(nsSOAPUtils::kXSURI)));
|
||||
}
|
||||
nsAutoString name; // First choose the appropriate name and namespace for the element.
|
||||
nsAutoString ns;
|
||||
|
Loading…
Reference in New Issue
Block a user