Add helper wxGrid::GetCurrentCellEditorPtr() and use it

No real changes, just simplify the code by using a single function to
retrieve the editor to use for the current cell.

This also allows to get rid of a few temporary variables, further
amplifying the simplification.
This commit is contained in:
Vadim Zeitlin
2020-06-27 15:51:30 +02:00
parent d5e568c2d9
commit ed0f58c2dd
2 changed files with 22 additions and 30 deletions

View File

@@ -2897,6 +2897,17 @@ private:
void SetNativeHeaderColCount();
void SetNativeHeaderColOrder();
// Return the editor which should be used for the current cell.
wxGridCellEditorPtr GetCurrentCellEditorPtr() const
{
return GetCellAttrPtr(m_currentCellCoords)->GetEditorPtr
(
this,
m_currentCellCoords.GetRow(),
m_currentCellCoords.GetCol()
);
}
// Unlike the public SaveEditControlValue(), this method doesn't check if
// the edit control is shown, but just supposes that it is.
void DoSaveEditControlValue();