Bug 106435 -- handling booleans passed in NPN_SetVariable in backward compatible way, r=peterl, sr=waterson

This commit is contained in:
av%netscape.com 2001-11-06 23:45:01 +00:00
Родитель d0f8c99f93
Коммит 4c8964fbda
1 изменённых файлов: 9 добавлений и 3 удалений

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

@ -1281,13 +1281,19 @@ _setvalue(NPP npp, NPPVariable variable, void *result)
return NPERR_INVALID_INSTANCE_ERROR; return NPERR_INVALID_INSTANCE_ERROR;
switch (variable) { switch (variable) {
// we should keep backward compatibility with 4x where the
// actual pointer value is checked rather than its content
// wnen passing booleans
case NPPVpluginWindowBool: { case NPPVpluginWindowBool: {
NPBool bWindowless = !(*((NPBool *)result)); NPBool bWindowless = (result == nsnull);
return inst->SetWindowless(bWindowless); return inst->SetWindowless(bWindowless);
} }
case NPPVpluginTransparentBool: case NPPVpluginTransparentBool: {
return inst->SetTransparent(*((NPBool *)result)); NPBool bTransparent = (result != nsnull);
return inst->SetTransparent(bTransparent);
}
default: default:
return NPERR_NO_ERROR; return NPERR_NO_ERROR;