diff options
author | Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de> | 2021-07-19 08:11:43 +0200 |
---|---|---|
committer | Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de> | 2021-07-26 14:13:53 +0200 |
commit | a23b44fd9f0119f7ea3523e32875f55c1a07c1cd (patch) | |
tree | 2a9ffc63b7186fea9d0cfea8660d95d30a8f6684 /include | |
parent | 3c3b9ad8886da916027f0fb940a2df822d63d4d7 (diff) |
tdf#123626 Allow adding hyperlinks to shapes
* Support hyperlinks on Shapes in Writer
* Add menu items
* Add context menu items
* ODF import/export + test
* OOXML import/export + test
Change-Id: I7269064c4cabd16fdb8259a48429c508184d3ccf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119164
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
Diffstat (limited to 'include')
-rw-r--r-- | include/editeng/unoprnms.hxx | 2 | ||||
-rw-r--r-- | include/oox/vml/vmlshape.hxx | 1 | ||||
-rw-r--r-- | include/oox/vml/vmlshapecontext.hxx | 2 | ||||
-rw-r--r-- | include/svl/solar.hrc | 2 | ||||
-rw-r--r-- | include/svx/svdobj.hxx | 5 | ||||
-rw-r--r-- | include/svx/unoshprp.hxx | 6 |
6 files changed, 15 insertions, 3 deletions
diff --git a/include/editeng/unoprnms.hxx b/include/editeng/unoprnms.hxx index 011e504ae7f4..f99ddac50414 100644 --- a/include/editeng/unoprnms.hxx +++ b/include/editeng/unoprnms.hxx @@ -163,6 +163,8 @@ #define UNO_NAME_MISC_OBJ_TITLE "Title" #define UNO_NAME_MISC_OBJ_DESCRIPTION "Description" +#define UNO_NAME_HYPERLINK "Hyperlink" + #define UNO_NAME_GRAPHOBJ_FILLBITMAP "GraphicObjectFillBitmap" #define UNO_NAME_GRAPHOBJ_REPLACEMENT_GRAPHIC "ReplacementGraphic" #define UNO_NAME_GRAPHOBJ_GRAFSTREAMURL "GraphicStreamURL" diff --git a/include/oox/vml/vmlshape.hxx b/include/oox/vml/vmlshape.hxx index 0e50e5b6ee1f..d90ecc2865bf 100644 --- a/include/oox/vml/vmlshape.hxx +++ b/include/oox/vml/vmlshape.hxx @@ -112,6 +112,7 @@ struct ShapeTypeModel OptValue<OUString> moCropRight; ///< Specifies how much to crop the image from the right in as a fraction of picture size. OptValue<OUString> moCropTop; ///< Specifies how much to crop the image from the top down as a fraction of picture size. OUString maLayoutFlowAlt; ///< Specifies the alternate layout flow for text in textboxes. + OUString maHyperlink; ///< The hyperlink assigned to the shape explicit ShapeTypeModel(); diff --git a/include/oox/vml/vmlshapecontext.hxx b/include/oox/vml/vmlshapecontext.hxx index ddca7b13ad93..0d4b3ddd9e7e 100644 --- a/include/oox/vml/vmlshapecontext.hxx +++ b/include/oox/vml/vmlshapecontext.hxx @@ -107,6 +107,8 @@ public: private: /** Processes the 'style' attribute. */ void setStyle( const OUString& rStyle ); + /** Processes the 'href' attribute. */ + void setHyperlink( const OUString& rHyperlink ); /** Resolve a relation identifier to a fragment path. */ OptValue< OUString > decodeFragmentPath( const AttributeList& rAttribs, sal_Int32 nToken ) const; diff --git a/include/svl/solar.hrc b/include/svl/solar.hrc index 521e24365f9f..5caeb64f40c2 100644 --- a/include/svl/solar.hrc +++ b/include/svl/solar.hrc @@ -23,7 +23,7 @@ // defines ------------------------------------------------------------------ #define OWN_ATTR_VALUE_START 3900 -#define OWN_ATTR_VALUE_END 4006 +#define OWN_ATTR_VALUE_END 4007 #define RID_LIB_START 10000 #define RID_LIB_END 19999 diff --git a/include/svx/svdobj.hxx b/include/svx/svdobj.hxx index 0960826d2c63..d7ccf830cf44 100644 --- a/include/svx/svdobj.hxx +++ b/include/svx/svdobj.hxx @@ -868,6 +868,9 @@ public: // If fillstyle is drawing::FillStyle_BITMAP, returns the graphic. const Graphic* getFillGraphic() const; + OUString getHyperlink() const { return msHyperlink; } + void setHyperlink(const OUString& sHyperlink) { msHyperlink = sHyperlink; } + protected: mutable tools::Rectangle m_aOutRect; // surrounding rectangle for Paint (incl. LineWidth, ...) Point m_aAnchor; // anchor position (Writer) @@ -971,6 +974,8 @@ private: // HACK: Do not automatically insert newly created object into a page. // The user needs to do it manually later. bool mbDoNotInsertIntoPageAutomatically; + // Hyperlink for the whole shape + OUString msHyperlink; // only for internal use! SvxShape* getSvxShape(); diff --git a/include/svx/unoshprp.hxx b/include/svx/unoshprp.hxx index 3f61ce77c6d1..750a245b29d4 100644 --- a/include/svx/unoshprp.hxx +++ b/include/svx/unoshprp.hxx @@ -195,7 +195,8 @@ #define OWN_ATTR_QRCODE (OWN_ATTR_VALUE_START+104) #define OWN_ATTR_TEXTFITTOSIZESCALE (OWN_ATTR_VALUE_START+105) #define OWN_ATTR_TEXTCOLUMNS (OWN_ATTR_VALUE_START+106) -// ATTENTION: current maximum is OWN_ATTR_VALUE_START+106 svx; wnen adding values, update +#define OWN_ATTR_HYPERLINK (OWN_ATTR_VALUE_START+107) +// ATTENTION: current maximum is OWN_ATTR_VALUE_START+107 svx; wnen adding values, update // OWN_ATTR_VALUE_END in include/svl/solar.hrc accordingly // #FontWork# @@ -358,7 +359,8 @@ { u"TextFitToSizeScale", OWN_ATTR_TEXTFITTOSIZESCALE, ::cppu::UnoType<sal_Int16>::get(), 0, 0}, \ /* #i68101# */ \ { u"" UNO_NAME_MISC_OBJ_TITLE, OWN_ATTR_MISC_OBJ_TITLE , ::cppu::UnoType<OUString>::get(), 0, 0}, \ - { u"" UNO_NAME_MISC_OBJ_DESCRIPTION, OWN_ATTR_MISC_OBJ_DESCRIPTION , ::cppu::UnoType<OUString>::get(), 0, 0}, + { u"" UNO_NAME_MISC_OBJ_DESCRIPTION, OWN_ATTR_MISC_OBJ_DESCRIPTION , ::cppu::UnoType<OUString>::get(), 0, 0}, \ + { u"" UNO_NAME_HYPERLINK, OWN_ATTR_HYPERLINK, ::cppu::UnoType<OUString>::get(), 0, 0}, #define LINKTARGET_PROPERTIES \ { u"" UNO_NAME_LINKDISPLAYNAME, OWN_ATTR_LDNAME , ::cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::READONLY, 0}, \ |