Trying the safer version of the bustage fix. Last reviewed by jst, but

that version busted, I think this cannot fail.
This commit is contained in:
rayw%netscape.com 2002-02-22 11:02:19 +00:00
Родитель 0297024c3a
Коммит 08285d747a
2 изменённых файлов: 16 добавлений и 16 удалений

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

@ -203,6 +203,9 @@ nsSOAPException::ToString(char **_retval)
NS_NAMED_LITERAL_STRING(realSOAPExceptionEmpty, "");
const nsAString & nsSOAPException::kEmpty = realSOAPExceptionEmpty;
static NS_NAMED_LITERAL_STRING(kFailure, "SOAP_FAILURE");
static NS_NAMED_LITERAL_STRING(kNoDescription, "No description");
nsresult nsSOAPException::AddException(nsresult aStatus, const nsAString & aName,
const nsAString & aMessage,PRBool aClear)
{
@ -217,14 +220,11 @@ nsresult nsSOAPException::AddException(nsresult aStatus, const nsAString & aName
xs->GetCurrentException(getter_AddRefs(old));
// Need to cast the NS_LITERAL_STRING to const nsAString& to make
// it compile on CW on Mac.
const nsAString& name = aName.IsEmpty() ?
NS_STATIC_CAST(const nsAString&, NS_LITERAL_STRING("SOAP_FAILURE")) :
aName;
const nsAString& message = aMessage.IsEmpty() ?
NS_STATIC_CAST(const nsAString&, NS_LITERAL_STRING("No description")) :
aMessage;
nsCOMPtr<nsIException> exception = new nsSOAPException(aStatus, name,
message, old);
// The evil ? operator caused bustage. This time, eliminate that.
// const nsAString& name = aName.IsEmpty() ? kFailure : aName;
// const nsAString& message = aMessage.IsEmpty() ? kNoDescription : aMessage;
nsCOMPtr<nsIException> exception = new nsSOAPException(aStatus, aName,
aMessage, old);
if (exception) {
xm->SetCurrentException(exception);
}

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

@ -203,6 +203,9 @@ nsSOAPException::ToString(char **_retval)
NS_NAMED_LITERAL_STRING(realSOAPExceptionEmpty, "");
const nsAString & nsSOAPException::kEmpty = realSOAPExceptionEmpty;
static NS_NAMED_LITERAL_STRING(kFailure, "SOAP_FAILURE");
static NS_NAMED_LITERAL_STRING(kNoDescription, "No description");
nsresult nsSOAPException::AddException(nsresult aStatus, const nsAString & aName,
const nsAString & aMessage,PRBool aClear)
{
@ -217,14 +220,11 @@ nsresult nsSOAPException::AddException(nsresult aStatus, const nsAString & aName
xs->GetCurrentException(getter_AddRefs(old));
// Need to cast the NS_LITERAL_STRING to const nsAString& to make
// it compile on CW on Mac.
const nsAString& name = aName.IsEmpty() ?
NS_STATIC_CAST(const nsAString&, NS_LITERAL_STRING("SOAP_FAILURE")) :
aName;
const nsAString& message = aMessage.IsEmpty() ?
NS_STATIC_CAST(const nsAString&, NS_LITERAL_STRING("No description")) :
aMessage;
nsCOMPtr<nsIException> exception = new nsSOAPException(aStatus, name,
message, old);
// The evil ? operator caused bustage. This time, eliminate that.
// const nsAString& name = aName.IsEmpty() ? kFailure : aName;
// const nsAString& message = aMessage.IsEmpty() ? kNoDescription : aMessage;
nsCOMPtr<nsIException> exception = new nsSOAPException(aStatus, aName,
aMessage, old);
if (exception) {
xm->SetCurrentException(exception);
}