Fixing GetParameters() back to the way it was, returning success for zero parameters bug 114973 r=av sr=beard a=brendan

This commit is contained in:
peterlubczynski%netscape.com 2001-12-14 03:52:12 +00:00
Родитель 8cc88b14f8
Коммит f96915bc51
3 изменённых файлов: 12 добавлений и 13 удалений

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

@ -2419,13 +2419,12 @@ NS_IMETHODIMP nsPluginInstanceOwner::GetParameters(PRUint16& n, const char*const
nsresult rv = EnsureCachedAttrParamArrays();
NS_ENSURE_SUCCESS(rv, rv);
// make sure we have at least one param tag because embed's don't have any
if (!mNumCachedParams)
return NS_ERROR_FAILURE;
n = mNumCachedParams;
names = (const char **)(mCachedAttrParamNames + mNumCachedAttrs + 1);
values = (const char **)(mCachedAttrParamValues + mNumCachedAttrs + 1);
if (n) {
names = (const char **)(mCachedAttrParamNames + mNumCachedAttrs + 1);
values = (const char **)(mCachedAttrParamValues + mNumCachedAttrs + 1);
} else
names = values = nsnull;
return rv;
}

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

@ -2419,13 +2419,12 @@ NS_IMETHODIMP nsPluginInstanceOwner::GetParameters(PRUint16& n, const char*const
nsresult rv = EnsureCachedAttrParamArrays();
NS_ENSURE_SUCCESS(rv, rv);
// make sure we have at least one param tag because embed's don't have any
if (!mNumCachedParams)
return NS_ERROR_FAILURE;
n = mNumCachedParams;
names = (const char **)(mCachedAttrParamNames + mNumCachedAttrs + 1);
values = (const char **)(mCachedAttrParamValues + mNumCachedAttrs + 1);
if (n) {
names = (const char **)(mCachedAttrParamNames + mNumCachedAttrs + 1);
values = (const char **)(mCachedAttrParamValues + mNumCachedAttrs + 1);
} else
names = values = nsnull;
return rv;
}

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

@ -823,7 +823,8 @@ nsresult ns4xPluginInstance::InitializePlugin(nsIPluginInstancePeer* peer)
const char* const* pvalues = nsnull;
if (NS_SUCCEEDED(taginfo->GetParameters(pcount, pnames, pvalues))) {
NS_ASSERTION(nsnull == values[count], "attribute/parameter array not setup correctly for 4.x plugins");
count += ++pcount; //if it's all setup correctly, then all we need is to change the count
if (pcount)
count += ++pcount; //if it's all setup correctly, then all we need is to change the count (attrs + PARAM/blank + params)
}
}
}