summaryrefslogtreecommitdiff
path: root/writerfilter/source/ooxml/OOXMLFactory.cxx
diff options
context:
space:
mode:
authorHenning Brinkmann <hbrinkm@openoffice.org>2010-08-10 17:14:42 +0200
committerHenning Brinkmann <hbrinkm@openoffice.org>2010-08-10 17:14:42 +0200
commite033f3a57542ebec0a0f1e5cb3685525c61c775a (patch)
tree0d934296be4c03336e305c2800094362c0f3a686 /writerfilter/source/ooxml/OOXMLFactory.cxx
parent60566277eb6bf40e9f72a95eed597d9b1b5d54dd (diff)
writerfilter09: ooxml: refactoring debug output
Diffstat (limited to 'writerfilter/source/ooxml/OOXMLFactory.cxx')
-rwxr-xr-xwriterfilter/source/ooxml/OOXMLFactory.cxx63
1 files changed, 43 insertions, 20 deletions
diff --git a/writerfilter/source/ooxml/OOXMLFactory.cxx b/writerfilter/source/ooxml/OOXMLFactory.cxx
index 964d9e1cb5ee..a99811bf03fb 100755
--- a/writerfilter/source/ooxml/OOXMLFactory.cxx
+++ b/writerfilter/source/ooxml/OOXMLFactory.cxx
@@ -129,8 +129,8 @@ void OOXMLFactory::attributes(OOXMLFastContextHandler * pHandler,
if (pFactory.get() != NULL)
{
-#ifdef DEBUG_ATTRIBUTES
- debug_logger->startElement("attributes");
+#ifdef DEBUG_FACTORY
+ debug_logger->startElement("factory.attributes");
debug_logger->attribute("define", pFactory->getDefineName(nDefine));
char sBuffer[256];
snprintf(sBuffer, sizeof(sBuffer), "%08" SAL_PRIxUINT32, nDefine);
@@ -146,8 +146,8 @@ void OOXMLFactory::attributes(OOXMLFastContextHandler * pHandler,
for (aIt = pMap->begin(); aIt != aEndIt; aIt++)
{
Id nId = (*pTokenToIdMap)[aIt->first];
-#ifdef DEBUG_ATTRIBUTES
- debug_logger->startElement("attribute");
+#ifdef DEBUG_FACTORY
+ debug_logger->startElement("factory.attribute");
debug_logger->attribute("name", fastTokenToId(aIt->first));
debug_logger->attribute("tokenid", (*QNameToString::Instance())(nId));
snprintf(sBuffer, sizeof(sBuffer), "%08" SAL_PRIxUINT32, nId);
@@ -159,7 +159,7 @@ void OOXMLFactory::attributes(OOXMLFastContextHandler * pHandler,
{
case RT_Boolean:
{
-#ifdef DEBUG_ATTRIBUTES
+#ifdef DEBUG_FACTORY
debug_logger->element("boolean");
#endif
::rtl::OUString aValue(Attribs->getValue(aIt->first));
@@ -171,7 +171,7 @@ void OOXMLFactory::attributes(OOXMLFastContextHandler * pHandler,
break;
case RT_String:
{
-#ifdef DEBUG_ATTRIBUTES
+#ifdef DEBUG_FACTORY
debug_logger->element("string");
#endif
::rtl::OUString aValue(Attribs->getValue(aIt->first));
@@ -184,7 +184,7 @@ void OOXMLFactory::attributes(OOXMLFastContextHandler * pHandler,
break;
case RT_Integer:
{
-#ifdef DEBUG_ATTRIBUTES
+#ifdef DEBUG_FACTORY
debug_logger->element("integer");
#endif
::rtl::OUString aValue(Attribs->getValue(aIt->first));
@@ -197,7 +197,7 @@ void OOXMLFactory::attributes(OOXMLFastContextHandler * pHandler,
break;
case RT_Hex:
{
-#ifdef DEBUG_ATTRIBUTES
+#ifdef DEBUG_FACTORY
debug_logger->element("hex");
#endif
::rtl::OUString aValue(Attribs->getValue(aIt->first));
@@ -210,7 +210,7 @@ void OOXMLFactory::attributes(OOXMLFastContextHandler * pHandler,
break;
case RT_List:
{
-#ifdef DEBUG_ATTRIBUTES
+#ifdef DEBUG_FACTORY
debug_logger->startElement("list");
#endif
ListValueMapPointer pListValueMap =
@@ -221,7 +221,7 @@ void OOXMLFactory::attributes(OOXMLFastContextHandler * pHandler,
::rtl::OUString aValue(Attribs->getValue(aIt->first));
sal_uInt32 nValue = (*pListValueMap)[aValue];
-#ifdef DEBUG_ATTRIBUTES
+#ifdef DEBUG_FACTORY
debug_logger->attribute("value", aValue);
debug_logger->attribute("value-num", nValue);
#endif
@@ -232,25 +232,25 @@ void OOXMLFactory::attributes(OOXMLFastContextHandler * pHandler,
OOXMLValue::Pointer_t pValue(new OOXMLIntegerValue(nValue));
pFactory->attributeAction(pHandler, aIt->first, pValue);
}
-#ifdef DEBUG_ATTRIBUTES
+#ifdef DEBUG_FACTORY
debug_logger->endElement("list");
#endif
}
break;
default:
-#ifdef DEBUG_ATTRIBUTES
+#ifdef DEBUG_FACTORY
debug_logger->element("unknown-attribute-type");
#endif
break;
}
}
-#ifdef DEBUG_ATTRIBUTES
- debug_logger->endElement("attribute");
+#ifdef DEBUG_FACTORY
+ debug_logger->endElement("factory.attribute");
#endif
}
-#ifdef DEBUG_ATTRIBUTES
- debug_logger->endElement("attributes");
+#ifdef DEBUG_FACTORY
+ debug_logger->endElement("factory.attributes");
#endif
}
}
@@ -259,6 +259,11 @@ uno::Reference< xml::sax::XFastContextHandler>
OOXMLFactory::createFastChildContext(OOXMLFastContextHandler * pHandler,
Token_t Element)
{
+#ifdef DEBUG_FACTORY
+ debug_logger->startElement("factory.createFastChildContext");
+ debug_logger->attribute("token", fastTokenToId(Element));
+#endif
+
Id nDefine = pHandler->getDefine();
OOXMLFactory_ns::Pointer_t pFactory = getFactoryForNamespace(nDefine);
@@ -269,12 +274,21 @@ OOXMLFactory::createFastChildContext(OOXMLFastContextHandler * pHandler,
if ((Element & 0xffff) < OOXML_FAST_TOKENS_END)
ret = createFastChildContextFromFactory(pHandler, pFactory, Element);
+#ifdef DEBUG_FACTORY
+ debug_logger->endElement("factory.createFastChildContext");
+#endif
+
return ret;
}
void OOXMLFactory::characters(OOXMLFastContextHandler * pHandler,
const ::rtl::OUString & rString)
{
+#ifdef DEBUG_FACTORY
+ debug_logger->startElement("factory.characters");
+ debug_logger->chars(rString);
+#endif
+
Id nDefine = pHandler->getDefine();
OOXMLFactory_ns::Pointer_t pFactory = getFactoryForNamespace(nDefine);
@@ -282,6 +296,10 @@ void OOXMLFactory::characters(OOXMLFastContextHandler * pHandler,
{
pFactory->charactersAction(pHandler, rString);
}
+
+#ifdef DEBUG_FACTORY
+ debug_logger->endElement("factory.characters");
+#endif
}
void OOXMLFactory::startAction(OOXMLFastContextHandler * pHandler, Token_t /*nToken*/)
@@ -292,11 +310,11 @@ void OOXMLFactory::startAction(OOXMLFastContextHandler * pHandler, Token_t /*nTo
if (pFactory.get() != NULL)
{
#ifdef DEBUG_ELEMENT
- debug_logger->startElement("factory-startAction");
+ debug_logger->startElement("factory.startAction");
#endif
pFactory->startAction(pHandler);
#ifdef DEBUG_ELEMENT
- debug_logger->endElement("factory-startAction");
+ debug_logger->endElement("factory.startAction");
#endif
}
}
@@ -309,11 +327,11 @@ void OOXMLFactory::endAction(OOXMLFastContextHandler * pHandler, Token_t /*nToke
if (pFactory.get() != NULL)
{
#ifdef DEBUG_ELEMENT
- debug_logger->startElement("factory-endAction");
+ debug_logger->startElement("factory.endAction");
#endif
pFactory->endAction(pHandler);
#ifdef DEBUG_ELEMENT
- debug_logger->endElement("factory-endAction");
+ debug_logger->endElement("factory.endAction");
#endif
}
}
@@ -334,6 +352,11 @@ void OOXMLFactory_ns::attributeAction(OOXMLFastContextHandler *, Token_t, OOXMLV
{
}
+string OOXMLFactory_ns::getName() const
+{
+ return "noname";
+}
+
}
}