sd/source/ui/annotations/annotationmanager.cxx |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

New commits:
commit 9e00fa69fabbde8b9ff5a08a9ffc02a322cc7445
Author:     Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk>
AuthorDate: Fri Jun 14 14:40:31 2024 +0900
Commit:     Tomaž Vajngerl <qui...@gmail.com>
CommitDate: Sat Jun 15 01:52:20 2024 +0200

    annot: support fill and line transparence for PDF annotations
    
    Change-Id: Iafff527a094e6cb550a9e060a191510f74d86075
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168841
    Reviewed-by: Tomaž Vajngerl <qui...@gmail.com>
    Tested-by: Jenkins

diff --git a/sd/source/ui/annotations/annotationmanager.cxx 
b/sd/source/ui/annotations/annotationmanager.cxx
index 31292315787e..e45c35894450 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>
 
@@ -982,6 +984,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));
 
@@ -989,6 +993,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));
     }
 }
 
@@ -1056,7 +1062,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);
@@ -1070,8 +1076,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;
 

Reply via email to