Source Code (Use browser search to find items of interest.)
Class Index
killustrator'AddLineSegmentCmd (./koffice/killustrator/share/AddLineSegmentCmd.h:35)
class AddLineSegmentCmd : public Command {
public:
AddLineSegmentCmd (GDocument* doc, GPolyline* obj, int idx,
QList<Coord>& pnts);
~AddLineSegmentCmd ();
void execute ();
void unexecute ();
private:
GDocument* document;
GPolyline* line;
int index;
QList<Coord> points;
};
killustrator'AddLineSegmentCmd::AddLineSegmentCmd() (./koffice/killustrator/share/AddLineSegmentCmd.cc:31)
AddLineSegmentCmd::AddLineSegmentCmd (GDocument* doc, GPolyline* obj,
int idx, QList<Coord>& pnts)
: Command(i18n("Add Line Segment"))
{
document = doc;
line = obj;
line->ref ();
index = idx;
Coord* c = pnts.first ();
while (c != 0L) {
points.append (new Coord (*c));
c = pnts.next ();
}
points.setAutoDelete (true);
}
killustrator'AddLineSegmentCmd::~AddLineSegmentCmd() (./koffice/killustrator/share/AddLineSegmentCmd.cc:47)
AddLineSegmentCmd::~AddLineSegmentCmd () {
line->unref ();
}
killustrator'AddLineSegmentCmd::execute() (./koffice/killustrator/share/AddLineSegmentCmd.cc:51)
void AddLineSegmentCmd::execute () {
for (unsigned int i = 0; i < points.count (); i++) {
bool update = (i + 1 == points.count ());
line->addPoint (index != 0 ? index + i : 0, *(points.at (i)), update);
}
}
killustrator'AddLineSegmentCmd::unexecute() (./koffice/killustrator/share/AddLineSegmentCmd.cc:58)
void AddLineSegmentCmd::unexecute () {
for (unsigned int i = 0; i < points.count (); i++) {
bool update = (i + 1 == points.count ());
line->removePoint (index, update);
}
}