diff options
author | Jan Holesovsky <kendy@collabora.com> | 2014-08-03 00:56:26 +0200 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2014-08-03 20:46:51 +0200 |
commit | 1ae698ad63fc19d378519ee5361948963ee2af6c (patch) | |
tree | f2bafac670c26f62a4dcffc8cf591e039febf8bf /writerfilter/source/ooxml/OOXMLFactory.cxx | |
parent | 7d7118990810d094cd29b98a95b38b6374a4fe69 (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.cxx | 16 |
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); |