X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b93aafaba964d2ffb70c4afd21689e0cc9e877cd..8b71ebada49b82fd7172f392fc9fb14e3556a38c:/src/generic/grid.cpp diff --git a/src/generic/grid.cpp b/src/generic/grid.cpp index 47fc186875..4a09bd55fd 100644 --- a/src/generic/grid.cpp +++ b/src/generic/grid.cpp @@ -1560,8 +1560,9 @@ void wxGridCellChoiceEditor::BeginEdit(int row, int col, wxGrid* grid) if (m_allowOthers) { Combo()->SetValue(m_startValue); + Combo()->SetInsertionPointEnd(); } - else + else // the combobox is read-only { // find the right position, or default to the first if not found int pos = Combo()->FindString(m_startValue); @@ -1570,7 +1571,6 @@ void wxGridCellChoiceEditor::BeginEdit(int row, int col, wxGrid* grid) Combo()->SetSelection(pos); } - Combo()->SetInsertionPointEnd(); Combo()->SetFocus(); if (evtHandler) @@ -2751,9 +2751,13 @@ void wxGridRowOrColAttrData::SetAttr(wxGridCellAttr *attr, int rowOrCol) int i = m_rowsOrCols.Index(rowOrCol); if ( i == wxNOT_FOUND ) { - // add the attribute - m_rowsOrCols.Add(rowOrCol); - m_attrs.Add(attr); + if ( attr ) + { + // add the attribute + m_rowsOrCols.Add(rowOrCol); + m_attrs.Add(attr); + } + // nothing to remove } else {