diff options
-rw-r--r-- | backend/pdf/ev-poppler.cc | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/backend/pdf/ev-poppler.cc b/backend/pdf/ev-poppler.cc index 3e999111..bc8b99ad 100644 --- a/backend/pdf/ev-poppler.cc +++ b/backend/pdf/ev-poppler.cc @@ -2845,7 +2845,22 @@ pdf_document_annotations_add_annotation (EvDocumentAnnotations *document_annotat poppler_rect.x2 = rect->x2; poppler_rect.y1 = height - rect->y2; poppler_rect.y2 = height - rect->y1; - poppler_annot = poppler_annot_text_new (pdf_document->document, &poppler_rect); + + switch (ev_annotation_get_annotation_type (annot)) { + case EV_ANNOTATION_TYPE_TEXT: { + EvAnnotationText *text = EV_ANNOTATION_TEXT (annot); + EvAnnotationTextIcon icon; + + poppler_annot = poppler_annot_text_new (pdf_document->document, &poppler_rect); + + icon = ev_annotation_text_get_icon (text); + poppler_annot_text_set_icon (POPPLER_ANNOT_TEXT (poppler_annot), + get_poppler_annot_text_icon (icon)); + } + break; + default: + g_assert_not_reached (); + } ev_annotation_get_color (annot, &color); poppler_color.red = color.red; @@ -2875,14 +2890,6 @@ pdf_document_annotations_add_annotation (EvDocumentAnnotations *document_annotat poppler_annot_markup_set_label (POPPLER_ANNOT_MARKUP (poppler_annot), label); } - if (EV_IS_ANNOTATION_TEXT (annot)) { - EvAnnotationText *text = EV_ANNOTATION_TEXT (annot); - EvAnnotationTextIcon icon; - - icon = ev_annotation_text_get_icon (text); - poppler_annot_text_set_icon (POPPLER_ANNOT_TEXT (poppler_annot), - get_poppler_annot_text_icon (icon)); - } poppler_page_add_annot (poppler_page, poppler_annot); annot_mapping = g_new (EvMapping, 1); |