From 5d33f6634c5fb84cb2a801d7819c8affb031cc02 Mon Sep 17 00:00:00 2001 From: Markus Mohrhard Date: Wed, 27 May 2015 19:15:12 +0200 Subject: transform calc URLs to OOXML format, related tdf#91334 Change-Id: I497a6600e155200e913ed386a539f284a5c86320 --- oox/source/export/shapes.cxx | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'oox/source') diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx index debb5b70fed3..186f280b8e7a 100644 --- a/oox/source/export/shapes.cxx +++ b/oox/source/export/shapes.cxx @@ -107,6 +107,20 @@ using ::sax_fastparser::FSHelperPtr; namespace oox { namespace drawingml { +URLTransformer::~URLTransformer() +{ +} + +OUString URLTransformer::getTransformedString(const OUString& rString) const +{ + return rString; +} + +bool URLTransformer::isExternalURL(const OUString& /*rURL*/) const +{ + return true; +} + #define GETA(propName) \ GetProperty( rXPropSet, OUString(#propName)) @@ -130,6 +144,12 @@ ShapeExport::ShapeExport( sal_Int32 nXmlNamespace, FSHelperPtr pFS, ShapeHashMap , maMapModeDest( MAP_INCH, Point(), maFraction, maFraction ) , mpShapeMap( pShapeMap ? pShapeMap : &maShapeMap ) { + mpURLTransformer.reset(new URLTransformer); +} + +void ShapeExport::SetURLTranslator(std::shared_ptr pTransformer) +{ + mpURLTransformer = pTransformer; } awt::Size ShapeExport::MapSize( const awt::Size& rSize ) const @@ -445,7 +465,8 @@ ShapeExport& ShapeExport::WriteCustomShape( Reference< XShape > xShape ) { OUString sRelId = mpFB->addRelation( mpFS->getOutputStream(), "http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink", - sURL, true ); + mpURLTransformer->getTransformedString(sURL), + mpURLTransformer->isExternalURL(sURL)); mpFS->singleElementNS( XML_a, XML_hlinkClick, FSNS( XML_r,XML_id ), USS( sRelId ), -- cgit