Ilya Sinitsyn
e2bd6ec8f7
Fix clearing selection in a grid with reordered columns
...
Since the changes of 04f7f1fd32
(frozen
rows/columns implementation), RefreshBlock() could call GetColPos() with
an invalid index. This didn't matter most of the time as the function
simply returned the same index as long as the columns were using their
natural order, but resulted in a crash due to an out of bound access to
m_colAt array as soon as they were reordered.
Fix this by avoiding using invalid indices in RefreshBlock() and, more
generally, improving its precondition check and making the assumptions
about the input parameters more clear. Also add a defensive check to
GetColPos() itself.
Finally, add a unit test exercising this code.
Closes https://github.com/wxWidgets/wxWidgets/pull/1536
2019-09-10 19:41:45 +02:00
..
2019-01-28 00:34:34 +01:00
2019-04-05 09:48:35 -07:00
2018-12-06 03:30:55 +01:00
2019-09-10 19:41:45 +02:00
2019-08-28 09:37:49 -07:00
2019-08-28 09:37:49 -07:00
2019-07-20 17:01:30 +02:00
2016-11-29 19:32:40 +01:00
2019-06-19 18:15:57 +02:00
2019-09-07 14:57:54 +02:00
2019-08-20 11:14:10 +02:00
2018-04-29 19:51:10 +02:00
2019-09-06 20:59:59 +02:00
2019-08-27 22:21:01 +02:00
2016-02-07 01:11:25 +02:00
2019-07-16 20:19:33 +02:00
2019-06-04 23:23:04 +02:00
2019-06-20 16:06:36 +02:00
2019-07-13 12:23:06 -05:00
2019-06-19 18:15:57 +02:00
2019-08-28 09:37:49 -07:00
2019-08-28 09:37:49 -07:00
2017-05-30 14:31:59 +02:00
2019-07-31 23:57:40 +02:00
2019-04-22 14:12:05 +02:00
2019-08-25 15:26:13 +02:00
2016-10-03 20:43:00 +02:00
2015-03-20 00:08:37 +01:00
2018-08-27 21:13:04 +02:00
2014-03-30 00:02:23 +00:00
2012-01-09 14:04:25 +00:00
2014-05-16 13:01:29 +00:00
2014-03-30 00:02:23 +00:00
2018-08-27 21:13:04 +02:00
2013-07-26 16:02:46 +00:00
2019-02-25 10:23:35 -08:00
2018-07-21 14:42:06 +02:00
2014-05-15 22:32:17 +00:00
2019-01-30 17:35:54 +01:00
2015-04-08 13:02:13 +02:00
2018-05-18 18:49:00 -06:00
2015-04-23 22:00:35 +04:00
2018-06-03 17:12:12 +02:00
2018-07-21 16:16:32 +02:00
2015-08-09 01:39:41 +02:00
2014-03-03 07:04:37 +00:00
2018-08-27 21:13:04 +02:00
2016-02-23 17:11:27 +01:00
2014-05-16 13:01:29 +00:00
2018-09-24 00:11:31 +02:00
2018-04-17 22:32:25 +02:00
2018-08-27 21:13:04 +02:00
2018-09-18 00:33:59 +02:00
2014-08-24 01:50:11 +00:00
2017-10-28 15:07:35 +02:00
2018-07-09 00:40:55 +02:00
2014-10-24 23:23:10 +00:00
2019-09-06 20:59:59 +02:00
2018-08-27 21:13:04 +02:00
2013-07-26 16:02:46 +00:00
2017-12-06 03:23:26 +01:00
2018-01-07 22:43:24 +01:00
2014-08-24 01:50:11 +00:00
2013-07-26 16:02:46 +00:00
2015-09-23 00:52:30 +02:00
2019-07-12 21:06:59 +02:00
2013-10-15 16:12:46 +00:00
2015-09-23 00:52:30 +02:00
2018-03-31 01:45:05 +02:00
2015-04-23 22:00:35 +04:00
2018-07-21 16:16:32 +02:00
2019-04-21 01:53:14 +02:00
2019-04-22 14:12:05 +02:00
2017-02-20 17:53:04 +01:00
2015-04-23 22:00:35 +04:00
2015-06-21 02:24:50 +02:00
2015-09-23 00:52:42 +02:00
2018-10-21 16:45:24 +02:00
2019-04-21 01:53:14 +02:00
2019-04-21 02:09:42 +02:00
2015-11-02 23:19:16 +01:00
2019-08-23 22:55:05 +02:00
2015-09-06 17:20:42 -07:00
2014-03-30 00:02:23 +00:00
2016-08-27 17:45:12 +02:00
2018-07-25 14:11:17 +02:00
2015-04-23 22:00:35 +04:00
2014-05-15 23:56:58 +00:00
2019-03-18 18:29:19 +01:00
2019-06-20 01:44:27 +02:00
2014-03-30 00:02:23 +00:00
2019-04-22 14:12:05 +02:00
2013-07-26 16:02:46 +00:00
2018-07-21 14:42:06 +02:00
2017-01-14 00:25:35 +01:00
2014-11-11 07:50:33 +00:00
2014-07-24 10:58:47 +00:00
2019-02-02 15:54:21 +01:00
2018-08-27 21:13:04 +02:00
2019-04-22 14:12:05 +02:00
2019-04-22 14:12:05 +02:00
2019-02-25 10:23:35 -08:00
2013-07-26 16:02:46 +00:00
2013-07-26 16:02:46 +00:00
2019-04-18 16:34:38 +02:00
2019-01-30 17:35:54 +01:00
2015-04-23 22:00:35 +04:00
2019-07-07 03:14:21 +02:00
2015-04-23 22:00:35 +04:00
2014-03-30 00:02:23 +00:00
2015-04-23 22:00:35 +04:00
2013-07-26 16:02:46 +00:00
2015-04-23 22:00:35 +04:00
2019-08-21 22:33:36 +02:00
2013-07-26 16:02:46 +00:00
2019-06-10 13:57:45 +02:00
2019-04-22 14:12:05 +02:00
2019-08-24 22:30:11 +02:00
2016-12-01 14:06:43 +01:00
2016-09-25 13:21:28 -07:00
2017-11-21 13:49:21 +01:00
2013-07-26 16:02:46 +00:00
2016-01-05 01:29:19 +01:00
2019-01-04 14:09:56 +01:00
2018-08-27 21:13:04 +02:00
2016-09-14 18:45:12 +09:00
2014-08-24 01:50:11 +00:00
2015-04-23 22:00:35 +04:00
2018-05-30 13:06:20 +02:00
2014-08-24 01:50:11 +00:00
2018-08-27 21:13:04 +02:00
2018-11-10 12:17:53 +01:00
2014-05-15 23:56:58 +00:00
2013-07-26 16:02:46 +00:00
2018-08-27 21:13:04 +02:00
2015-04-23 22:00:35 +04:00
2014-05-15 23:56:58 +00:00
2017-02-23 19:20:20 +02:00
2019-08-27 12:59:56 +02:00
2013-07-26 16:02:46 +00:00
2018-08-03 02:33:06 +03:00
2014-08-24 01:50:11 +00:00
2013-07-26 16:02:46 +00:00
2015-09-23 00:52:30 +02:00
2015-09-23 00:52:30 +02:00
2017-04-01 18:43:13 +02:00
2018-07-21 16:16:32 +02:00
2019-08-04 19:15:39 +02:00
2017-10-01 10:03:48 -07:00
2019-07-16 19:59:48 +02:00
2017-09-04 22:38:23 +02:00
2015-04-23 22:00:35 +04:00
2019-08-25 00:48:39 +02:00
2018-05-30 13:06:20 +02:00
2019-02-25 10:23:35 -08:00
2013-07-26 16:02:46 +00:00
2013-07-26 16:02:46 +00:00
2019-08-25 22:01:14 +02:00
2015-04-23 22:00:35 +04:00
2015-09-23 00:52:30 +02:00
2013-07-26 16:02:46 +00:00
2017-11-13 22:29:29 +01:00
2016-09-25 13:21:28 -07:00
2017-10-21 22:10:35 +02:00
2019-09-05 23:14:25 +02:00
2016-06-07 14:29:52 +02:00
2015-04-23 22:00:35 +04:00
2014-03-30 00:02:23 +00:00
2014-03-30 00:02:23 +00:00
2019-06-10 18:07:57 +02:00
2013-07-26 16:02:46 +00:00
2018-07-31 13:20:17 +02:00
2016-01-31 20:11:06 +01:00
2018-12-20 23:36:51 +01:00
2018-10-08 13:04:38 +02:00
2015-04-23 22:00:35 +04:00
2017-06-15 17:48:23 +02:00
2014-03-30 00:02:23 +00:00
2017-01-16 03:25:49 +01:00
2019-02-02 21:22:19 +01:00
2013-07-26 16:02:46 +00:00
2018-09-22 14:44:07 +02:00
2018-06-03 22:47:04 +02:00
2019-01-04 23:51:31 +01:00
2014-03-30 00:02:23 +00:00
2019-01-20 13:22:50 +01:00
2015-09-23 00:52:30 +02:00
2015-04-23 22:00:35 +04:00
2013-07-26 16:02:46 +00:00
2016-02-21 20:12:11 +02:00
2015-09-06 17:20:42 -07:00
2018-11-05 19:35:44 +01:00
2018-09-24 00:11:31 +02:00
2017-05-20 17:01:59 +02:00
2016-09-14 18:45:12 +09:00
2015-04-23 22:00:35 +04:00
2016-01-31 02:22:55 +01:00
2018-02-16 16:28:33 +01:00
2015-04-23 22:00:35 +04:00
2015-04-23 22:00:35 +04:00
2018-10-30 16:28:07 +01:00
2015-04-23 22:00:35 +04:00
2015-04-23 22:00:35 +04:00
2015-04-23 22:00:35 +04:00
2015-04-23 22:00:35 +04:00
2015-04-23 22:00:35 +04:00
2015-04-23 22:00:35 +04:00
2014-06-02 01:15:11 +00:00
2017-03-11 03:41:23 +01:00
2017-07-16 15:03:22 +02:00
2013-07-26 16:02:46 +00:00
2013-07-26 16:02:46 +00:00
2013-07-26 16:02:46 +00:00
2015-04-23 22:00:35 +04:00
2016-04-17 17:36:20 +02:00
2013-07-26 16:02:46 +00:00
2014-08-24 01:50:11 +00:00
2019-01-30 17:35:54 +01:00
2014-04-20 12:44:57 +00:00
2015-04-23 22:00:35 +04:00
2013-07-26 16:02:46 +00:00
2013-07-26 16:02:46 +00:00
2019-02-17 18:26:17 -08:00
2019-08-05 13:46:15 +02:00
2015-04-23 22:00:35 +04:00
2017-10-21 22:10:35 +02:00
2016-02-01 13:48:48 +01:00
2013-07-26 16:02:46 +00:00
2019-07-08 10:04:14 +02:00
2018-07-21 16:16:32 +02:00
2018-04-06 15:39:55 +02:00
2018-11-05 19:27:53 +01:00
2013-07-26 16:02:46 +00:00
2019-06-26 18:04:16 +02:00
2016-02-01 13:48:48 +01:00
2013-07-26 16:02:46 +00:00
2016-01-16 10:55:01 -08:00
2016-09-25 13:21:28 -07:00
2019-01-30 17:35:54 +01:00
2017-10-08 10:38:54 +02:00
2017-05-02 23:30:30 +02:00
2016-03-05 03:09:59 +01:00
2014-08-24 01:50:11 +00:00
2016-09-14 18:45:12 +09:00
2015-04-23 22:00:35 +04:00
2015-04-23 22:00:35 +04:00
2017-05-28 23:56:46 -07:00
2014-10-25 18:06:36 +00:00
2017-11-04 16:19:06 +01:00
2013-07-26 16:02:46 +00:00
2015-04-23 22:00:35 +04:00
2019-04-22 14:12:05 +02:00
2017-11-06 02:05:40 +01:00
2018-04-18 15:45:42 +02:00
2019-04-22 14:12:05 +02:00
2013-07-26 16:02:46 +00:00
2011-01-19 10:47:57 +00:00
2016-09-14 18:45:12 +09:00
2019-01-04 21:37:27 +01:00
2017-09-09 23:34:50 +02:00
2014-05-15 23:56:58 +00:00
2014-08-24 01:50:11 +00:00
2014-03-30 00:02:23 +00:00
2015-04-23 22:00:35 +04:00
2017-11-05 16:42:20 +01:00
2017-09-12 09:51:53 -07:00
2014-05-15 22:32:17 +00:00
2016-06-09 15:24:44 +02:00
2019-08-07 12:05:13 +02:00
2017-02-20 17:46:45 +01:00
2019-04-02 18:13:27 +02:00
2013-07-26 16:02:46 +00:00
2019-04-22 14:12:05 +02:00
2015-11-22 10:16:01 +01:00
2014-08-24 01:50:11 +00:00
2015-04-23 22:00:35 +04:00
2018-05-23 17:52:31 +02:00
2015-04-23 22:00:35 +04:00
2015-12-30 18:54:35 +01:00
2013-07-26 16:02:46 +00:00
2013-07-26 16:02:46 +00:00
2013-07-26 16:02:46 +00:00
2015-04-23 22:00:35 +04:00
2014-08-24 01:50:11 +00:00
2014-08-24 01:50:11 +00:00
2013-07-26 16:02:46 +00:00
2019-01-30 17:35:54 +01:00
2017-04-30 21:42:41 +02:00
2013-07-26 16:02:46 +00:00
2019-08-25 12:32:51 +02:00
2016-09-25 13:21:28 -07:00
2019-08-10 13:42:04 +02:00
2018-01-20 16:53:13 +01:00
2013-07-26 16:02:46 +00:00
2016-07-13 23:33:23 +02:00
2013-07-26 16:02:46 +00:00
2018-03-06 23:31:01 +01:00
2015-04-23 22:00:35 +04:00
2014-03-30 00:02:23 +00:00
2016-09-14 18:45:12 +09:00
2016-09-14 18:45:12 +09:00
2016-02-21 20:12:11 +02:00
2016-09-25 13:21:28 -07:00
2019-07-16 18:01:36 +02:00
2017-07-17 18:26:20 +02:00
2014-09-27 23:29:32 +00:00
2019-07-15 00:00:20 +02:00
2018-04-06 15:39:39 +02:00
2013-07-26 16:02:46 +00:00
2019-02-17 22:42:26 -08:00
2018-03-31 01:45:05 +02:00
2019-09-06 20:59:59 +02:00
2016-02-21 20:12:11 +02:00
2013-07-26 16:02:46 +00:00
2017-08-15 19:34:54 +02:00
2014-07-02 13:28:42 +00:00
2015-04-23 22:00:35 +04:00
2015-04-23 22:00:35 +04:00
2013-07-26 16:02:46 +00:00
2014-01-04 20:07:33 +00:00
2018-01-30 02:03:48 +01:00
2019-04-22 14:12:05 +02:00
2011-03-30 14:16:04 +00:00
2019-04-22 14:12:05 +02:00
2016-01-20 18:55:14 +01:00
2018-01-18 23:28:16 +01:00
2014-08-24 01:50:11 +00:00
2019-06-19 18:15:57 +02:00
2014-08-24 01:50:11 +00:00
2019-04-22 14:12:05 +02:00
2014-03-30 00:02:23 +00:00
2013-07-26 16:02:46 +00:00
2014-01-04 20:07:33 +00:00
2019-04-21 20:04:52 +02:00
2015-04-23 22:00:35 +04:00
2019-08-25 23:08:59 -07:00
2014-05-16 13:01:29 +00:00
2017-06-22 15:55:24 +02:00
2019-03-09 01:14:31 +01:00
2013-07-26 16:02:46 +00:00
2019-05-26 23:20:21 +02:00
2015-04-23 22:00:35 +04:00
2018-08-27 21:13:04 +02:00
2017-06-21 22:51:57 +04:00
2018-04-18 15:45:42 +02:00
2018-09-22 14:44:07 +02:00
2016-06-09 16:48:01 +02:00
2017-06-29 17:17:01 +02:00
2019-07-19 21:06:10 +02:00
2013-07-26 16:02:46 +00:00
2019-04-22 14:12:05 +02:00
2016-02-13 13:46:25 +01:00
2014-03-30 00:02:23 +00:00
2015-05-09 19:22:28 +02:00
2016-02-21 20:12:11 +02:00
2016-02-21 20:12:11 +02:00
2014-05-16 13:01:06 +00:00
2013-07-26 16:02:46 +00:00
2019-07-14 14:10:55 +02:00
2015-01-16 02:39:14 +00:00
2015-09-06 17:20:42 -07:00
2015-04-23 22:00:35 +04:00
2014-10-20 15:08:09 +00:00
2016-02-21 20:12:31 +02:00
2018-12-05 17:23:57 +01:00
2014-08-24 01:50:11 +00:00
2019-08-22 14:01:34 +02:00
2013-07-26 16:02:46 +00:00
2018-12-23 17:33:49 +01:00
2018-06-20 13:52:50 +02:00
2018-09-18 00:33:59 +02:00
2019-02-05 13:23:12 +00:00
2018-08-27 21:13:04 +02:00
2017-11-09 23:49:59 +01:00
2019-03-19 02:12:01 +01:00
2018-01-07 22:43:24 +01:00
2016-05-23 03:00:49 +02:00
2019-04-26 03:20:38 +02:00
2016-02-13 04:01:27 +01:00
2016-02-07 01:11:25 +02:00
2016-03-01 16:01:39 +09:00
2019-07-26 17:59:47 +02:00
2015-04-23 22:00:35 +04:00
2019-04-04 10:56:14 -07:00
2019-04-18 16:47:02 +02:00
2019-01-05 23:33:35 +01:00
2019-02-25 10:23:35 -08:00
2019-01-30 17:35:54 +01:00
2019-03-21 02:44:27 +01:00
2018-12-10 19:06:18 +01:00
2019-02-25 10:23:35 -08:00
2013-07-26 16:02:46 +00:00
2015-04-23 22:00:35 +04:00
2009-08-21 10:41:26 +00:00
2013-07-26 16:02:46 +00:00
2015-11-22 10:14:29 +01:00
2016-11-29 19:32:40 +01:00
2018-08-22 20:02:42 +02:00
2014-03-30 00:02:23 +00:00
2014-03-30 00:02:23 +00:00
2014-03-30 00:02:23 +00:00
2019-08-21 19:30:07 +02:00
2013-07-26 16:02:46 +00:00
2016-09-14 18:45:12 +09:00
2013-07-26 16:02:46 +00:00
2018-08-27 21:13:04 +02:00
2018-12-20 23:36:51 +01:00
2019-04-22 14:12:05 +02:00
2013-07-26 16:02:46 +00:00
2013-07-26 16:02:46 +00:00
2018-08-22 08:12:11 -07:00
2017-10-27 20:13:04 +02:00
2017-02-20 15:55:47 +01:00
2013-07-26 16:02:46 +00:00
2014-05-16 13:01:23 +00:00
2018-01-21 16:49:26 +01:00
2013-07-26 16:02:46 +00:00
2014-05-15 23:56:58 +00:00
2019-01-30 17:35:54 +01:00
2019-01-30 17:35:54 +01:00
2013-07-26 16:02:46 +00:00
2013-07-26 16:02:46 +00:00
2019-01-30 17:35:54 +01:00
2019-01-30 17:35:54 +01:00
2019-01-30 17:35:54 +01:00
2019-01-30 17:35:54 +01:00
2018-08-05 14:21:50 +02:00
2016-01-16 10:55:01 -08:00