Example #1
0
void
nsTransactionStack::Clear()
{
  while (GetSize() != 0) {
    RefPtr<nsTransactionItem> item =
      mType == FOR_UNDO ? Pop() : PopBottom();
  }
}
Example #2
0
void
nsTransactionStack::Clear()
{
  nsRefPtr<nsTransactionItem> tx;

  do {
    tx = mType == FOR_UNDO ? Pop() : PopBottom();
  } while (tx);
}
nsresult
nsTransactionRedoStack::Clear(void)
{
  nsRefPtr<nsTransactionItem> tx;
  nsresult result       = NS_OK;

  /* When clearing a Redo stack, we have to clear from the
   * bottom of the stack towards the top!
   */

  result = PopBottom(getter_AddRefs(tx));

  if (NS_FAILED(result))
    return result;

  while (tx) {
    result = PopBottom(getter_AddRefs(tx));

    if (NS_FAILED(result))
      return result;
  }

  return NS_OK;
}