MCPcopy Create free account
hub / github.com/KDE/okular / removeAnnotation

Method removeAnnotation

core/page.cpp:689–715  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

687}
688
689bool 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
717void Page::setTransition(PageTransition *transition)
718{

Callers 2

notifyRemovalMethod · 0.80

Calls 5

uniqueNameMethod · 0.80
objectTypeMethod · 0.80
objectMethod · 0.80
endMethod · 0.45

Tested by

no test coverage detected