diff -r 6a875faebde2 -r dc33f8a707c4 src/ldrawalgorithm.cpp --- a/src/ldrawalgorithm.cpp Sun Jun 26 20:27:04 2022 +0300 +++ b/src/ldrawalgorithm.cpp Sun Jun 26 20:54:09 2022 +0300 @@ -17,18 +17,12 @@ return result; } -/** - * @brief Modifies the !LDRAW_ORG line so that it becomes unofficial - */ -/* -void ldraw::makeUnofficial(ModelEditor& editor) +std::vector ldraw::makeUnofficial(const Model* model) { - if (editor.model().size() >= 4) - { - const ldraw::Object* ldrawOrgLine = editor.model()[3]; - if (isA(ldrawOrgLine)) - { - const QString& body = ldrawOrgLine->getProperty(); + std::vector actions; + if (model->size() >= 4) { + if (const Comment* comment = std::get_if(&(*model)[3])) { + const QString& body = comment->text; if (body.startsWith("!LDRAW_ORG ") and not body.startsWith("!LDRAW_ORG Unofficial_")) { // Add Unofficial_ to part type @@ -40,12 +34,15 @@ tokens.removeAt(3); tokens.removeAt(2); } - editor.setObjectProperty(ldrawOrgLine->id, tokens.join(" ")); + actions.push_back(ModifyModel{ + .position = 3, + .newElement = Comment{.text = tokens.join(" ")} + }); } } } + return actions; } -*/ ModelElement inverted(const ModelElement& element) {