Factor out DoAcceptCellEditControl() into a separate function
This allows to fold the last DoSaveEditControlValue() call into this function, so that it's only called from DoAcceptCellEditControl() or from SaveEditControlValue() (which is public, and hence can't be changed, even if its behaviour doesn't make much sense). This commit means that m_cellEditCtrlEnabled is now reset to false when AcceptCellEditControlIfShown() is called, which was not the case before, but this seems to make sense, as we shouldn't be just hiding the editor while leaving it enabled, and, also, doesn't really seem to change anything as hiding the editor indirectly results in a call to DisableCellEditControl(), via wxGrid::OnHideEditor(), and so it was actually already reset before -- but now this happens slightly earlier and more explicitly.
This commit is contained in:
@@ -2908,8 +2908,11 @@ private:
|
||||
);
|
||||
}
|
||||
|
||||
// Accept the changes in the edit control, if it's currently shown, and
|
||||
// dismiss it.
|
||||
// Accept the changes in the edit control, i.e. save them to the table and
|
||||
// dismiss the editor.
|
||||
void DoAcceptCellEditControl();
|
||||
|
||||
// As above, but do nothing if the control is not currently shown.
|
||||
void AcceptCellEditControlIfShown();
|
||||
|
||||
// Unlike the public SaveEditControlValue(), this method doesn't check if
|
||||
|
Reference in New Issue
Block a user