summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorNoel Power <noel.power@suse.com>2012-12-13 16:26:58 +0000
committerNoel Power <noel.power@suse.com>2012-12-14 11:57:01 +0000
commitc1638e418cfdffabef93bb358dcdd3ae239e3bcd (patch)
treea4c4de8c7a6fcc200cd83724d3f9ae5e008fc7f1 /oox
parente873bb38c2df729d8662d1b1a13d85ad98aa6950 (diff)
fix fdo#58237 import hyperlinks for shapes in xlsx documents
Change-Id: Ib0c661dbb3ce9a2f8c8d29707a1cf0c65aadc81f
Diffstat (limited to 'oox')
-rw-r--r--oox/inc/oox/core/relations.hxx2
-rw-r--r--oox/source/core/relations.cxx6
-rw-r--r--oox/source/drawingml/hyperlinkcontext.cxx5
3 files changed, 13 insertions, 0 deletions
diff --git a/oox/inc/oox/core/relations.hxx b/oox/inc/oox/core/relations.hxx
index e7d558b044ed..67f298e6dc9a 100644
--- a/oox/inc/oox/core/relations.hxx
+++ b/oox/inc/oox/core/relations.hxx
@@ -88,6 +88,8 @@ public:
/** Returns the external target of the relation with the passed relation identifier. */
::rtl::OUString getExternalTargetFromRelId( const ::rtl::OUString& rRelId ) const;
+ /** Returns the internal target of the relation with the passed relation identifier. */
+ ::rtl::OUString getInternalTargetFromRelId( const ::rtl::OUString& rRelId ) const;
/** Returns the full fragment path for the target of the passed relation. */
::rtl::OUString getFragmentPathFromRelation( const Relation& rRelation ) const;
diff --git a/oox/source/core/relations.cxx b/oox/source/core/relations.cxx
index ef9510ce54b7..ad39489671c0 100644
--- a/oox/source/core/relations.cxx
+++ b/oox/source/core/relations.cxx
@@ -92,6 +92,12 @@ OUString Relations::getExternalTargetFromRelId( const OUString& rRelId ) const
return (pRelation && pRelation->mbExternal) ? pRelation->maTarget : OUString();
}
+OUString Relations::getInternalTargetFromRelId( const OUString& rRelId ) const
+{
+ const Relation* pRelation = getRelationFromRelId( rRelId );
+ return (pRelation && !pRelation->mbExternal) ? pRelation->maTarget : OUString();
+}
+
OUString Relations::getFragmentPathFromRelation( const Relation& rRelation ) const
{
// no target, no fragment path
diff --git a/oox/source/drawingml/hyperlinkcontext.cxx b/oox/source/drawingml/hyperlinkcontext.cxx
index 06958aa13de8..ed03ddd8c362 100644
--- a/oox/source/drawingml/hyperlinkcontext.cxx
+++ b/oox/source/drawingml/hyperlinkcontext.cxx
@@ -59,6 +59,11 @@ HyperLinkContext::HyperLinkContext( ContextHandler& rParent,
OSL_TRACE("OOX: URI href %s", ::rtl::OUStringToOString (sHref, RTL_TEXTENCODING_UTF8).pData->buffer);
sURL = getFilter().getAbsoluteUrl( sHref );
}
+ else
+ {
+ // not sure if we also need to set sHref to the internal target
+ sURL = getRelations().getInternalTargetFromRelId( aRelId );
+ }
}
OUString sTooltip = xAttributes->getOptionalValue( R_TOKEN( tooltip ) );
if ( !sTooltip.isEmpty() )