| 1118 | } |
| 1119 | |
| 1120 | void DocumentPrivate::performModifyPageAnnotation(int page, Annotation *annotation, bool appearanceChanged) |
| 1121 | { |
| 1122 | Okular::SaveInterface *iface = qobject_cast<Okular::SaveInterface *>(m_generator); |
| 1123 | AnnotationProxy *proxy = iface ? iface->annotationProxy() : nullptr; |
| 1124 | |
| 1125 | // find out the page |
| 1126 | const Page *kp = m_pagesVector[page]; |
| 1127 | if (!m_generator || !kp) { |
| 1128 | return; |
| 1129 | } |
| 1130 | |
| 1131 | // tell the annotation proxy |
| 1132 | if (proxy && proxy->supports(AnnotationProxy::Modification)) { |
| 1133 | proxy->notifyModification(annotation, page, appearanceChanged); |
| 1134 | } |
| 1135 | |
| 1136 | // notify observers about the change |
| 1137 | notifyAnnotationChanges(page); |
| 1138 | if (appearanceChanged && (annotation->flags() & Annotation::ExternallyDrawn)) { |
| 1139 | /* When an annotation is being moved, the generator will not render it. |
| 1140 | * Therefore there's no need to refresh pixmaps after the first time */ |
| 1141 | if (annotation->flags() & (Annotation::BeingMoved | Annotation::BeingResized)) { |
| 1142 | if (m_annotationBeingModified) { |
| 1143 | return; |
| 1144 | } else { // First time: take note |
| 1145 | m_annotationBeingModified = true; |
| 1146 | } |
| 1147 | } else { |
| 1148 | m_annotationBeingModified = false; |
| 1149 | } |
| 1150 | |
| 1151 | // Redraw everything, including ExternallyDrawn annotations |
| 1152 | qCDebug(OkularCoreDebug) << "Refreshing Pixmaps"; |
| 1153 | refreshPixmaps(page); |
| 1154 | } |
| 1155 | } |
| 1156 | |
| 1157 | void DocumentPrivate::performSetAnnotationContents(const QString &newContents, Annotation *annot, int pageNumber) |
| 1158 | { |
no test coverage detected