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 /sc | |
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 'sc')
-rw-r--r-- | sc/source/filter/xml/xmlexprt.cxx | 34 |
1 files changed, 1 insertions, 33 deletions
diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx index 28233c05fdd2..085d54dd1f07 100644 --- a/sc/source/filter/xml/xmlexprt.cxx +++ b/sc/source/filter/xml/xmlexprt.cxx @@ -3426,40 +3426,8 @@ void ScXMLExport::ExportShape(const uno::Reference < drawing::XShape >& xShape, } } if (!bIsChart) - { - OUString sHlink; - try - { - uno::Reference< beans::XPropertySet > xProps( xShape, uno::UNO_QUERY ); - if ( xProps.is() ) - xProps->getPropertyValue( SC_UNONAME_HYPERLINK ) >>= sHlink; - } - catch ( const beans::UnknownPropertyException& ) - { - // no hyperlink property - } - - std::unique_ptr< SvXMLElementExport > pDrawA; - // enclose shapes with <draw:a> element only if sHlink contains something - if ( !sHlink.isEmpty() ) - { - // need to get delete the attributes that are pre-loaded - // for the shape export ( otherwise they will become - // attributes of the draw:a element ) This *shouldn't* - // affect performance adversely as there are only a - // couple of attributes involved - uno::Reference< xml::sax::XAttributeList > xSaveAttribs( new SvXMLAttributeList( GetAttrList() ) ); - ClearAttrList(); - // Add Hlink - AddAttribute( XML_NAMESPACE_XLINK, XML_TYPE, XML_SIMPLE ); - AddAttribute( XML_NAMESPACE_XLINK, XML_HREF, sHlink); - pDrawA.reset( new SvXMLElementExport( *this, XML_NAMESPACE_DRAW, XML_A, false, false ) ); - // Attribute list has been cleared by previous operation - // re-add pre-loaded attributes - AddAttributeList( xSaveAttribs ); - } GetShapeExport()->exportShape(xShape, SEF_DEFAULT, pPoint); - } + IncrementProgressBar(false); } |