From f82767ae79a9a0cd2f155664ff2c9e04c6a01d1f Mon Sep 17 00:00:00 2001 From: EvilSpirit Date: Tue, 2 Feb 2016 11:43:41 +0600 Subject: [PATCH] Break the dependency between an imported group and its parent. Per correspondence with Jonathan the dependency serves no useful purpose. It also prevents safely deleting groups preceding imported groups. --- src/file.cpp | 5 +++++ src/group.cpp | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/file.cpp b/src/file.cpp index a404f93..d4aa077 100644 --- a/src/file.cpp +++ b/src/file.cpp @@ -451,6 +451,11 @@ bool SolveSpaceUI::LoadFromFile(const std::string &filename) { char *key = line, *val = e+1; LoadUsingTable(key, val); } else if(strcmp(line, "AddGroup")==0) { + // legacy files have a spurious dependency between imported groups + // and their parent groups, remove + if(sv.g.type == Group::IMPORTED) + sv.g.opA.v = 0; + SK.group.Add(&(sv.g)); sv.g = {}; sv.g.scale = 1; // default is 1, not 0; so legacy files need this diff --git a/src/group.cpp b/src/group.cpp index fa70408..3cf091d 100644 --- a/src/group.cpp +++ b/src/group.cpp @@ -186,7 +186,6 @@ void Group::MenuGroup(int id) { case GraphicsWindow::MNU_GROUP_IMPORT: { g.type = IMPORTED; - g.opA = SS.GW.activeGroup; if(g.impFile.empty()) { if(!GetOpenFile(g.impFile, "", SLVS_PATTERN)) return; }