summaryrefslogtreecommitdiff
path: root/writerfilter/source/ooxml/OOXMLFactory.cxx
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2014-08-03 09:51:49 +0200
committerDavid Tardon <dtardon@redhat.com>2014-08-03 09:54:48 +0200
commit6528607d34c9a2098ff5eec051fc9299ec37dfd7 (patch)
tree0d45cfbd7a9a3f233060d8f2f76553c8b36a54ed /writerfilter/source/ooxml/OOXMLFactory.cxx
parent8cc566a536eb027bf5818c08526ce51632c63003 (diff)
Revert "writerfilter: Kill ListValueMap(s) & their construction."
Apparently there can be much more than "just a few values" in some cases (186 in OOXMLFactory_dml_shapeGeometry::getListValue) and MSVC compiler cannot handle if statement that deeply nested. This reverts commit 7aa7047eb48e81bc0b32448ff0487c993fe9a4db. Change-Id: I2b4d166e73ce1e616fea81fcfcfc9915c5784d30
Diffstat (limited to 'writerfilter/source/ooxml/OOXMLFactory.cxx')
-rw-r--r--writerfilter/source/ooxml/OOXMLFactory.cxx16
1 files changed, 14 insertions, 2 deletions
diff --git a/writerfilter/source/ooxml/OOXMLFactory.cxx b/writerfilter/source/ooxml/OOXMLFactory.cxx
index 5f8512fe4f2c..afdadf194b44 100644
--- a/writerfilter/source/ooxml/OOXMLFactory.cxx
+++ b/writerfilter/source/ooxml/OOXMLFactory.cxx
@@ -62,6 +62,14 @@ 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())
@@ -183,9 +191,13 @@ void OOXMLFactory::attributes(OOXMLFastContextHandler * pHandler,
break;
case RT_List:
{
- sal_uInt32 nValue;
- if (pFactory->getListValue(aIt->second.m_nRef, Attribs->getValue(nToken), nValue))
+ ListValueMapPointer pListValueMap =
+ pFactory->getListValueMap(aIt->second.m_nRef);
+
+ if (pListValueMap.get() != NULL)
{
+ 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);