summaryrefslogtreecommitdiff
path: root/sd/source/ui/unoidl/unomodel.cxx
diff options
context:
space:
mode:
authorJaume Pujantell <jaume.pujantell@collabora.com>2023-06-05 11:49:41 +0200
committerAndras Timar <andras.timar@collabora.com>2023-06-08 21:53:59 +0200
commit53d610786ba8085fcce331174c74294c90c41a20 (patch)
tree3f4af2f6ebc0a22b5070a0a951d79f6221309fa9 /sd/source/ui/unoidl/unomodel.cxx
parent260bc16e1923016d0628a8779e219b290d4c9011 (diff)
pdfium: better suport for annotations and some fixes
Added suport to import FreeText annotations. Added some suport to export graphical annotations. Fixed some color issues to be more inline with the pdfium library. Change-Id: I7371595ebb95594ee765ae532ca7c7d4f0499592 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152606 Tested-by: Jenkins Reviewed-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'sd/source/ui/unoidl/unomodel.cxx')
-rw-r--r--sd/source/ui/unoidl/unomodel.cxx17
1 files changed, 15 insertions, 2 deletions
diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx
index 3ff5fd0de266..dd2c897b4930 100644
--- a/sd/source/ui/unoidl/unomodel.cxx
+++ b/sd/source/ui/unoidl/unomodel.cxx
@@ -1597,15 +1597,28 @@ static void ImplPDFExportComments( const uno::Reference< drawing::XDrawPage >& x
uno::Reference< office::XAnnotation > xAnnotation( xAnnotationEnumeration->nextElement() );
geometry::RealPoint2D aRealPoint2D( xAnnotation->getPosition() );
+ geometry::RealSize2D aRealSize2D(xAnnotation->getSize());
uno::Reference< text::XText > xText( xAnnotation->getTextRange() );
vcl::PDFNote aNote;
aNote.Title = xAnnotation->getAuthor();
aNote.Contents = xText->getString();
aNote.maModificationDate = xAnnotation->getDateTime();
+ auto* pAnnotation = dynamic_cast<sd::Annotation*>(xAnnotation.get());
+ aNote.isFreeText = pAnnotation && pAnnotation->isFreeText();
+ if (pAnnotation && pAnnotation->hasCustomAnnotationMarker())
+ {
+ aNote.maPolygons = pAnnotation->getCustomAnnotationMarker().maPolygons;
+ aNote.annotColor = pAnnotation->getCustomAnnotationMarker().maLineColor;
+ aNote.interiorColor = pAnnotation->getCustomAnnotationMarker().maFillColor;
+ }
- rPDFExtOutDevData.CreateNote( ::tools::Rectangle( Point( static_cast< ::tools::Long >( aRealPoint2D.X * 100 ),
- static_cast< ::tools::Long >( aRealPoint2D.Y * 100 ) ), Size( 1000, 1000 ) ), aNote );
+ rPDFExtOutDevData.CreateNote(
+ ::tools::Rectangle(Point(static_cast<::tools::Long>(aRealPoint2D.X * 100),
+ static_cast<::tools::Long>(aRealPoint2D.Y * 100)),
+ Size(static_cast<::tools::Long>(aRealSize2D.Width * 100),
+ static_cast<::tools::Long>(aRealSize2D.Height * 100))),
+ aNote);
}
}
catch (const uno::Exception&)