aboutsummaryrefslogtreecommitdiffstats
path: root/src/textPartFactory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/textPartFactory.cpp')
-rw-r--r--src/textPartFactory.cpp16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/textPartFactory.cpp b/src/textPartFactory.cpp
index c76697b2..2c910be0 100644
--- a/src/textPartFactory.cpp
+++ b/src/textPartFactory.cpp
@@ -49,18 +49,16 @@ textPartFactory* textPartFactory::getInstance()
}
-textPart* textPartFactory::create(const mediaType& type)
+ref <textPart> textPartFactory::create(const mediaType& type)
{
- NameMap::const_iterator pos = m_nameMap.find(type.generate());
-
- if (pos != m_nameMap.end())
- {
- return ((*pos).second)();
- }
- else
+ for (MapType::const_iterator it = m_map.begin() ;
+ it != m_map.end() ; ++it)
{
- throw exceptions::no_factory_available();
+ if ((*it).first == type)
+ return ((*it).second)();
}
+
+ throw exceptions::no_factory_available();
}