diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2020-10-15 12:23:08 +0200 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2020-10-18 21:22:03 +0200 |
commit | 7ea49126e7a247ac60ad45ab420106fe4be574ea (patch) | |
tree | 3bcc90a13499bb4eb0fd0f584d40f70b2c44d97e /sd | |
parent | 81a9e0eb98eacfb50ee1b30d1bbaea7a02594cc6 (diff) |
sd: support text annotation PDF annot. as custom marker
This one is special as it annotates text. Normally the annotation
would be present behind the text, but this is not possible in
this case, so the best alternative is to use a transparent
rectangle over the text.
Change-Id: Ib115efa4a5994e17dcf9d7b02591ccae26800928
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104369
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/filter/pdf/sdpdffilter.cxx | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/sd/source/filter/pdf/sdpdffilter.cxx b/sd/source/filter/pdf/sdpdffilter.cxx index b2866dd1701d..5e190f8a0117 100644 --- a/sd/source/filter/pdf/sdpdffilter.cxx +++ b/sd/source/filter/pdf/sdpdffilter.cxx @@ -154,6 +154,19 @@ bool SdPdfFilter::Import() rCustomAnnotationMarker.mnLineWidth = pMarker->mnWidth; rCustomAnnotationMarker.maFillColor = pMarker->maFillColor; } + else if (rPDFAnnotation.meSubType == vcl::pdf::PDFAnnotationSubType::Highlight) + { + if (rCustomAnnotationMarker.maLineColor.GetTransparency() == 0) + rCustomAnnotationMarker.maLineColor.SetTransparency(0x90); + auto* pMarker = static_cast<vcl::pdf::PDFAnnotationMarkerHighlight*>( + rPDFAnnotation.mpMarker.get()); + for (auto const& rPolygon : pMarker->maQuads) + rCustomAnnotationMarker.maPolygons.push_back(rPolygon); + rCustomAnnotationMarker.mnLineWidth = 1; + rCustomAnnotationMarker.maFillColor = rPDFAnnotation.maColor; + if (rCustomAnnotationMarker.maFillColor.GetTransparency() == 0) + rCustomAnnotationMarker.maFillColor.SetTransparency(0x90); + } } } } |