From d2c08569373551144b141bbdeea76894cf7fc82b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Wed, 5 Mar 2014 09:42:06 +0000 Subject: [PATCH] Revert "remove unused code oox::core::Relations::getRelationsFromType" we need it again now This reverts commit 77c45eb25eb462bacdf7d658d6cb485f755beaa5. Change-Id: I3e171d95e4f50c8e26824da2f6e6817d3b597d4d --- include/oox/core/relations.hxx | 1 + oox/source/core/relations.cxx | 9 +++++++++ oox/source/drawingml/shape.cxx | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/include/oox/core/relations.hxx b/include/oox/core/relations.hxx index bbe296883ba8..4254b99bac42 100644 --- a/include/oox/core/relations.hxx +++ b/include/oox/core/relations.hxx @@ -82,6 +82,7 @@ public: /** Returns the first relation with the passed type. */ const Relation* getRelationFromFirstTypeFromOfficeDoc( const OUString& rType ) const; /** Finds all relations associated with the passed type. */ + RelationsRef getRelationsFromType( const OUString& rType ) const; RelationsRef getRelationsFromTypeFromOfficeDoc( const OUString& rType ) const; /** Returns the external target of the relation with the passed relation identifier. */ diff --git a/oox/source/core/relations.cxx b/oox/source/core/relations.cxx index 4122678e5e01..d2e1b28190b2 100644 --- a/oox/source/core/relations.cxx +++ b/oox/source/core/relations.cxx @@ -71,6 +71,15 @@ const Relation* Relations::getRelationFromFirstType( const OUString& rType ) con return 0; } +RelationsRef Relations::getRelationsFromType( const OUString& rType ) const +{ + RelationsRef xRelations( new Relations( maFragmentPath ) ); + for( const_iterator aIt = begin(), aEnd = end(); aIt != aEnd; ++aIt ) + if( aIt->second.maType.equalsIgnoreAsciiCase( rType ) ) + (*xRelations)[ aIt->first ] = aIt->second; + return xRelations; +} + RelationsRef Relations::getRelationsFromTypeFromOfficeDoc( const OUString& rType ) const { RelationsRef xRelations( new Relations( maFragmentPath ) ); diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx index b40356a470a6..3a2ebae8ddb1 100644 --- a/oox/source/drawingml/shape.cxx +++ b/oox/source/drawingml/shape.cxx @@ -1208,7 +1208,7 @@ uno::Sequence< uno::Sequence< uno::Any > > Shape::resolveRelationshipsOfType(co core::RelationsRef xRels = rFilter.importRelations( sFragment ); if ( xRels ) { - core::RelationsRef xImageRels = xRels->getRelationsFromTypeFromOfficeDoc( sType ); + core::RelationsRef xImageRels = xRels->getRelationsFromType( sType ); if ( xImageRels ) { xRelListTemp.realloc( xImageRels->size() );