diff options
Diffstat (limited to 'vcl/source/gdi/pdfwriter_impl.cxx')
-rw-r--r-- | vcl/source/gdi/pdfwriter_impl.cxx | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index 896a910eae51..1d10f377c0d0 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -8738,7 +8738,7 @@ void PDFWriterImpl::writeReferenceXObject(ReferenceXObjectEmit& rEmit) return; } - // Merge page annotations (links, etc) from pPage to our page. + // Merge link annotations from pPage to our page. std::vector<filter::PDFObjectElement*> aAnnots; if (auto pArray = dynamic_cast<filter::PDFArrayElement*>(pPage->Lookup("Annots"))) { @@ -8756,7 +8756,19 @@ void PDFWriterImpl::writeReferenceXObject(ReferenceXObjectEmit& rEmit) continue; } - // Annotation refers to an object, remember it. + auto pType = dynamic_cast<filter::PDFNameElement*>(pObject->Lookup("Type")); + if (!pType || pType->GetValue() != "Annot") + { + continue; + } + + auto pSubtype = dynamic_cast<filter::PDFNameElement*>(pObject->Lookup("Subtype")); + if (!pSubtype || pSubtype->GetValue() != "Link") + { + continue; + } + + // Reference to a link annotation object, remember it. aAnnots.push_back(pObject); } } |