sd/source/ui/annotations/annotationmanager.cxx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
New commits: commit 2af35f8558b37179b0a16f264df38f89dceb0a0b Author: Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk> AuthorDate: Fri Jun 14 14:40:31 2024 +0900 Commit: Miklos Vajna <vmik...@collabora.com> CommitDate: Tue Jun 18 12:27:03 2024 +0200 annot: support fill and line transparence for PDF annotations Change-Id: Iafff527a094e6cb550a9e060a191510f74d86075 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168848 Reviewed-by: Miklos Vajna <vmik...@collabora.com> Tested-by: Miklos Vajna <vmik...@collabora.com> diff --git a/sd/source/ui/annotations/annotationmanager.cxx b/sd/source/ui/annotations/annotationmanager.cxx index 67f356884725..caeefbb8c3c6 100644 --- a/sd/source/ui/annotations/annotationmanager.cxx +++ b/sd/source/ui/annotations/annotationmanager.cxx @@ -90,6 +90,8 @@ #include <svx/xlnclit.hxx> #include <svx/xlnstwit.hxx> #include <svx/xlnwtit.hxx> +#include <svx/xfltrit.hxx> +#include <svx/xlntrit.hxx> #include <memory> @@ -985,6 +987,8 @@ void applyAnnotationProperties(SdrObject& rObject, sdr::annotation::CreationInfo { rObject.SetMergedItem(XLineStyleItem(drawing::LineStyle_SOLID)); rObject.SetMergedItem(XLineColorItem(OUString(), rInfo.maColor)); + sal_uInt16 nTransparence = 100.0 - (rInfo.maColor.GetAlpha() / 255.0) * 100.0; + rObject.SetMergedItem(XLineTransparenceItem(nTransparence)); } rObject.SetMergedItem(XLineWidthItem(rInfo.mnWidth)); @@ -992,6 +996,8 @@ void applyAnnotationProperties(SdrObject& rObject, sdr::annotation::CreationInfo { rObject.SetMergedItem(XFillStyleItem(drawing::FillStyle_SOLID)); rObject.SetMergedItem(XFillColorItem(OUString(), rInfo.maFillColor)); + sal_uInt16 nTransparence = 100.0 - (rInfo.maFillColor.GetAlpha() / 255.0) * 100.0; + rObject.SetMergedItem(XFillTransparenceItem(nTransparence)); } } @@ -1059,7 +1065,7 @@ void AnnotationManagerImpl::SyncAnnotationObjects() } else if (rInfo.meType == sdr::annotation::AnnotationType::Square) { - pNewObject = new SdrRectObj(rModel, SdrObjKind::Rectangle, aRectangle); + pNewObject = new SdrRectObj(rModel, aRectangle); applyAnnotationCommon(*pNewObject, xAnnotation); applyAnnotationProperties(*pNewObject, rInfo); @@ -1073,8 +1079,6 @@ void AnnotationManagerImpl::SyncAnnotationObjects() } else if (rInfo.meType == sdr::annotation::AnnotationType::Stamp) { - pNewObject = new SdrCircObj(rModel, SdrCircKind::Full, aRectangle); - rtl::Reference<SdrGrafObj> pGrafObject = new SdrGrafObj(rModel, Graphic(rInfo.maBitmapEx), aRectangle); pNewObject = pGrafObject;