| 1081 | } |
| 1082 | |
| 1083 | void DocumentPrivate::performRemovePageAnnotation(int page, Annotation *annotation) |
| 1084 | { |
| 1085 | Okular::SaveInterface *iface = qobject_cast<Okular::SaveInterface *>(m_generator); |
| 1086 | AnnotationProxy *proxy = iface ? iface->annotationProxy() : nullptr; |
| 1087 | bool isExternallyDrawn; |
| 1088 | |
| 1089 | // find out the page |
| 1090 | Page *kp = m_pagesVector[page]; |
| 1091 | if (!m_generator || !kp) { |
| 1092 | return; |
| 1093 | } |
| 1094 | |
| 1095 | if (annotation->flags() & Annotation::ExternallyDrawn) { |
| 1096 | isExternallyDrawn = true; |
| 1097 | } else { |
| 1098 | isExternallyDrawn = false; |
| 1099 | } |
| 1100 | |
| 1101 | // try to remove the annotation |
| 1102 | if (m_parent->canRemovePageAnnotation(annotation)) { |
| 1103 | // tell the annotation proxy |
| 1104 | if (proxy && proxy->supports(AnnotationProxy::Removal)) { |
| 1105 | proxy->notifyRemoval(annotation, page); |
| 1106 | } |
| 1107 | |
| 1108 | kp->removeAnnotation(annotation); // Also destroys the object |
| 1109 | |
| 1110 | // in case of success, notify observers about the change |
| 1111 | notifyAnnotationChanges(page); |
| 1112 | |
| 1113 | if (isExternallyDrawn) { |
| 1114 | // Redraw everything, including ExternallyDrawn annotations |
| 1115 | refreshPixmaps(page); |
| 1116 | } |
| 1117 | } |
| 1118 | } |
| 1119 | |
| 1120 | void DocumentPrivate::performModifyPageAnnotation(int page, Annotation *annotation, bool appearanceChanged) |
| 1121 | { |
no test coverage detected