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

Class Index

killustrator'SetTextCmd (./koffice/killustrator/share/SetTextCmd.h:33)

class SetTextCmd : public Command {
public:
  SetTextCmd (GDocument* doc, GText* obj, const QString& s);
  SetTextCmd (GDocument* doc, GText* obj, GOState* ostate);

  ~SetTextCmd ();

  void execute ();
  void unexecute ();

private:
  GDocument* document;
  GText* object;
  GOState* state;
  QString text;
};

killustrator'SetTextCmd::SetTextCmd() (./koffice/killustrator/share/SetTextCmd.cc:32)

SetTextCmd::SetTextCmd (GDocument* doc, GText* obj, const QString& ) 
  : Command(i18n("Change Text"))
{
  document = doc;
  object = obj;
  object->ref ();
  state = 0L;
}


killustrator'SetTextCmd::SetTextCmd() (./koffice/killustrator/share/SetTextCmd.cc:41)

SetTextCmd::SetTextCmd (GDocument* doc, GText* obj, GOState* ostate) 
  : Command(i18n("Change Text"))
{
  document = doc;
  object = obj;
  object->ref ();
  state = ostate;
  state->ref (); // the TextTool unreferences this state object !
  text = obj->getText ();
}


killustrator'SetTextCmd::~SetTextCmd() (./koffice/killustrator/share/SetTextCmd.cc:52)

SetTextCmd::~SetTextCmd () {
  object->unref ();
  state->unref ();
}


killustrator'SetTextCmd::execute() (./koffice/killustrator/share/SetTextCmd.cc:57)

void SetTextCmd::execute () {
  if (state)
    state->unref ();
  state = object->saveState ();
  object->setText (text);
}


killustrator'SetTextCmd::unexecute() (./koffice/killustrator/share/SetTextCmd.cc:64)

void SetTextCmd::unexecute () {
  object->restoreState (state);
}