TODO: Find a better place to put this
| 282 | |
| 283 | // TODO: Find a better place to put this |
| 284 | void initPDFAnnotation(Annotation::AbstractAnnotation * annot, QWeakPointer<Backend::Page> page, fz_obj * src) |
| 285 | { |
| 286 | static char keyRect[] = "Rect"; |
| 287 | static char keyContents[] = "Contents"; |
| 288 | static char keyNM[] = "NM"; |
| 289 | static char keyM[] = "M"; |
| 290 | static char keyC[] = "C"; |
| 291 | static char keyF[] = "F"; |
| 292 | |
| 293 | if (!annot) |
| 294 | return; |
| 295 | |
| 296 | annot->setPage(page); |
| 297 | |
| 298 | if (!fz_is_dict(src)) |
| 299 | return; |
| 300 | |
| 301 | annot->setRect(toRectF(fz_dict_gets(src, keyRect))); |
| 302 | annot->setContents(QString::fromUtf8(fz_to_str_buf(fz_dict_gets(src, keyContents)))); |
| 303 | annot->setName(QString::fromUtf8(fz_to_str_buf(fz_dict_gets(src, keyNM)))); |
| 304 | annot->setLastModified(fromPDFDate(QString::fromUtf8(fz_to_str_buf(fz_dict_gets(src, keyM))))); |
| 305 | annot->setColor(toColor(fz_dict_gets(src, keyC))); |
| 306 | annot->flags() = QFlags<Annotation::AbstractAnnotation::AnnotationFlags>(fz_to_int(fz_dict_gets(src, keyF))); |
| 307 | } |
| 308 | |
| 309 | Annotation::Popup * toPDFPopupAnnotation(Annotation::Markup * parent, fz_obj * src) |
| 310 | { |
no test coverage detected