]> Shamusworld >> Repos - architektonas/blobdiff - src/base/rs_creation.cpp
Major refactoring of actions: Moved implementation from header files
[architektonas] / src / base / rs_creation.cpp
index fb99b2f25e215529f007e0f334f823d462d950e6..a8a14e078afab4cc2a9b81f35a14e195547a88e4 100644 (file)
 
 #include "rs_creation.h"
 
-#include <QtCore>
 #include "rs_constructionline.h"
 #include "drawing.h"
 #include "rs_graphicview.h"
+#include "rs_image.h"
 #include "rs_information.h"
+#include "rs_insert.h"
 #include "rs_modification.h"
 #include "rs_units.h"
 
@@ -1056,43 +1057,39 @@ RS_Line* RS_Creation::createPolygon2(const Vector& corner1,
     return ret;
 }
 
-
-
 /**
  * Creates an insert with the given data.
  *
  * @param data Insert data (position, block name, ..)
  */
-RS_Insert* RS_Creation::createInsert(RS_InsertData& data) {
-
-    RS_DEBUG->print("RS_Creation::createInsert");
+RS_Insert* RS_Creation::createInsert(RS_InsertData & data)
+{
+       RS_DEBUG->print("RS_Creation::createInsert");
 
-    if (document!=NULL && handleUndo) {
-        document->startUndoCycle();
-    }
+       if (document != NULL && handleUndo)
+               document->startUndoCycle();
 
-    RS_Insert* ins = new RS_Insert(container, data);
-    // inserts are also on layers
-    ins->setLayerToActive();
-    ins->setPenToActive();
+       RS_Insert * ins = new RS_Insert(container, data);
+       // inserts are also on layers
+       ins->setLayerToActive();
+       ins->setPenToActive();
 
-    if (container!=NULL) {
-        container->addEntity(ins);
-    }
-    if (document!=NULL && handleUndo) {
-        document->addUndoable(ins);
-        document->endUndoCycle();
-    }
-    if (graphicView!=NULL) {
-        graphicView->drawEntity(ins);
-    }
+       if (container != NULL)
+               container->addEntity(ins);
 
-    RS_DEBUG->print("RS_Creation::createInsert: OK");
+       if (document != NULL && handleUndo)
+       {
+               document->addUndoable(ins);
+               document->endUndoCycle();
+       }
 
-    return ins;
-}
+       if (graphicView != NULL)
+               graphicView->drawEntity(ins);
 
+       RS_DEBUG->print("RS_Creation::createInsert: OK");
 
+       return ins;
+}
 
 /**
  * Creates an image with the given data.