summaryrefslogtreecommitdiff
path: root/writerfilter/source/ooxml/OOXMLFactory.cxx
diff options
context:
space:
mode:
authorhb <hbrinkm@openoffice.org>2009-09-24 17:23:47 +0200
committerhb <hbrinkm@openoffice.org>2009-09-24 17:23:47 +0200
commit5f2abc9e1456cd66f75ab5c925918fd7fd42e96b (patch)
treeede6f4afa781edafe4953a484468dfc2552116d8 /writerfilter/source/ooxml/OOXMLFactory.cxx
parent5719b030f82bde13188f375e4bd839b5ac31bf38 (diff)
new: AttributeInfo (contains resource type and rng:define for value of attribute)
new: use AttributeInfo to determine ListValueMap. new: handle all relevant resource types in OOXMLFactory::attributes
Diffstat (limited to 'writerfilter/source/ooxml/OOXMLFactory.cxx')
-rwxr-xr-xwriterfilter/source/ooxml/OOXMLFactory.cxx70
1 files changed, 68 insertions, 2 deletions
diff --git a/writerfilter/source/ooxml/OOXMLFactory.cxx b/writerfilter/source/ooxml/OOXMLFactory.cxx
index 5cdf4bb8dfae..a4063466f4a8 100755
--- a/writerfilter/source/ooxml/OOXMLFactory.cxx
+++ b/writerfilter/source/ooxml/OOXMLFactory.cxx
@@ -33,6 +33,16 @@
namespace writerfilter {
namespace ooxml {
+AttributeInfo::AttributeInfo()
+:m_nResource(RT_NoResource), m_nRef(0)
+{
+}
+
+AttributeInfo::AttributeInfo(ResourceType_t nResource, Id nRef)
+ :m_nResource(nResource), m_nRef(nRef)
+{
+}
+
CreateElement::CreateElement()
:m_nResource(RT_NoResource), m_nId(0)
{
@@ -145,22 +155,78 @@ void OOXMLFactory::attributes(OOXMLFastContextHandler * pHandler,
#endif
if (Attribs->hasAttribute(aIt->first))
{
- switch (aIt->second)
+ switch (aIt->second.m_nResource)
{
case RT_Boolean:
{
+#ifdef DEBUG_ATTRIBUTES
+ debug_logger->element("boolean");
+#endif
::rtl::OUString aValue(Attribs->getValue(aIt->first));
OOXMLFastHelper<OOXMLBooleanValue>::newProperty(pHandler, nId, aValue);
}
break;
case RT_String:
{
+#ifdef DEBUG_ATTRIBUTES
+ debug_logger->element("string");
+#endif
+ ::rtl::OUString aValue(Attribs->getValue(aIt->first));
+ OOXMLFastHelper<OOXMLStringValue>::newProperty
+ (pHandler, nId, aValue);
+
+ }
+ break;
+ case RT_Integer:
+ {
+#ifdef DEBUG_ATTRIBUTES
+ debug_logger->element("integer");
+#endif
+ ::rtl::OUString aValue(Attribs->getValue(aIt->first));
+ OOXMLFastHelper<OOXMLIntegerValue>::newProperty
+ (pHandler, nId, aValue);
+ }
+ break;
+ case RT_Hex:
+ {
+#ifdef DEBUG_ATTRIBUTES
+ debug_logger->element("hex");
+#endif
::rtl::OUString aValue(Attribs->getValue(aIt->first));
- OOXMLFastHelper<OOXMLStringValue>::newProperty(pHandler, nId, aValue);
+ OOXMLFastHelper<OOXMLHexValue>::newProperty
+ (pHandler, nId, aValue);
+ }
+ break;
+ case RT_List:
+ {
+#ifdef DEBUG_ATTRIBUTES
+ debug_logger->startElement("list");
+#endif
+ ListValueMapPointer pListValueMap =
+ pFactory->getListValueMap(aIt->second.m_nRef);
+
+ if (pListValueMap.get() != NULL)
+ {
+ ::rtl::OUString aValue(Attribs->getValue(aIt->first));
+ sal_uInt32 nValue = (*pListValueMap)[aValue];
+
+#ifdef DEBUG_ATTRIBUTES
+ debug_logger->attribute("value", aValue);
+ debug_logger->attribute("value-num", nValue);
+#endif
+ OOXMLFastHelper<OOXMLIntegerValue>::newProperty
+ (pHandler, nId, nValue);
+ }
+#ifdef DEBUG_ATTRIBUTES
+ debug_logger->endElement("list");
+#endif
}
break;
default:
+#ifdef DEBUG_ATTRIBUTES
+ debug_logger->element("unknown-attribute-type");
+#endif
break;
}
}