wxWidgets 2.9 compatibility: Fix for sefault on table editor under GTK
От | Peter Geoghegan |
---|---|
Тема | wxWidgets 2.9 compatibility: Fix for sefault on table editor under GTK |
Дата | |
Msg-id | AANLkTinfFZ4_td8OVhZCDkR8B+ASOgx5Nv1pFkXknuqU@mail.gmail.com обсуждение исходный текст |
Ответы |
Re: wxWidgets 2.9 compatibility: Fix for sefault on table editor
under GTK
Re: wxWidgets 2.9 compatibility: Fix for sefault on table editor under GTK |
Список | pgadmin-hackers |
I should have spotted this one sooner, but I was thrown off by the fact that my sqlGridTextEditor code (inherits wxGridCellTextEditor) compiled without having appropriate EndEdit()/ApplyEdit() signature changes. sqlGridBoolEditor (inherits from wxGridCellEditor), on the other hand, made ApplyEdit and EndEdit() with the new signature pure to avoid this problem. I've reported the inconsistency to wx-users. Attached patch fixes segfault, and makes us consistent with this design principle of 2.9 for grid cells, from wx docs: virtual bool wxGridCellEditor::EndEdit ( int row, int col, const wxGrid * grid, const wxString & oldval, wxString * newval ) [pure virtual] End editing the cell. This function must check if the current value of the editing control is valid and different from the original value (available as oldval in its string form and possibly saved internally using its real type by BeginEdit()). If it isn't, it just returns false, otherwise it must do the following: # Save the new value internally so that ApplyEdit() could apply it. # Fill newval (which is never NULL) with the string representation of the new value. # Return true ****Notice that it must not modify the grid as the change could still be vetoed.**** I've made sqlGridNumericEditor do the same, even though it was ostensibly well behaved before, because changes could still be vetoed before we get to ApplyEdit(). Naturally, 2.8 compatibility is preserved. I've also updated the build shell script to remove contrib/OGL stuff, which we no longer need regardless of wx version. BTW, the comment "// pure virtual in wx 2.9+, doesn't exist in prior versions" isn't currently true for wxGridCellTextEditor inheriting classes, but I left it there in anticipation of it becoming true and for consistency with sqlGridBoolEditor. -- Regards, Peter Geoghegan
Вложения
В списке pgadmin-hackers по дате отправления: