]> git.saurik.com Git - wxWidgets.git/commitdiff
Avoid assert when deleting columns if there is more columns than there are column...
authorRobin Dunn <robin@alldunn.com>
Wed, 21 Mar 2012 16:42:00 +0000 (16:42 +0000)
committerRobin Dunn <robin@alldunn.com>
Wed, 21 Mar 2012 16:42:00 +0000 (16:42 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70955 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/grid.cpp

index 3d79bc7f7c8e7e65cef371cb1a1bc56b112b8595..a199b556e532f931d9f9bdde83646640303519c4 100644 (file)
@@ -1535,7 +1535,8 @@ bool wxGridStringTable::DeleteCols( size_t pos, size_t numCols )
         // the label of the first column had been set it would have only one
         // element and not numCols, so account for it
         int numRemaining = m_colLabels.size() - colID;
-        m_colLabels.RemoveAt( colID, wxMin(numCols, numRemaining) );
+        if (numRemaining > 0)
+            m_colLabels.RemoveAt( colID, wxMin(numCols, numRemaining) );
     }
 
     if ( numCols >= curNumCols )