| 1048 | } |
| 1049 | |
| 1050 | void DocumentPrivate::performAddPageAnnotation(int page, Annotation *annotation) |
| 1051 | { |
| 1052 | Okular::SaveInterface *iface = qobject_cast<Okular::SaveInterface *>(m_generator); |
| 1053 | AnnotationProxy *proxy = iface ? iface->annotationProxy() : nullptr; |
| 1054 | |
| 1055 | // find out the page to attach annotation |
| 1056 | Page *kp = m_pagesVector[page]; |
| 1057 | if (!m_generator || !kp) { |
| 1058 | return; |
| 1059 | } |
| 1060 | |
| 1061 | // the annotation belongs already to a page |
| 1062 | if (annotation->d_ptr->m_page) { |
| 1063 | return; |
| 1064 | } |
| 1065 | |
| 1066 | // add annotation to the page |
| 1067 | kp->addAnnotation(annotation); |
| 1068 | |
| 1069 | // tell the annotation proxy |
| 1070 | if (proxy && proxy->supports(AnnotationProxy::Addition)) { |
| 1071 | proxy->notifyAddition(annotation, page); |
| 1072 | } |
| 1073 | |
| 1074 | // notify observers about the change |
| 1075 | notifyAnnotationChanges(page); |
| 1076 | |
| 1077 | if (annotation->flags() & Annotation::ExternallyDrawn) { |
| 1078 | // Redraw everything, including ExternallyDrawn annotations |
| 1079 | refreshPixmaps(page); |
| 1080 | } |
| 1081 | } |
| 1082 | |
| 1083 | void DocumentPrivate::performRemovePageAnnotation(int page, Annotation *annotation) |
| 1084 | { |
no test coverage detected