| 793 | } |
| 794 | |
| 795 | void SymbolSetTool::processSymbolSet() |
| 796 | { |
| 797 | // On failure, we exit with translations_complete == false. |
| 798 | auto completeness = translations_complete; |
| 799 | translations_complete = false; |
| 800 | |
| 801 | QFETCH(QString, name); |
| 802 | QFETCH(unsigned int, source_scale); |
| 803 | QFETCH(unsigned int, target_scale); |
| 804 | |
| 805 | QString source_filename = QString::fromLatin1("src/%1_%2.xmap").arg(name, QString::number(source_scale)); |
| 806 | QVERIFY(symbol_set_dir.exists(source_filename)); |
| 807 | |
| 808 | QString source_path = symbol_set_dir.absoluteFilePath(source_filename); |
| 809 | |
| 810 | Map map; |
| 811 | MapView view{ &map }; |
| 812 | map.loadFrom(source_path, &view); |
| 813 | QCOMPARE(map.getScaleDenominator(), source_scale); |
| 814 | QCOMPARE(map.getNumClosedTemplates(), 0); |
| 815 | |
| 816 | auto id = map.symbolSetId(); |
| 817 | QCOMPARE(id, name); |
| 818 | |
| 819 | map.resetPrinterConfig(); |
| 820 | map.undoManager().clear(); |
| 821 | for (int i = 0; i < map.getNumColors(); ++i) |
| 822 | { |
| 823 | auto color = map.getMapColor(i); |
| 824 | if (color->getSpotColorMethod() == MapColor::CustomColor) |
| 825 | { |
| 826 | color->setCmykFromSpotColors(); |
| 827 | color->setRgbFromSpotColors(); |
| 828 | } |
| 829 | else |
| 830 | { |
| 831 | color->setRgbFromCmyk(); |
| 832 | } |
| 833 | } |
| 834 | saveIfDifferent(source_path, &map, &view); |
| 835 | |
| 836 | if (name == QLatin1String("ISSkiOM 2019")) |
| 837 | { |
| 838 | ISSkiOM_2019::mergeISOM(map, symbol_set_dir); |
| 839 | } |
| 840 | |
| 841 | const int num_symbols = map.getNumSymbols(); |
| 842 | QStringList previous_numbers; |
| 843 | for (int i = 0; i < num_symbols; ++i) |
| 844 | { |
| 845 | const Symbol* symbol = map.getSymbol(i); |
| 846 | QString number = symbol->getNumberAsString(); |
| 847 | QString number_and_name = number + QLatin1Char(' ') % symbol->getPlainTextName(); |
| 848 | QVERIFY2(!symbol->getName().isEmpty(), qPrintable(number_and_name + QLatin1String(": Name is empty"))); |
| 849 | QVERIFY2(!previous_numbers.contains(number), qPrintable(number_and_name + QLatin1String(": Number is not unique"))); |
| 850 | previous_numbers.append(number); |
| 851 | QVERIFY2(symbol->validate(), qPrintable(number_and_name + QLatin1String(": Symbol validation failed"))); |
| 852 | if (symbol->getType() == Symbol::Line) |
nothing calls this directly
no test coverage detected