From 625c93a8daa2d23bfd42908e6fbba428d5967e84 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Fri, 28 Aug 2015 09:29:18 +0200 Subject: Simplify MultiAtomProvider::getString Change-Id: I3ba6f9c829200349a6404c2a155182b5c5c12cd7 --- unotools/source/misc/atom.cxx | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'unotools') diff --git a/unotools/source/misc/atom.cxx b/unotools/source/misc/atom.cxx index 85ddad4d23a9..44ad7564ed30 100644 --- a/unotools/source/misc/atom.cxx +++ b/unotools/source/misc/atom.cxx @@ -45,12 +45,11 @@ int AtomProvider::getAtom( const OUString& rString, bool bCreate ) return m_nAtoms-1; } -const OUString& AtomProvider::getString( int nAtom ) const +OUString AtomProvider::getString( int nAtom ) const { - static OUString aEmpty; std::unordered_map::const_iterator it = m_aStringMap.find( nAtom ); - return it == m_aStringMap.end() ? aEmpty : it->second; + return it == m_aStringMap.end() ? OUString() : it->second; } MultiAtomProvider::MultiAtomProvider() @@ -79,15 +78,14 @@ int MultiAtomProvider::getAtom( int atomClass, const OUString& rString, bool bCr return INVALID_ATOM; } -const OUString& MultiAtomProvider::getString( int atomClass, int atom ) const +OUString MultiAtomProvider::getString( int atomClass, int atom ) const { std::unordered_map::const_iterator it = m_aAtomLists.find( atomClass ); if( it != m_aAtomLists.end() ) return it->second->getString( atom ); - static OUString aEmpty; - return aEmpty; + return OUString(); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit