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=ec12668880de62312f7f09ce27535ef896b0e6ae;hpb=89e127aa3dbd74d3158e6dbe0ca1703420c04395;p=architektonas diff --git a/src/base/rs_insert.cpp b/src/base/rs_insert.cpp index ec12668..3b42e69 100644 --- a/src/base/rs_insert.cpp +++ b/src/base/rs_insert.cpp @@ -3,7 +3,9 @@ // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun // Extensively rewritten and refactored by James L. Hammons -// (C) 2010 Underground Software +// Portions copyright (C) 2001-2003 RibbonSoft +// Copyright (C) 2010 Underground Software +// See the README and GPLv2 files for licensing and warranty information // // JLH = James L. Hammons // @@ -78,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 { @@ -101,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; @@ -126,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; } @@ -192,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 {