| 687 | } |
| 688 | |
| 689 | bool Page::removeAnnotation(Annotation *annotation) |
| 690 | { |
| 691 | if (!d->m_doc->m_parent->canRemovePageAnnotation(annotation)) { |
| 692 | return false; |
| 693 | } |
| 694 | |
| 695 | QList<Annotation *>::iterator aIt = m_annotations.begin(); |
| 696 | for (; aIt != m_annotations.end(); ++aIt) { |
| 697 | if ((*aIt) && (*aIt)->uniqueName() == annotation->uniqueName()) { |
| 698 | int rectfound = false; |
| 699 | QList<ObjectRect *>::iterator it = m_rects.begin(); |
| 700 | for (; it != m_rects.end() && !rectfound; ++it) { |
| 701 | if (((*it)->objectType() == ObjectRect::OAnnotation) && ((*it)->object() == (*aIt))) { |
| 702 | delete *it; |
| 703 | it = m_rects.erase(it); |
| 704 | rectfound = true; |
| 705 | } |
| 706 | } |
| 707 | qCDebug(OkularCoreDebug) << "removed annotation:" << annotation->uniqueName(); |
| 708 | annotation->d_ptr->m_page = nullptr; |
| 709 | m_annotations.erase(aIt); |
| 710 | break; |
| 711 | } |
| 712 | } |
| 713 | |
| 714 | return true; |
| 715 | } |
| 716 | |
| 717 | void Page::setTransition(PageTransition *transition) |
| 718 | { |
no test coverage detected