From c51f77b1c02d03a4932d1b20ba6440465d265d48 Mon Sep 17 00:00:00 2001 From: Takeshi Abe Date: Fri, 10 Oct 2014 14:08:49 +0900 Subject: fdo#75757: remove inheritance to std::map MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit from oox::core::Relations. Change-Id: If2e0109a2ad6598436177b7638cb6d568fb2d3d6 Reviewed-on: https://gerrit.libreoffice.org/11899 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- oox/source/core/relations.cxx | 15 ++++++++------- oox/source/core/relationshandler.cxx | 2 +- 2 files changed, 9 insertions(+), 8 deletions(-) (limited to 'oox') diff --git a/oox/source/core/relations.cxx b/oox/source/core/relations.cxx index 4122678e5e01..5c75b3394cfe 100644 --- a/oox/source/core/relations.cxx +++ b/oox/source/core/relations.cxx @@ -52,20 +52,21 @@ OUString createOfficeDocRelationTypeStrict(const OUString& rType) } -Relations::Relations( const OUString& rFragmentPath ) : - maFragmentPath( rFragmentPath ) +Relations::Relations( const OUString& rFragmentPath ) + : maMap() + , maFragmentPath( rFragmentPath ) { } const Relation* Relations::getRelationFromRelId( const OUString& rId ) const { - const_iterator aIt = find( rId ); - return (aIt == end()) ? 0 : &aIt->second; + ::std::map< OUString, Relation >::const_iterator aIt = maMap.find( rId ); + return (aIt == maMap.end()) ? 0 : &aIt->second; } const Relation* Relations::getRelationFromFirstType( const OUString& rType ) const { - for( const_iterator aIt = begin(), aEnd = end(); aIt != aEnd; ++aIt ) + for( ::std::map< OUString, Relation >::const_iterator aIt = maMap.begin(), aEnd = maMap.end(); aIt != aEnd; ++aIt ) if( aIt->second.maType.equalsIgnoreAsciiCase( rType ) ) return &aIt->second; return 0; @@ -74,10 +75,10 @@ const Relation* Relations::getRelationFromFirstType( const OUString& rType ) con RelationsRef Relations::getRelationsFromTypeFromOfficeDoc( const OUString& rType ) const { RelationsRef xRelations( new Relations( maFragmentPath ) ); - for( const_iterator aIt = begin(), aEnd = end(); aIt != aEnd; ++aIt ) + for( ::std::map< OUString, Relation >::const_iterator aIt = maMap.begin(), aEnd = maMap.end(); aIt != aEnd; ++aIt ) if( aIt->second.maType.equalsIgnoreAsciiCase( createOfficeDocRelationTypeTransitional(rType) ) || aIt->second.maType.equalsIgnoreAsciiCase( createOfficeDocRelationTypeStrict(rType) )) - (*xRelations)[ aIt->first ] = aIt->second; + xRelations->maMap[ aIt->first ] = aIt->second; return xRelations; } diff --git a/oox/source/core/relationshandler.cxx b/oox/source/core/relationshandler.cxx index 20adc05cfb64..4802b8f83e05 100644 --- a/oox/source/core/relationshandler.cxx +++ b/oox/source/core/relationshandler.cxx @@ -76,7 +76,7 @@ Reference< XFastContextHandler > RelationsFragment::createFastChildContext( OSL_ENSURE( mxRelations->count( aRelation.maId ) == 0, "RelationsFragment::createFastChildContext - relation identifier exists already" ); - mxRelations->insert( Relations::value_type( aRelation.maId, aRelation ) ); + mxRelations->insert( ::std::map< OUString, Relation >::value_type( aRelation.maId, aRelation ) ); } } break; -- cgit v1.2.3