summaryrefslogtreecommitdiff
path: root/writerfilter/source/ooxml/OOXMLFactory.cxx
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2014-08-03 00:56:26 +0200
committerJan Holesovsky <kendy@collabora.com>2014-08-03 01:43:12 +0200
commit7aa7047eb48e81bc0b32448ff0487c993fe9a4db (patch)
tree8a875da3e453a078dadead19ce145fcbd55ae22e /writerfilter/source/ooxml/OOXMLFactory.cxx
parent8dc2ab47b9e5ef0ff381575195a36ceec8789ef1 (diff)
writerfilter: Kill ListValueMap(s) & their construction.
ListValueMaps were completely useless; it is always just few values that used to be in the unordered_map, so doing just a normal comparison couldn't be too much worse than all the hash construction etc. This saves >300k of the libwriterfilter.so size (striped). If this proves to be less performing than what we used to have (which I doubt), now when we generate the code using Python, it would be a piece of cake to construct some deterministic finite automaton in each switch's case to accept the value names, and return the values. Change-Id: I95d0470b73ade1fbf5c9de2299c4adcc59286bc3
Diffstat (limited to 'writerfilter/source/ooxml/OOXMLFactory.cxx')
-rw-r--r--writerfilter/source/ooxml/OOXMLFactory.cxx16
1 files changed, 2 insertions, 14 deletions
diff --git a/writerfilter/source/ooxml/OOXMLFactory.cxx b/writerfilter/source/ooxml/OOXMLFactory.cxx
index afdadf194b44..5f8512fe4f2c 100644
--- a/writerfilter/source/ooxml/OOXMLFactory.cxx
+++ b/writerfilter/source/ooxml/OOXMLFactory.cxx
@@ -62,14 +62,6 @@ AttributeToResourceMapPointer OOXMLFactory_ns::getAttributeToResourceMap(Id nId)
return m_AttributesMap[nId];
}
-ListValueMapPointer OOXMLFactory_ns::getListValueMap(Id nId)
-{
- if (m_ListValuesMap.find(nId) == m_ListValuesMap.end())
- m_ListValuesMap[nId] = createListValueMap(nId);
-
- return m_ListValuesMap[nId];
-}
-
CreateElementMapPointer OOXMLFactory_ns::getCreateElementMap(Id nId)
{
if (m_CreateElementsMap.find(nId) == m_CreateElementsMap.end())
@@ -191,13 +183,9 @@ void OOXMLFactory::attributes(OOXMLFastContextHandler * pHandler,
break;
case RT_List:
{
- ListValueMapPointer pListValueMap =
- pFactory->getListValueMap(aIt->second.m_nRef);
-
- if (pListValueMap.get() != NULL)
+ sal_uInt32 nValue;
+ if (pFactory->getListValue(aIt->second.m_nRef, Attribs->getValue(nToken), nValue))
{
- OUString aValue(Attribs->getValue(nToken));
- sal_uInt32 nValue = (*pListValueMap)[aValue];
OOXMLValue::Pointer_t xValue = OOXMLIntegerValue::Create(nValue);
pHandler->newProperty(nId, xValue);
pFactory->attributeAction(pHandler, nToken, xValue);