Skip to main content
Participating Frequently
August 6, 2007
Question

Set command sequence undoability to kUndoNotRequired?

  • August 6, 2007
  • 2 replies
  • 395 views
I was trying to prevent a command sequence from showing up in the command history by setting its undoability to kUndoNotRequired. And at run time,
I get the following assertion:

CommandSequence::SetUndoability(): unsopported undoability

Here is the gist of the code.

ICommandSequence* sequ = CmdUtils::BeginCommandSequence();
sequ->SetUndoability(ICommand::kUndoNotRequired);
// set sequ name
// run the commands
CmdUtils::EndCommandSequence(sequ);

So this is an undocumented "feature" of the API?

Nick
This topic has been closed for replies.

2 replies

Participating Frequently
August 6, 2007
I am targeting CS2, but yes, set it to "kAutoUndo" works, although I don't really understand the difference between kAutoUndoWithPrevious and kAutoUndoWithNext.

Thanks Strizh.
Participating Frequently
August 6, 2007
This is a depricated "feature".
You must use kAutoUndo or kRegularUndo.

b In InDesign CS3 SDK:

i kAutoUndo The command does not show up in undo / redo menu items, it is always undone / redone with some other step.

i kRegularUndo Default: The command shows up in undo /redo menu items in its own distinct step (if it is not part of a sequence).