| 655 | } |
| 656 | |
| 657 | void Matrix::setData(void* data) { |
| 658 | bool isEmpty = false; |
| 659 | Q_D(Matrix); |
| 660 | switch (d->mode) { |
| 661 | case AbstractColumn::ColumnMode::Double: |
| 662 | if (static_cast<QVector<QVector<double>>*>(data)->isEmpty()) |
| 663 | isEmpty = true; |
| 664 | break; |
| 665 | case AbstractColumn::ColumnMode::Text: |
| 666 | if (static_cast<QVector<QVector<QString>>*>(data)->isEmpty()) |
| 667 | isEmpty = true; |
| 668 | break; |
| 669 | case AbstractColumn::ColumnMode::Integer: |
| 670 | if (static_cast<QVector<QVector<int>>*>(data)->isEmpty()) |
| 671 | isEmpty = true; |
| 672 | break; |
| 673 | case AbstractColumn::ColumnMode::BigInt: |
| 674 | if (static_cast<QVector<QVector<qint64>>*>(data)->isEmpty()) |
| 675 | isEmpty = true; |
| 676 | break; |
| 677 | case AbstractColumn::ColumnMode::Day: |
| 678 | case AbstractColumn::ColumnMode::Month: |
| 679 | case AbstractColumn::ColumnMode::DateTime: |
| 680 | if (static_cast<QVector<QVector<QDateTime>>*>(data)->isEmpty()) |
| 681 | isEmpty = true; |
| 682 | break; |
| 683 | } |
| 684 | |
| 685 | if (!isEmpty) |
| 686 | exec(new MatrixReplaceValuesCmd(d, data)); |
| 687 | } |
| 688 | |
| 689 | QVector<AspectType> Matrix::dropableOn() const { |
| 690 | auto vec = AbstractPart::dropableOn(); |