diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2024-06-06 10:52:35 +0900 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2024-06-11 12:48:48 +0200 |
commit | e17c56bfc7930d3c14c3ff4cfd59828e8dcc0229 (patch) | |
tree | ec27fbffbe482aea2e90e98a7dd269092d43fdf1 /svx/source/unodraw | |
parent | 4c179c1e62778274e7604b3317300f6df809cd80 (diff) |
annot: new Annotation sdr object, replacing annotation tags
Previously the annotations are shown as annotation (smart) tags,
which just mark in the document the existence of an annotation at
a certain position. For PDF support the annotations can be more
complex, so they can show many forms of vector graphic, ink,
bitmaps, text boxes,... and for this a normal tag is not enough.
This change moves the annotations from simple tag to use the sdr
objects, so any SdrObject can be created as an annotation. The
previous tag annotations are using SdrObject (actually SdrRect)
subclass AnnotationObject and the code that previouslly worked
with the tag annotations has been adapted.
The (PDFium based) PDF import has been changed to use subclasses
of the SdrObjects for the PDF annotations.
Change-Id: I4746b85b5b679499e470987e61ed356397e56bf9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168485
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'svx/source/unodraw')
-rw-r--r-- | svx/source/unodraw/unopage.cxx | 3 | ||||
-rw-r--r-- | svx/source/unodraw/unoprov.cxx | 1 | ||||
-rw-r--r-- | svx/source/unodraw/unoshape.cxx | 24 |
3 files changed, 28 insertions, 0 deletions
diff --git a/svx/source/unodraw/unopage.cxx b/svx/source/unodraw/unopage.cxx index fc613dd23f4a..9bf61e49af53 100644 --- a/svx/source/unodraw/unopage.cxx +++ b/svx/source/unodraw/unopage.cxx @@ -766,6 +766,9 @@ rtl::Reference<SvxShape> SvxDrawPage::CreateShapeByTypeAndInventor( SdrObjKind n case SdrObjKind::Table: pRet = new SvxTableShape( pObj ); break; + case SdrObjKind::Annotation: + pRet = new SvxShapeRect( pObj ); + break; default: // unknown 2D-object on page assert(false && "Not implemented Starone-Shape created"); pRet = new SvxShapeText( pObj ); diff --git a/svx/source/unodraw/unoprov.cxx b/svx/source/unodraw/unoprov.cxx index d210da214ee7..356894621c0a 100644 --- a/svx/source/unodraw/unoprov.cxx +++ b/svx/source/unodraw/unoprov.cxx @@ -822,6 +822,7 @@ const UHashMapImpl& GetUHashImpl() { "com.sun.star.drawing.AppletShape", SdrObjKind::OLE2Applet }, { "com.sun.star.drawing.CustomShape", SdrObjKind::CustomShape }, { "com.sun.star.drawing.MediaShape", SdrObjKind::Media }, + { "com.sun.star.drawing.AnnotationShape", SdrObjKind::Annotation }, { "com.sun.star.drawing.Shape3DSceneObject", SdrObjKind::E3D_Scene }, { "com.sun.star.drawing.Shape3DCubeObject", SdrObjKind::E3D_Cube }, diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx index 934c72c85cfb..5c3807817a6f 100644 --- a/svx/source/unodraw/unoshape.cxx +++ b/svx/source/unodraw/unoshape.cxx @@ -3184,6 +3184,7 @@ constexpr OUString sUNO_service_drawing_PolyLineShape = u"com.sun.star.drawi constexpr OUString sUNO_service_drawing_OpenBezierShape = u"com.sun.star.drawing.OpenBezierShape"_ustr; constexpr OUString sUNO_service_drawing_ClosedBezierShape = u"com.sun.star.drawing.ClosedBezierShape"_ustr; constexpr OUString sUNO_service_drawing_TextShape = u"com.sun.star.drawing.TextShape"_ustr; +constexpr OUString sUNO_service_drawing_AnnotationShape = u"com.sun.star.drawing.AnnotationShape"_ustr; constexpr OUString sUNO_service_drawing_GraphicObjectShape = u"com.sun.star.drawing.GraphicObjectShape"_ustr; constexpr OUString sUNO_service_drawing_OLE2Shape = u"com.sun.star.drawing.OLE2Shape"_ustr; constexpr OUString sUNO_service_drawing_PageShape = u"com.sun.star.drawing.PageShape"_ustr; @@ -3442,6 +3443,29 @@ uno::Sequence< OUString > SvxShape::_getSupportedServiceNames() sUNO_service_drawing_RotationDescriptor }; return aSvxShape_TextServices; } + case SdrObjKind::Annotation: + { + static const uno::Sequence<OUString> aSvxShape_AnnotationServices = { + sUNO_service_drawing_AnnotationShape, + + sUNO_service_drawing_Shape, + sUNO_service_drawing_FillProperties, + sUNO_service_drawing_LineProperties, + + sUNO_service_drawing_Text, + sUNO_service_drawing_TextProperties, + sUNO_service_style_ParagraphProperties, + sUNO_service_style_ParagraphPropertiesComplex, + sUNO_service_style_ParagraphPropertiesAsian, + sUNO_service_style_CharacterProperties, + sUNO_service_style_CharacterPropertiesComplex, + sUNO_service_style_CharacterPropertiesAsian, + + sUNO_service_drawing_ShadowProperties, + sUNO_service_drawing_RotationDescriptor + }; + return aSvxShape_AnnotationServices; + } case SdrObjKind::Graphic: { |