[Spambayes-checkins] spambayes/Outlook2000/dialogs FolderSelector.py, 1.25, 1.26

Mark Hammond mhammond at users.sourceforge.net
Wed Aug 27 00:53:30 EDT 2003


Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs
In directory sc8-pr-cvs1:/tmp/cvs-serv10136

Modified Files:
	FolderSelector.py 
Log Message:
Ensure we only try and use tree items listed as valid by the mask.
Hopefully will stop Tony's crash.


Index: FolderSelector.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/FolderSelector.py,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -d -r1.25 -r1.26
*** FolderSelector.py	27 Aug 2003 04:03:20 -0000	1.25
--- FolderSelector.py	27 Aug 2003 06:53:27 -0000	1.26
***************
*** 196,205 ****
          item_textptr, item_cchText, item_image, item_selimage, \
          item_cChildren, item_param = struct.unpack("10i", buffer)
! 
      if item_textptr:
          text = win32gui.PyGetString(item_textptr)
      else:
          text = None
-     # Todo - translate items without the mask bit set to None
      return item_hItem, item_state, item_stateMask, \
          text, item_image, item_selimage, \
--- 196,212 ----
          item_textptr, item_cchText, item_image, item_selimage, \
          item_cChildren, item_param = struct.unpack("10i", buffer)
!     # ensure only items listed by the mask are valid
!     if not (item_mask & commctrl.TVIF_TEXT): item_textptr = item_cchText = None
!     if not (item_mask & commctrl.TVIF_CHILDREN): item_cChildren = None
!     if not (item_mask & commctrl.TVIF_HANDLE): item_hItem = None
!     if not (item_mask & commctrl.TVIF_IMAGE): item_image = None
!     if not (item_mask & commctrl.TVIF_PARAM): item_param = None
!     if not (item_mask & commctrl.TVIF_SELECTEDIMAGE): item_selimage = None
!     if not (item_mask & commctrl.TVIF_STATE): item_state = item_stateMask = None
!     
      if item_textptr:
          text = win32gui.PyGetString(item_textptr)
      else:
          text = None
      return item_hItem, item_state, item_stateMask, \
          text, item_image, item_selimage, \





More information about the Spambayes-checkins mailing list