MCPcopy Create free account
hub / github.com/GeoDaCenter/geoda / SetCellFromString

Method SetCellFromString

DataViewer/OGRTable.cpp:1227–1252  ·  view source on GitHub ↗

Note: Aditionally, must check that all numbers are valid and set undefined flag appropriately. Also, this method should only be called by wxGrid since we automatically compute the correct row.

Source from the content-addressed store, hash-verified

1225// method should only be called by wxGrid since we automatically
1226// compute the correct row.
1227bool OGRTable::SetCellFromString(int row, int col, int time,
1228 const wxString &value)
1229{
1230 // NOTE: if called from wxGrid, must use row_order[row] to permute
1231 is_set_cell_from_string_fail = false;
1232 if (row<0 || row>=rows) return false;
1233 if (col<0 || col>=GetNumberCols()) return false;
1234
1235 int t_col = FindOGRColId(col, time);
1236 if (t_col == -1) {
1237 return false;
1238 } else {
1239 if (table_state->GetNumDisallowGroupModify(GetColName(col)) > 0) {
1240 is_set_cell_from_string_fail = true;
1241 set_cell_from_string_fail_msg =
1242 table_state->GetDisallowGroupModifyMsg(GetColName(col));
1243 return false;
1244 }
1245 }
1246 operations_queue.push(new OGRTableOpUpdateCell(columns[t_col], row, value));
1247 columns[t_col]->SetValueAt(row, value, m_wx_encoding);
1248 SetChangedSinceLastSave(true);
1249 table_state->SetColDataChangeEvtTyp(GetColName(col), col);
1250 table_state->notifyObservers();
1251 return true;
1252}
1253
1254int OGRTable::InsertCol(GdaConst::FieldType type,
1255 const wxString& name,

Callers 1

SetValueMethod · 0.80

Calls 6

pushMethod · 0.80
SetValueAtMethod · 0.45
notifyObserversMethod · 0.45

Tested by

no test coverage detected