Closed Bug 324092 Opened 19 years ago Closed 18 years ago

Allow output handlers to fail

Categories

(Core :: XSLT, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: sicking, Assigned: sicking)

References

Details

Attachments

(2 files)

Currently all functions on the output handler interface returns void making it impossible for the output handler to fail.

Patch coming up.
Attached patch Patch to fix -wSplinter Review
Attachment #209060 - Flags: superreview?(peterv)
Attachment #209060 - Flags: review?(peterv)
Comment on attachment 209060 [details] [diff] [review]
Patch to fix -w

>Index: xslt/src/xslt/txMozillaXMLOutput.cpp
>===================================================================

>+nsresult
>+txMozillaXMLOutput::endDocument(nsresult aResult)
> {
>-    closePrevious(eCloseElement | eFlushText);
>+    if (NS_FAILED(aResult)) {
>+        if (mNotifier) {
>+            mNotifier->OnTransformEnd(aResult);
>+        }
>+        
>+        return NS_OK;
>+    }
>+
>+    nsresult rv = closePrevious(eCloseElement | eFlushText);
>+    NS_ENSURE_SUCCESS(rv, rv);

Doesn't this need to call OnTransformEnd?

>+
>     // This should really be handled by nsIDocument::Reset
>     if (mCreatingNewDocument && !mHaveTitleElement) {
>         nsCOMPtr<nsIDOMNSDocument> domDoc = do_QueryInterface(mDocument);
>         if (domDoc) {
>             domDoc->SetTitle(EmptyString());
>         }
>     }
> 
>@@ -221,29 +238,32 @@ void txMozillaXMLOutput::endDocument(nsr
>             if (refURI) {
>                 refURI->SetupRefreshURIFromHeader(doc->GetBaseURI(),
>                                                   mRefreshString);
>             }
>         }
>     }
> 
>     if (mNotifier) {
>-        mNotifier->OnTransformEnd(aResult);
>+        mNotifier->OnTransformEnd();



> txTransformNotifier::AddScriptElement(nsIScriptElement* aElement)
> {
>-    mScriptElements.AppendObject(aElement);
>+    return mScriptElements.AppendObject(aElement) ? NS_OK
>+        : NS_ERROR_OUT_OF_MEMORY;

    return mScriptElements.AppendObject(aElement) ? NS_OK :
                                                    NS_ERROR_OUT_OF_MEMORY;

> txTransformNotifier::AddStyleSheet(nsIStyleSheet* aStyleSheet)
> {
>-    mStylesheets.AppendObject(aStyleSheet);
>+    return mStylesheets.AppendObject(aStyleSheet) ? NS_OK
>+        : NS_ERROR_OUT_OF_MEMORY;

    return mStylesheets.AppendObject(aStyleSheet) ? NS_OK :
                                                    NS_ERROR_OUT_OF_MEMORY;
Attachment #209060 - Flags: superreview?(peterv)
Attachment #209060 - Flags: superreview+
Attachment #209060 - Flags: review?(peterv)
Attachment #209060 - Flags: review+
Depends on: 351886
This was fixed long ago
Status: NEW → ASSIGNED
This was fixed long ago.
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: