removed use of model() in LDSubfileReference::inlineContents

Sat, 03 Mar 2018 17:28:27 +0200

author
Santeri Piippo
date
Sat, 03 Mar 2018 17:28:27 +0200
changeset 1262
f6b253c17643
parent 1261
5d2c9d36da9d
child 1263
0256edecda54

removed use of model() in LDSubfileReference::inlineContents

src/lddocument.cpp file | annotate | diff | comparison | revisions
src/linetypes/modelobject.cpp file | annotate | diff | comparison | revisions
src/linetypes/modelobject.h file | annotate | diff | comparison | revisions
src/toolsets/basictoolset.cpp file | annotate | diff | comparison | revisions
src/toolsets/extprogramtoolset.cpp file | annotate | diff | comparison | revisions
--- a/src/lddocument.cpp	Sat Mar 03 17:25:12 2018 +0200
+++ b/src/lddocument.cpp	Sat Mar 03 17:28:27 2018 +0200
@@ -426,7 +426,7 @@
 		// Got another sub-file reference, inline it if we're deep-inlining. If not,
 		// just add it into the objects normally. Yay, recursion!
 		if (deep and object->type() == LDObjectType::SubfileReference)
-			static_cast<LDSubfileReference*>(object)->inlineContents(model, deep, renderinline);
+			static_cast<LDSubfileReference*>(object)->inlineContents(documentManager(), model, deep, renderinline);
 		else
 			model.addFromString(object->asText());
 	}
--- a/src/linetypes/modelobject.cpp	Sat Mar 03 17:25:12 2018 +0200
+++ b/src/linetypes/modelobject.cpp	Sat Mar 03 17:28:27 2018 +0200
@@ -187,9 +187,9 @@
 
 // =============================================================================
 // -----------------------------------------------------------------------------
-void LDSubfileReference::inlineContents(Model& model, bool deep, bool render)
+void LDSubfileReference::inlineContents(DocumentManager* context, Model& model, bool deep, bool render)
 {
-	Model inlined {this->model()->documentManager()};
+	Model inlined {context};
 	fileInfo()->inlineContents(inlined, deep, render);
 
 	// Transform the objects
--- a/src/linetypes/modelobject.h	Sat Mar 03 17:25:12 2018 +0200
+++ b/src/linetypes/modelobject.h	Sat Mar 03 17:28:27 2018 +0200
@@ -237,7 +237,7 @@
 	virtual QString asText() const override;
 	LDDocument* fileInfo() const;
 	virtual void getVertices (QSet<Vertex>& verts) const override;
-	void inlineContents(Model& model, bool deep, bool render);
+	void inlineContents(class DocumentManager* context, Model& model, bool deep, bool render);
 	QList<LDPolygon> inlinePolygons();
 	QString objectListText() const override;
 	void setFileInfo (LDDocument* fileInfo);
--- a/src/toolsets/basictoolset.cpp	Sat Mar 03 17:25:12 2018 +0200
+++ b/src/toolsets/basictoolset.cpp	Sat Mar 03 17:28:27 2018 +0200
@@ -104,7 +104,7 @@
 		if (referenceIndex.isValid())
 		{
 			Model inlined {m_documents};
-			reference->inlineContents(inlined, deep, false);
+			reference->inlineContents(m_documents, inlined, deep, false);
 
 			// Merge in the inlined objects
 			for (LDObject* inlinedObject : inlined.objects())
--- a/src/toolsets/extprogramtoolset.cpp	Sat Mar 03 17:25:12 2018 +0200
+++ b/src/toolsets/extprogramtoolset.cpp	Sat Mar 03 17:28:27 2018 +0200
@@ -156,7 +156,7 @@
 		{
 			LDSubfileReference* ref = static_cast<LDSubfileReference*> (obj);
 			Model model {m_documents};
-			ref->inlineContents(model, true, false);
+			ref->inlineContents(m_documents, model, true, false);
 			writeObjects(model.objects(), f);
 		}
 		else if (obj->type() == LDObjectType::BezierCurve)

mercurial