-// rs_actionblocksremove.cpp
+// actionblocksremove.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// JLH 06/03/2010 Added this text. :-)
//
-#include "rs_actionblocksremove.h"
+#include "actionblocksremove.h"
#include "rs_block.h"
#include "rs_dialogfactory.h"
#include "graphicview.h"
#include "rs_insert.h"
-RS_ActionBlocksRemove::RS_ActionBlocksRemove(RS_EntityContainer & container, GraphicView & graphicView):
- RS_ActionInterface("Remove Block", container, graphicView)
+ActionBlocksRemove::ActionBlocksRemove(RS_EntityContainer & container, GraphicView & graphicView):
+ ActionInterface("Remove Block", container, graphicView)
{
}
-RS_ActionBlocksRemove::~RS_ActionBlocksRemove()
+ActionBlocksRemove::~ActionBlocksRemove()
{
}
-void RS_ActionBlocksRemove::trigger()
+void ActionBlocksRemove::trigger()
{
- RS_DEBUG->print("RS_ActionBlocksRemove::trigger");
+ RS_DEBUG->print("ActionBlocksRemove::trigger");
- if (graphic != NULL)
+ if (graphic)
{
RS_Block * block = RS_DIALOGFACTORY->requestBlockRemovalDialog(graphic->getBlockList());
// list of containers that might refer to the block via inserts:
-// Q3PtrList<RS_EntityContainer> containerList;
QList<RS_EntityContainer *> containerList;
containerList.append(graphic);
RS_BlockList * blkLst = graphic->getBlockList();
- for (uint bi = 0; bi < blkLst->count(); bi++)
+ for(uint bi=0; bi<blkLst->count(); bi++)
containerList.append(blkLst->at(bi));
- if (block != NULL)
+ if (block)
{
-// for (RS_EntityContainer * cont=containerList.first(); cont!=NULL;
-// cont=containerList.next())
- for (int i = 0; i < containerList.size(); i++)
+ for(int i=0; i<containerList.size(); i++)
{
RS_EntityContainer * cont = containerList[i];
// remove all inserts from the graphic:
{
done = true;
- for (RS_Entity * e = cont->firstEntity(RS2::ResolveNone); e != NULL;
- e = cont->nextEntity(RS2::ResolveNone))
+ for(RS_Entity * e=cont->firstEntity(RS2::ResolveNone); e!=NULL;
+ e=cont->nextEntity(RS2::ResolveNone))
+ {
if (e->rtti() == RS2::EntityInsert)
{
RS_Insert * ins = (RS_Insert *)e;
break;
}
}
+ }
}
while (!done);
}
// close all windows that are editing this block:
- if (RS_DIALOGFACTORY != NULL)
+ if (RS_DIALOGFACTORY)
RS_DIALOGFACTORY->closeEditBlockWindow(block);
// Now remove the block from the block list:
RS_DIALOGFACTORY->updateSelectionWidget(container->countSelected());
}
-void RS_ActionBlocksRemove::init(int status)
+void ActionBlocksRemove::init(int status)
{
- RS_ActionInterface::init(status);
+ ActionInterface::init(status);
trigger();
}
-