| 1159 | } |
| 1160 | |
| 1161 | void ChildFrame::RedrawHistoryView() { |
| 1162 | history_view_->DeleteAllItems(); |
| 1163 | |
| 1164 | if (splitter_->GetWindow2() != history_view_) { |
| 1165 | return; |
| 1166 | } |
| 1167 | |
| 1168 | auto* doc = GetDoc(); |
| 1169 | if (doc == nullptr) { |
| 1170 | return; |
| 1171 | } |
| 1172 | const auto* mdf_file = doc->GetFile(); |
| 1173 | if (mdf_file == nullptr) { |
| 1174 | return; |
| 1175 | } |
| 1176 | |
| 1177 | const auto* header = mdf_file->Header(); |
| 1178 | if (header == nullptr) { |
| 1179 | return; |
| 1180 | } |
| 1181 | |
| 1182 | const auto history_list = header->FileHistories(); |
| 1183 | |
| 1184 | |
| 1185 | long line = 0; |
| 1186 | for (const auto* history : history_list) { |
| 1187 | if (history == nullptr) { |
| 1188 | continue; |
| 1189 | } |
| 1190 | std::ostringstream date_time; |
| 1191 | date_time << util::time::NsToLocalDate(history->Time()) << " " |
| 1192 | << util::time::NsToLocalTime(history->Time(), 0); |
| 1193 | const auto index = history_view_->InsertItem(line, wxString::FromUTF8(date_time.str())); |
| 1194 | history_view_->SetItem(index, 1, wxString::FromUTF8(history->UserName())); |
| 1195 | history_view_->SetItem(index, 2, wxString::FromUTF8(history->Description())); |
| 1196 | history_view_->SetItem(index, 3, wxString::FromUTF8(history->ToolName())); |
| 1197 | history_view_->SetItem(index, 4, wxString::FromUTF8(history->ToolVendor())); |
| 1198 | history_view_->SetItem(index, 5, wxString::FromUTF8(history->ToolVersion())); |
| 1199 | ++line; |
| 1200 | } |
| 1201 | } |
| 1202 | |
| 1203 | void ChildFrame::RedrawMeasurementView() { |
| 1204 | measurement_view_->DeleteAllItems(); |
nothing calls this directly
no test coverage detected