diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-08-28 09:29:18 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-08-28 09:30:49 +0200 |
commit | 625c93a8daa2d23bfd42908e6fbba428d5967e84 (patch) | |
tree | 9c6e0f6222b20d40d040e0742546bec8a85f8819 /unotools | |
parent | 43cb629de1ecc41f702f14209ba8199dfe57c3a2 (diff) |
Simplify MultiAtomProvider::getString
Change-Id: I3ba6f9c829200349a6404c2a155182b5c5c12cd7
Diffstat (limited to 'unotools')
-rw-r--r-- | unotools/source/misc/atom.cxx | 10 |
1 files changed, 4 insertions, 6 deletions
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<int, OUString>::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<int, AtomProvider*>::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: */ |