Kaydet (Commit) 625c93a8 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Simplify MultiAtomProvider::getString

Change-Id: I3ba6f9c829200349a6404c2a155182b5c5c12cd7
üst 43cb629d
......@@ -47,7 +47,7 @@ namespace utl {
~AtomProvider();
int getAtom( const OUString&, bool bCreate = false );
const OUString& getString( int ) const;
OUString getString( int ) const;
};
class UNOTOOLS_DLLPUBLIC MultiAtomProvider
......@@ -59,7 +59,7 @@ namespace utl {
int getAtom( int atomClass, const OUString& rString, bool bCreate = false );
const OUString& getString( int atomClass, int atom ) const;
OUString getString( int atomClass, int atom ) const;
};
}
......
......@@ -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: */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment