]> Shamusworld >> Repos - architektonas/blobdiff - src/base/rs_insert.cpp
Still in the middle of fixing preview/snapper rendering...
[architektonas] / src / base / rs_insert.cpp
index a381e5454a4c0ba3844cc04b56ee069b2be8c386..3b42e69f7564b9986cb902f763da88cbe1de9f2e 100644 (file)
@@ -80,21 +80,14 @@ RS_InsertData RS_Insert::getData() const
  */
 RS_Block * RS_Insert::getBlockForInsert()
 {
-       if (block != NULL)
+       if (block)
                return block;
 
        RS_BlockList * blkList;
 
-       if (data.blockSource == NULL)
+       if (!data.blockSource)
        {
-               if (getGraphic() != NULL)
-               {
-                       blkList = getGraphic()->getBlockList();
-               }
-               else
-               {
-                       blkList = NULL;
-               }
+               blkList = (getGraphic() ? getGraphic()->getBlockList() : NULL);
        }
        else
        {
@@ -103,14 +96,14 @@ RS_Block * RS_Insert::getBlockForInsert()
 
        RS_Block * blk = NULL;
 
-       if (blkList != NULL)
-       {
+       if (blkList)
                blk = blkList->find(data.name);
-       }
 
-       if (blk != NULL)
+/*???
+       if (blk)
        {
        }
+*/
 
        block = blk;
 
@@ -128,16 +121,14 @@ void RS_Insert::update()
        RS_DEBUG->print("RS_Insert::update: insertionPoint: %f/%f",
                data.insertionPoint.x, data.insertionPoint.y);
 
-       if (updateEnabled == false)
+       if (!updateEnabled)
                return;
 
        clear();
-
        RS_Block * blk = getBlockForInsert();
 
-       if (blk == NULL)
+       if (!blk)
        {
-               //return NULL;
                RS_DEBUG->print("RS_Insert::update: Block is NULL");
                return;
        }
@@ -194,8 +185,7 @@ void RS_Insert::update()
                                RS_DEBUG->print("RS_Insert::update: move 1");
                                if (fabs(data.scaleFactor.x) > 1.0e-6 && fabs(data.scaleFactor.y) > 1.0e-6)
                                {
-                                       ne->move(data.insertionPoint + Vector(data.spacing.x / data.scaleFactor.x * c,
-                                               data.spacing.y / data.scaleFactor.y * r));
+                                       ne->move(data.insertionPoint + Vector(data.spacing.x / data.scaleFactor.x * c, data.spacing.y / data.scaleFactor.y * r));
                                }
                                else
                                {