| 2842 | |
| 2843 | |
| 2844 | void CsvApplication::checkDataConsistency() { |
| 2845 | int row_top, row_bottom, col_top, col_bottom; |
| 2846 | int winIndex = app.getTopWindow(); |
| 2847 | windows[winIndex].grid->get_selection(row_top, col_top, row_bottom, col_bottom); |
| 2848 | if( row_top < 0 || row_bottom < 0 || row_top >= windows[winIndex].table->getNumberRows() || row_bottom >= windows[winIndex].table->getNumberRows() ) { |
| 2849 | myFlChoice("Info", "No column selected!", {"OK"}); |
| 2850 | return; |
| 2851 | } |
| 2852 | // Check data consistency of column in col_top |
| 2853 | showImWorkingWindow("Checking data consistency ..."); |
| 2854 | size_t countInconsistentRows = windows[winIndex].table->flagInconsistentData(col_top); |
| 2855 | hideImWorkingWindow(); |
| 2856 | windows[winIndex].grid->redraw(); |
| 2857 | std::string msg; |
| 2858 | if( countInconsistentRows == 0 ) { |
| 2859 | msg = "No inconsistent rows were found."; |
| 2860 | } else { |
| 2861 | msg = std::to_string(countInconsistentRows) + " inconsistent row(s) were found and flagged."; |
| 2862 | } |
| 2863 | myFlChoice("Info", msg, {"OK"}); |
| 2864 | } |
| 2865 | |
| 2866 | |
| 2867 |
no test coverage detected