diff options
author | yogesh.bharate001 <yogesh.bharate@synerzip.com> | 2015-04-27 19:28:54 +0530 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2015-04-28 10:14:22 +0000 |
commit | a7d843b6112250d1a41c2a56d8e083ccf6538bca (patch) | |
tree | 2e66ca07e903c436015fcdaa4f25d48cefd7723c /oox | |
parent | 11cac95f57c5e7836413a73667d74128c4afd3e7 (diff) |
tdf#90890: hyperlink inside textbox is not exported after roundtrip.
Problem Description:
- Text box hyperlink is not exported after roundtrip.
XML Difference: in drawing1.xml
Original file:
<xdr:cNvPr id="2" name="TextBox 1">
<a:hlinkClick xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" r:id="rId1" tooltip="text123"/>
</xdr:cNvPr>
After RT:
<xdr:cNvPr id="0" name="CustomShape 1"/>
<a:hlinkClick> is missing.
Change-Id: I01082de5d7d2e1a9323e84f54c97d5444cab13cd
Solution: Added support for hyperlink in text box.
Reviewed-on: https://gerrit.libreoffice.org/15555
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: David Tardon <dtardon@redhat.com>
Tested-by: David Tardon <dtardon@redhat.com>
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/export/shapes.cxx | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx index 7caf3e95af0c..349f39824639 100644 --- a/oox/source/export/shapes.cxx +++ b/oox/source/export/shapes.cxx @@ -419,10 +419,26 @@ ShapeExport& ShapeExport::WriteCustomShape( Reference< XShape > xShape ) if (GetDocumentType() != DOCUMENT_DOCX) { pFS->startElementNS( mnXmlNamespace, XML_nvSpPr, FSEND ); - pFS->singleElementNS( mnXmlNamespace, XML_cNvPr, + pFS->startElementNS( mnXmlNamespace, XML_cNvPr, XML_id, I32S( GetNewShapeID( xShape ) ), XML_name, IDS( CustomShape ), FSEND ); + + if( GETA( URL ) ) + { + OUString sURL; + mAny >>= sURL; + if( !sURL.isEmpty() ) { + OUString sRelId = mpFB->addRelation( mpFS->getOutputStream(), + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink", + sURL, true ); + + mpFS->singleElementNS( XML_a, XML_hlinkClick, + FSNS( XML_r,XML_id ), USS( sRelId ), + FSEND ); + } + } + pFS->endElementNS(mnXmlNamespace, XML_cNvPr); pFS->singleElementNS( mnXmlNamespace, XML_cNvSpPr, FSEND ); WriteNonVisualProperties( xShape ); pFS->endElementNS( mnXmlNamespace, XML_nvSpPr ); |