305 const ERRCODE DONT_EXCHANGE_DELETED =
306 "Can't exchange deleted elements of lists";
315 if (!(other_it->list))
322 if ((list->
empty ()) ||
323 (other_it->list->
empty ()) || (current == other_it->current))
328 if (!current || !other_it->current)
329 DONT_EXCHANGE_DELETED.
error (
"ELIST2_ITERATOR.exchange",
ABORT, NULL);
336 if ((next == other_it->current) ||
337 (other_it->next == current)) {
339 if ((next == other_it->current) &&
340 (other_it->next == current)) {
341 prev = next = current;
342 other_it->prev = other_it->next = other_it->current;
347 if (other_it->next == current) {
348 other_it->prev->next = current;
349 other_it->current->next = next;
350 other_it->current->prev = current;
351 current->next = other_it->current;
352 current->prev = other_it->prev;
353 next->prev = other_it->current;
355 other_it->next = other_it->current;
359 prev->next = other_it->current;
360 current->next = other_it->next;
361 current->prev = other_it->current;
362 other_it->current->next = current;
363 other_it->current->prev = prev;
364 other_it->next->prev = current;
367 other_it->prev = other_it->current;
372 prev->next = other_it->current;
373 current->next = other_it->next;
374 current->prev = other_it->prev;
375 next->prev = other_it->current;
376 other_it->prev->next = current;
377 other_it->current->next = next;
378 other_it->current->prev = prev;
379 other_it->next->prev = current;
385 if (list->last == current)
386 list->last = other_it->current;
387 if (other_it->list->last == other_it->current)
388 other_it->list->last = current;
390 if (current == cycle_pt)
391 cycle_pt = other_it->cycle_pt;
392 if (other_it->current == other_it->cycle_pt)
393 other_it->cycle_pt = cycle_pt;
397 old_current = current;
398 current = other_it->current;
399 other_it->current = old_current;
const ERRCODE BAD_PARAMETER
void error(const char *caller, TessErrorLogCode action, const char *format,...) const