| 1155 | } |
| 1156 | |
| 1157 | void DocumentPrivate::performSetAnnotationContents(const QString &newContents, Annotation *annot, int pageNumber) |
| 1158 | { |
| 1159 | bool appearanceChanged = false; |
| 1160 | |
| 1161 | // Check if appearanceChanged should be true |
| 1162 | switch (annot->subType()) { |
| 1163 | // If it's an in-place TextAnnotation, set the inplace text |
| 1164 | case Okular::Annotation::AText: { |
| 1165 | const Okular::TextAnnotation *txtann = static_cast<Okular::TextAnnotation *>(annot); |
| 1166 | if (txtann->textType() == Okular::TextAnnotation::InPlace) { |
| 1167 | appearanceChanged = true; |
| 1168 | } |
| 1169 | break; |
| 1170 | } |
| 1171 | // If it's a LineAnnotation, check if caption text is visible |
| 1172 | case Okular::Annotation::ALine: { |
| 1173 | const Okular::LineAnnotation *lineann = static_cast<Okular::LineAnnotation *>(annot); |
| 1174 | if (lineann->showCaption()) { |
| 1175 | appearanceChanged = true; |
| 1176 | } |
| 1177 | break; |
| 1178 | } |
| 1179 | default: |
| 1180 | break; |
| 1181 | } |
| 1182 | |
| 1183 | // Set contents |
| 1184 | annot->setContents(newContents); |
| 1185 | |
| 1186 | // Tell the document the annotation has been modified |
| 1187 | performModifyPageAnnotation(pageNumber, annot, appearanceChanged); |
| 1188 | } |
| 1189 | |
| 1190 | void DocumentPrivate::recalculateForms() |
| 1191 | { |
no test coverage detected