292 const ERRCODE DONT_EXCHANGE_DELETED =
293 "Can't exchange deleted elements of lists";
302 if (!(other_it->list))
309 if ((list->
empty ()) ||
310 (other_it->list->
empty ()) || (current == other_it->current))
315 if (!current || !other_it->current)
316 DONT_EXCHANGE_DELETED.
error (
"ELIST_ITERATOR.exchange",
ABORT, NULL);
323 if ((next == other_it->current) ||
324 (other_it->next == current)) {
326 if ((next == other_it->current) &&
327 (other_it->next == current)) {
328 prev = next = current;
329 other_it->prev = other_it->next = other_it->current;
334 if (other_it->next == current) {
335 other_it->prev->next = current;
336 other_it->current->next = next;
337 current->next = other_it->current;
338 other_it->next = other_it->current;
342 prev->next = other_it->current;
343 current->next = other_it->next;
344 other_it->current->next = current;
346 other_it->prev = other_it->current;
351 prev->next = other_it->current;
352 current->next = other_it->next;
353 other_it->prev->next = current;
354 other_it->current->next = next;
360 if (list->last == current)
361 list->last = other_it->current;
362 if (other_it->list->last == other_it->current)
363 other_it->list->last = current;
365 if (current == cycle_pt)
366 cycle_pt = other_it->cycle_pt;
367 if (other_it->current == other_it->cycle_pt)
368 other_it->cycle_pt = cycle_pt;
372 old_current = current;
373 current = other_it->current;
374 other_it->current = old_current;
const ERRCODE BAD_PARAMETER
void error(const char *caller, TessErrorLogCode action, const char *format,...) const