Thu, 11 Jan 2018 16:46:22 +0200
add operators to LDDocument
--- a/src/editmodes/magicWandMode.cpp Thu Jan 11 15:41:58 2018 +0200 +++ b/src/editmodes/magicWandMode.cpp Thu Jan 11 16:46:22 2018 +0200 @@ -61,9 +61,15 @@ // Boundary found. If it's an edgeline, add it to the boundaries list, if a // conditional line, select it. if (candidate->type() == OBJ_CondLine) + { m_selection << candidate; + } else - boundaries.append({candidate->vertex(0), candidate->vertex(1)}); + { + boundaries.append(std::make_pair( + candidate->vertex(0), + candidate->vertex(1))); + } break; }
--- a/src/ldDocument.cpp Thu Jan 11 15:41:58 2018 +0200 +++ b/src/ldDocument.cpp Thu Jan 11 16:46:22 2018 +0200 @@ -902,3 +902,11 @@ { m_needVertexMerge = true; } + +LDObject* LDDocument::operator[](int i) const +{ + if (i >= 0 and i < m_objects.size()) + return m_objects[i]; + else + throw std::out_of_range {"bad index"}; +}
--- a/src/ldDocument.h Thu Jan 11 15:41:58 2018 +0200 +++ b/src/ldDocument.h Thu Jan 11 16:46:22 2018 +0200 @@ -100,6 +100,9 @@ static QString shortenName(QString a); // Turns a full path into a relative path + void operator=(const LDDocument&) = delete; + LDObject* operator[](int i) const; + signals: void closed();