diff --git a/extensions/webservices/soap/src/nsSOAPException.cpp b/extensions/webservices/soap/src/nsSOAPException.cpp index 0b8ffc63a78..1e88194dea4 100644 --- a/extensions/webservices/soap/src/nsSOAPException.cpp +++ b/extensions/webservices/soap/src/nsSOAPException.cpp @@ -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 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 exception = new nsSOAPException(aStatus, aName, + aMessage, old); if (exception) { xm->SetCurrentException(exception); } diff --git a/extensions/xmlextras/soap/src/nsSOAPException.cpp b/extensions/xmlextras/soap/src/nsSOAPException.cpp index 0b8ffc63a78..1e88194dea4 100644 --- a/extensions/xmlextras/soap/src/nsSOAPException.cpp +++ b/extensions/xmlextras/soap/src/nsSOAPException.cpp @@ -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 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 exception = new nsSOAPException(aStatus, aName, + aMessage, old); if (exception) { xm->SetCurrentException(exception); }