summaryrefslogtreecommitdiff
path: root/unotools
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-08-28 09:46:57 +0200
committerStephan Bergmann <sbergman@redhat.com>2015-08-28 09:47:59 +0200
commit1b9c3a17e8496aedfb80528c5275e6658154789d (patch)
tree69407fe156f15c60bb6e926355155229522b0e6f /unotools
parent02d87840558523370d552ef452f1660300d161b5 (diff)
Revert "Simplify MultiAtomProvider::getString"
This reverts commit 625c93a8daa2d23bfd42908e6fbba428d5967e84, causes problems in (Linux-only) callers.
Diffstat (limited to 'unotools')
-rw-r--r--unotools/source/misc/atom.cxx10
1 files changed, 6 insertions, 4 deletions
diff --git a/unotools/source/misc/atom.cxx b/unotools/source/misc/atom.cxx
index 44ad7564ed30..85ddad4d23a9 100644
--- a/unotools/source/misc/atom.cxx
+++ b/unotools/source/misc/atom.cxx
@@ -45,11 +45,12 @@ int AtomProvider::getAtom( const OUString& rString, bool bCreate )
return m_nAtoms-1;
}
-OUString AtomProvider::getString( int nAtom ) const
+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() ? OUString() : it->second;
+ return it == m_aStringMap.end() ? aEmpty : it->second;
}
MultiAtomProvider::MultiAtomProvider()
@@ -78,14 +79,15 @@ int MultiAtomProvider::getAtom( int atomClass, const OUString& rString, bool bCr
return INVALID_ATOM;
}
-OUString MultiAtomProvider::getString( int atomClass, int atom ) const
+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 );
- return OUString();
+ static OUString aEmpty;
+ return aEmpty;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */