| 3523 | } |
| 3524 | |
| 3525 | bool Document::canRemovePageAnnotation(const Annotation *annotation) const |
| 3526 | { |
| 3527 | if (!annotation || (annotation->flags() & Annotation::DenyDelete)) { |
| 3528 | return false; |
| 3529 | } |
| 3530 | |
| 3531 | if ((annotation->flags() & Annotation::External) && !d->canRemoveExternalAnnotations()) { |
| 3532 | return false; |
| 3533 | } |
| 3534 | |
| 3535 | switch (annotation->subType()) { |
| 3536 | case Annotation::AText: |
| 3537 | case Annotation::ALine: |
| 3538 | case Annotation::AGeom: |
| 3539 | case Annotation::AHighlight: |
| 3540 | case Annotation::AStamp: |
| 3541 | case Annotation::AInk: |
| 3542 | case Annotation::ACaret: |
| 3543 | return true; |
| 3544 | default: |
| 3545 | return false; |
| 3546 | } |
| 3547 | } |
| 3548 | |
| 3549 | void Document::removePageAnnotation(int page, Annotation *annotation) |
| 3550 | { |