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

Method performSetAnnotationContents

core/document.cpp:1157–1188  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1155}
1156
1157void 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
1190void DocumentPrivate::recalculateForms()
1191{

Callers 2

undoMethod · 0.80
redoMethod · 0.80

Calls 4

subTypeMethod · 0.80
showCaptionMethod · 0.80
setContentsMethod · 0.80
textTypeMethod · 0.45

Tested by

no test coverage detected