widl: Allow specifying a class version outside of a typelib too.

This commit is contained in:
Alexandre Julliard 2010-12-23 12:50:35 +01:00
parent fc3114ca80
commit 90c7acf845
1 changed files with 3 additions and 3 deletions

View File

@ -121,6 +121,7 @@ static int write_coclass( const type_t *class, const typelib_t *typelib )
const char *progid = get_attrp( class->attrs, ATTR_PROGID );
const char *vi_progid = get_attrp( class->attrs, ATTR_VIPROGID );
const char *threading = get_coclass_threading( class );
unsigned int version = get_attrv( class->attrs, ATTR_VERSION );
if (!uuid) return 0;
if (typelib && !threading) return 0;
@ -134,11 +135,10 @@ static int write_coclass( const type_t *class, const typelib_t *typelib )
if (typelib)
{
const UUID *typelib_uuid = get_attrp( typelib->attrs, ATTR_UUID );
unsigned int version = get_attrv( class->attrs, ATTR_VERSION );
if (!version) version = get_attrv( typelib->attrs, ATTR_VERSION );
put_str( indent, "TypeLib = s '%s'\n", format_uuid( typelib_uuid ));
put_str( indent, "Version = s '%u.%u'\n", MAJORVERSION(version), MINORVERSION(version) );
if (!version) version = get_attrv( typelib->attrs, ATTR_VERSION );
}
if (version) put_str( indent, "Version = s '%u.%u'\n", MAJORVERSION(version), MINORVERSION(version) );
if (vi_progid) put_str( indent, "VersionIndependentProgId = s '%s'\n", vi_progid );
put_str( --indent, "}\n" );
return 1;