wxDataViewIconTextRenderer changed the icon to that of the last item drawn by
it when editing a cell. Fix this by getting the original icon directly from
the model instead of from the last item.
Closes #14187.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71105
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
{
wxTextCtrl *text = (wxTextCtrl*) editor;
- wxDataViewIconText iconText(text->GetValue(), m_value.GetIcon());
+ // The icon can't be edited so get its old value and reuse it.
+ wxVariant valueOld;
+ wxDataViewColumn* const col = GetOwner();
+ GetView()->GetModel()->GetValue(valueOld, m_item, col->GetModelColumn());
+
+ wxDataViewIconText iconText;
+ iconText << valueOld;
+
+ // But replace the text with the value entered by user.
+ iconText.SetText(text->GetValue());
+
value << iconText;
return true;
}