Kaydet (Commit) 9a2dea06 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

dllexport class deriving from template means trouble with MSVC

Change-Id: I9d170168eac26c52fd6ca8d22124e8ff78b81226
üst 8b9207f4
......@@ -60,13 +60,9 @@ struct FWI_DLLPUBLIC ProtocolHandler
uno implementation names as value. Overloading of the index operator makes it possible
to search for a key by using a full qualified URL on list of all possible pattern keys.
*/
class FWI_DLLPUBLIC PatternHash : public std::unordered_map<OUString, OUString, OUStringHash>
{
/* interface */
public:
PatternHash::iterator findPatternKey( const OUString& sURL );
};
typedef std::unordered_map<OUString, OUString, OUStringHash> PatternHash;
FWI_DLLPUBLIC PatternHash::iterator findPatternKey(
PatternHash const & hash, const OUString& sURL);
/**
This hash holds protocol handler structs by her names.
......
......@@ -49,10 +49,12 @@ namespace framework{
@return An iterator which points to the found item inside the hash or PatternHash::end()
if no pattern match this given <var>sURL</var>.
*/
PatternHash::iterator PatternHash::findPatternKey( const OUString& sURL )
namespace {
PatternHash::const_iterator findPatternKey(PatternHash const * hash, const OUString& sURL)
{
PatternHash::iterator pItem = this->begin();
while( pItem!=this->end() )
auto pItem = hash->begin();
while( pItem!=hash->end() )
{
WildCard aPattern(pItem->first);
if (aPattern.Matches(sURL))
......@@ -62,6 +64,8 @@ PatternHash::iterator PatternHash::findPatternKey( const OUString& sURL )
return pItem;
}
}
/**
@short initialize static member of class HandlerCache
@descr We use a singleton pattern to implement this handler cache.
......@@ -131,7 +135,7 @@ bool HandlerCache::search( const OUString& sURL, ProtocolHandler* pReturn ) cons
SolarMutexGuard aGuard;
PatternHash::const_iterator pItem = m_pPattern->findPatternKey(sURL);
PatternHash::const_iterator pItem = findPatternKey(m_pPattern, sURL);
if (pItem!=m_pPattern->end())
{
*pReturn = (*m_pHandler)[pItem->second];
......
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