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

Method performAddPageAnnotation

core/document.cpp:1050–1081  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1048}
1049
1050void 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
1083void DocumentPrivate::performRemovePageAnnotation(int page, Annotation *annotation)
1084{

Callers 3

restoreLocalContentsMethod · 0.80
redoMethod · 0.80
undoMethod · 0.80

Calls 5

annotationProxyMethod · 0.80
supportsMethod · 0.80
notifyAdditionMethod · 0.80
addAnnotationMethod · 0.45
flagsMethod · 0.45

Tested by

no test coverage detected