summaryrefslogtreecommitdiff
path: root/sd/inc
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2020-10-15 09:38:56 +0200
committerTomaž Vajngerl <quikee@gmail.com>2020-10-18 21:20:40 +0200
commit52c2b0fefcd3743c266cccb321ae194fd00720a4 (patch)
tree96b1e786cdb1f2295d688b99f7ca5e45ae3540b3 /sd/inc
parentcf9dd0ab74db5e1f97c20737290a55a30a8738e5 (diff)
sd: custom annotation marker and draw polygon annotation from PDF
This implements custom annotation marker, which overrides the default marker drawing of comments in Draw/Impress. The polygon is transported from the import of PDF to SdPdfFilter, then the sd::Annotation is set-up, by settuing up the new class CustomAnnotationMarker. CustomAnnotationMarker also supports setting of the line color, line width and fill color. The OverlayPolyPolygon is the new class that is responsible for the marker overlay, mainly to create the Primitive2D of the marker, that will be shown on the screen. This only implements Polygon PDF annotation sub-type. Change-Id: Ic663c31c5b3db5c13179dde63c1a0b81159f4b80 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104365 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'sd/inc')
-rw-r--r--sd/inc/Annotation.hxx31
1 files changed, 30 insertions, 1 deletions
diff --git a/sd/inc/Annotation.hxx b/sd/inc/Annotation.hxx
index 24eb09989aca..883512506c78 100644
--- a/sd/inc/Annotation.hxx
+++ b/sd/inc/Annotation.hxx
@@ -31,6 +31,10 @@
#include "drawdoc.hxx"
#include "sdpage.hxx"
#include "textapi.hxx"
+#include "sddllapi.h"
+
+#include <basegfx/polygon/b2dpolygon.hxx>
+#include <tools/color.hxx>
class SdrUndoAction;
@@ -62,7 +66,15 @@ void LOKCommentNotify(CommentNotificationType nType, const SfxViewShell* pViewSh
void LOKCommentNotifyAll(CommentNotificationType nType,
css::uno::Reference<css::office::XAnnotation> const & rxAnnotation);
-class Annotation : private ::cppu::BaseMutex,
+struct SD_DLLPUBLIC CustomAnnotationMarker
+{
+ Color maLineColor;
+ Color maFillColor;
+ float mnLineWidth;
+ std::vector<basegfx::B2DPolygon> maPolygons;
+};
+
+class SD_DLLPUBLIC Annotation : private ::cppu::BaseMutex,
public ::cppu::WeakComponentImplHelper<css::office::XAnnotation>,
public ::cppu::PropertySetMixin<css::office::XAnnotation>
{
@@ -107,6 +119,21 @@ public:
void createChangeUndo();
+ void createCustomAnnotationMarker()
+ {
+ m_pCustomAnnotationMarker = std::make_unique<CustomAnnotationMarker>();
+ }
+
+ CustomAnnotationMarker& getCustomAnnotationMarker()
+ {
+ return *m_pCustomAnnotationMarker;
+ }
+
+ bool hasCustomAnnotationMarker()
+ {
+ return bool(m_pCustomAnnotationMarker);
+ }
+
private:
// destructor is private and will be called indirectly by the release call virtual ~Annotation() {}
@@ -124,6 +151,8 @@ private:
OUString m_Initials;
css::util::DateTime m_DateTime;
rtl::Reference<TextApiObject> m_TextRange;
+
+ std::unique_ptr<CustomAnnotationMarker> m_pCustomAnnotationMarker;
};
}