src/ldtypes.cpp

changeset 409
8da2563c645a
parent 402
ec95fc95e5f3
child 418
c435027ee5cd
--- a/src/ldtypes.cpp	Tue Jul 30 21:31:36 2013 +0300
+++ b/src/ldtypes.cpp	Thu Aug 01 02:33:07 2013 +0300
@@ -196,7 +196,7 @@
 	assert (idx != -1);
 	
 	// Replace the instance of the old object with the new object
-	LDOpenFile::current()->setObject (idx, other);
+	LDFile::current()->setObject (idx, other);
 	
 	// Remove the old object
 	delete this;
@@ -206,14 +206,14 @@
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 // =============================================================================
 void LDObject::swap (LDObject* other) {
-	for (LDObject*& obj : *LDOpenFile::current()) {
+	for (LDObject*& obj : *LDFile::current()) {
 		if (obj == this)
 			obj = other;
 		elif (obj == other)
 			obj = this;
 	}
 
-	LDOpenFile::current()->addToHistory (new SwapHistory (id(), other->id()));
+	LDFile::current()->addToHistory (new SwapHistory (id(), other->id()));
 }
 
 LDLineObject::LDLineObject (vertex v1, vertex v2) {
@@ -361,7 +361,7 @@
 		const long idx = obj->getIndex(),
 			target = idx + (up ? -1 : 1);
 		
-		if ((up && idx == 0) || (!up && idx == (long) (LDOpenFile::current()->objs().size() - 1))) {
+		if ((up && idx == 0) || (!up && idx == (long) (LDFile::current()->objs().size() - 1))) {
 			// One of the objects hit the extrema. If this happens, this should be the first
 			// object to be iterated on. Thus, nothing has changed yet and it's safe to just
 			// abort the entire operation.
@@ -370,9 +370,9 @@
 		}
 		
 		objsToCompile << obj;
-		objsToCompile << LDOpenFile::current()->obj (target);
+		objsToCompile << LDFile::current()->obj (target);
 		
-		obj->swap (LDOpenFile::current()->obj (target));
+		obj->swap (LDFile::current()->obj (target));
 	}
 	
 	objsToCompile.makeUnique();
@@ -445,10 +445,10 @@
 	long idx = getIndex();
 	assert (idx != -1);
 	
-	if (idx == (long) LDOpenFile::current()->numObjs() - 1)
+	if (idx == (long) LDFile::current()->numObjs() - 1)
 		return null;
 	
-	return LDOpenFile::current()->obj (idx + 1);
+	return LDFile::current()->obj (idx + 1);
 }
 
 // =============================================================================
@@ -459,7 +459,7 @@
 	if (idx == 0)
 		return null;
 	
-	return LDOpenFile::current()->obj (idx - 1);
+	return LDFile::current()->obj (idx - 1);
 }
 
 // =============================================================================
@@ -564,7 +564,7 @@
 		
 		if (bfc && bfc->type == LDBFCObject::InvertNext) {
 			// This is prefixed with an invertnext, thus remove it.
-			LDOpenFile::current()->forgetObject (bfc);
+			LDFile::current()->forgetObject (bfc);
 			delete bfc;
 			return;
 		}
@@ -572,7 +572,7 @@
 	
 	// Not inverted, thus prefix it with a new invertnext.
 	LDBFCObject* bfc = new LDBFCObject (LDBFCObject::InvertNext);
-	LDOpenFile::current()->insertObj (idx, bfc);
+	LDFile::current()->insertObj (idx, bfc);
 }
 
 static void invertLine (LDObject* line) {
@@ -638,7 +638,7 @@
 		*ptr = val;
 		str after = obj->raw();
 		
-		LDOpenFile::current()->addToHistory (new EditHistory (idx, before, after));
+		LDFile::current()->addToHistory (new EditHistory (idx, before, after));
 	} else
 		*ptr = val;
 }

mercurial