Source Code (Use browser search to find items of interest.)

Class Index

kpresenter'ChgPixCmd (./koffice/kpresenter/chgpixcmd.h:34)

class ChgPixCmd : public Command
{
public:
    ChgPixCmd( QString _name, KPPixmapObject *_oldObject, KPPixmapObject *_newObject,
               KPresenterDoc *_doc );
    ~ChgPixCmd();

    virtual void execute();
    virtual void unexecute();

protected:
    ChgPixCmd()
    {; }

    KPPixmapObject *oldObject, *newObject;
    KPresenterDoc *doc;

};

kpresenter'ChgPixCmd::ChgPixCmd() (./koffice/kpresenter/chgpixcmd.cc:29)

ChgPixCmd::ChgPixCmd( QString _name, KPPixmapObject *_oldObject, KPPixmapObject *_newObject,
                      KPresenterDoc *_doc )
    : Command( _name )
{
    oldObject = _oldObject;
    newObject = _newObject;
    doc = _doc;
    oldObject->incCmdRef();
    newObject->incCmdRef();
    newObject->setSize( oldObject->getSize() );
    newObject->setOrig( oldObject->getOrig() );
}

/*======================== destructor ============================*/

kpresenter'ChgPixCmd::~ChgPixCmd() (./koffice/kpresenter/chgpixcmd.cc:43)

ChgPixCmd::~ChgPixCmd()
{
    oldObject->decCmdRef();
    newObject->decCmdRef();
}

/*======================== execute ===============================*/

kpresenter'ChgPixCmd::execute() (./koffice/kpresenter/chgpixcmd.cc:50)

void ChgPixCmd::execute()
{
    unsigned int pos = doc->objectList()->findRef( oldObject );
    doc->objectList()->take( pos );
    doc->objectList()->insert( pos, newObject );
    doc->repaint( newObject );
}

/*====================== unexecute ===============================*/

kpresenter'ChgPixCmd::unexecute() (./koffice/kpresenter/chgpixcmd.cc:59)

void ChgPixCmd::unexecute()
{
    unsigned int pos = doc->objectList()->findRef( newObject );
    doc->objectList()->take( pos );
    doc->objectList()->insert( pos, oldObject );
    doc->repaint( oldObject );
}