Update of /cvsroot/pywin32/pywin32/com/win32com/server
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32738
Modified Files:
policy.py
Log Message:
Fix [ 1457673 ] dispids can go wrong when using typelibs
(by allowing existing dispids to be reused)
Index: policy.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32com/server/policy.py,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -d -r1.21 -r1.22
*** policy.py 8 Jun 2005 05:19:03 -0000 1.21
--- policy.py 22 Sep 2006 13:31:27 -0000 1.22
***************
*** 510,514 ****
self._dispid_to_func_[DISPID_EVALUATE] = '_Evaluate'
! dispid = self._allocnextdispid(999)
# note: funcs have precedence over attrs (install attrs first)
if hasattr(ob, '_public_attrs_'):
--- 510,514 ----
self._dispid_to_func_[DISPID_EVALUATE] = '_Evaluate'
! next_dispid = self._allocnextdispid(999)
# note: funcs have precedence over attrs (install attrs first)
if hasattr(ob, '_public_attrs_'):
***************
*** 518,531 ****
readonly = [ ]
for name in ob._public_attrs_:
! self._name_to_dispid_[string.lower(name)] = dispid
self._dispid_to_get_[dispid] = name
if name not in readonly:
self._dispid_to_put_[dispid] = name
- dispid = self._allocnextdispid(dispid)
for name in getattr(ob, "_public_methods_", []):
! if not self._name_to_dispid_.has_key(string.lower(name)):
! self._name_to_dispid_[string.lower(name)] = dispid
! self._dispid_to_func_[dispid] = name
! dispid = self._allocnextdispid(dispid)
self._typeinfos_ = None # load these on demand.
--- 518,536 ----
readonly = [ ]
for name in ob._public_attrs_:
! dispid = self._name_to_dispid_.get(name.lower())
! if dispid is None:
! dispid = next_dispid
! self._name_to_dispid_[name.lower()] = dispid
! next_dispid = self._allocnextdispid(next_dispid)
self._dispid_to_get_[dispid] = name
if name not in readonly:
self._dispid_to_put_[dispid] = name
for name in getattr(ob, "_public_methods_", []):
! dispid = self._name_to_dispid_.get(name.lower())
! if dispid is None:
! dispid = next_dispid
! self._name_to_dispid_[name.lower()] = dispid
! next_dispid = self._allocnextdispid(next_dispid)
! self._dispid_to_func_[dispid] = name
self._typeinfos_ = None # load these on demand.
|