X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fbase%2Frs_insert.cpp;h=3b42e69f7564b9986cb902f763da88cbe1de9f2e;hb=bd2b29c8735d83ab48df13c3efee53f63570473e;hp=a381e5454a4c0ba3844cc04b56ee069b2be8c386;hpb=865303923fcb231a171992b75a73364ff469ff8c;p=architektonas diff --git a/src/base/rs_insert.cpp b/src/base/rs_insert.cpp index a381e54..3b42e69 100644 --- a/src/base/rs_insert.cpp +++ b/src/base/rs_insert.cpp @@ -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 {