[XForms] Stop processing on instance load error. Bug 332218, r=smaug+aaronr

This commit is contained in:
allan%beaufour.dk 2006-04-06 08:17:02 +00:00
Родитель 3e4469d997
Коммит 1a52929f69
1 изменённых файлов: 9 добавлений и 2 удалений

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

@ -1406,11 +1406,18 @@ nsXFormsModelElement::InstanceLoadStarted()
NS_IMETHODIMP
nsXFormsModelElement::InstanceLoadFinished(PRBool aSuccess)
{
--mPendingInstanceCount;
if (!aSuccess) {
// This will leave mPendingInstanceCount in an invalid state, which is
// exactly what we want, because this is a fatal error, and processing
// should stop. If we decrease mPendingInstanceCount, the model would
// finish construction, which is wrong.
nsXFormsUtils::ReportError(NS_LITERAL_STRING("instanceLoadError"), mElement);
nsXFormsUtils::DispatchEvent(mElement, eEvent_LinkException);
} else if (IsComplete()) {
return NS_OK;
}
--mPendingInstanceCount;
if (IsComplete()) {
nsresult rv = FinishConstruction();
if (NS_SUCCEEDED(rv)) {
MaybeNotifyCompletion();