| 2859 | } |
| 2860 | |
| 2861 | void SpreadsheetView::flattenColumns() { |
| 2862 | const auto& columns = selectedColumns(); |
| 2863 | if (columns.isEmpty()) |
| 2864 | return; |
| 2865 | |
| 2866 | // ensure all selected columns have the same column mode |
| 2867 | auto mode = columns.at(0)->columnMode(); |
| 2868 | for (auto* col : columns) { |
| 2869 | if (col->columnMode() != mode) { |
| 2870 | KMessageBox::error(this, i18n("The selected columns have different data types and cannot be flattened because of this. ")); |
| 2871 | return; |
| 2872 | } |
| 2873 | } |
| 2874 | |
| 2875 | auto* dlg = new FlattenColumnsDialog(m_spreadsheet, this); |
| 2876 | dlg->setColumns(columns); |
| 2877 | dlg->exec(); |
| 2878 | } |
| 2879 | |
| 2880 | void SpreadsheetView::normalizeSelectedColumns(QAction* action) { |
| 2881 | auto columns = selectedColumns(); |
nothing calls this directly
no test coverage detected