dabo Commit
Revision 5282
Date: 2009-06-30 10:41:38 -0700 (Tue, 30 Jun 2009)
Author: Paul
Trac: http://trac.dabodev.com/changeset/5282

Changed:
U   trunk/dabo/ui/uiwx/dGrid.py

Log:
Can't reproduce this bug, but added defensive code to keep it from happening
again. Here's the TB I got from my customer:

{{{
Date: Mon, 04 May 2009 07:10:01 -0700

   User Timestamp: 2009-05-04 14:04:37.859000
 Server Timestamp: 2009-05-04 14:04:44.210484
Version, Platform: 0.9.33 Windows-XP-5.1.2600-SP2
 Exception Object: C++ assertion "row >= 0 && row < m_numRows" failed at 
..\..\src\generic\grid.cpp(9838) in wxGrid::GetRowSize(): invalid row index
   Exception Type: <class 'wx._core.PyAssertionError'>
      Active Form: <frmProductionOrders (baseclass dabo.ui.dForm, id:-2713)>
   Active Control: <PageFrame (baseclass dabo.ui.dPageFrame, id:-2716)>

Traceback (most recent call last):
  File "dabo\ui\uiwx\dGrid.pyc", line 3693, in __onWxGridRowSize
  File "dabo\ui\uiwx\dPemMixin.pyc", line 949, in raiseEvent
  File "dabo\lib\eventMixin.pyc", line 93, in raiseEvent
  File "dabo\ui\uiwx\dGrid.pyc", line 3333, in _onGridRowSize
  File "wx\grid.pyc", line 1636, in GetRowSize
<class 'wx._core.PyAssertionError'>: C++ assertion "row >= 0 && row < 
m_numRows" failed at ..\..\src\generic\grid.cpp(9838) in wxGrid::GetRowSize(): 
invalid row index
}}}



Diff:
Modified: trunk/dabo/ui/uiwx/dGrid.py
===================================================================
--- trunk/dabo/ui/uiwx/dGrid.py 2009-06-29 20:37:48 UTC (rev 5281)
+++ trunk/dabo/ui/uiwx/dGrid.py 2009-06-30 17:41:38 UTC (rev 5282)
@@ -3345,10 +3345,12 @@
                the user sized.
                """
                row = evt.EventData["row"]
-               size = self.GetRowSize(row)
+               if row is None or row < 0 or row > self.RowCount:
+                       # pkm: This has happened but I don't know why. Treat as 
spurious.
+                       return
 
                if self.SameSizeRows:
-                       self.RowHeight = size
+                       self.RowHeight = self.GetRowSize(row)
 
 
        def _onGridCellSelected(self, evt):



_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: 
http://leafe.com/archives/byMID/[email protected]

Reply via email to