Kaydet (Commit) 51d1545e authored tarafından Jan Holesovsky's avatar Jan Holesovsky

writerfilter: Kill debug_logger.

Does not really log interesting stuff; if anybody wants some kind of logging
like this, better to use SAL_INFO(), and add it only for really interesting
stuff.

Change-Id: I11b4caa9660aaf1e70819322b7fc207a544ea3bb
üst 58d6e4fd
...@@ -81,11 +81,6 @@ sal_Bool WriterFilter::filter( const uno::Sequence< beans::PropertyValue >& aDes ...@@ -81,11 +81,6 @@ sal_Bool WriterFilter::filter( const uno::Sequence< beans::PropertyValue >& aDes
OUString sURL = aMediaDesc.getUnpackedValueOrDefault( utl::MediaDescriptor::PROP_URL(), OUString() ); OUString sURL = aMediaDesc.getUnpackedValueOrDefault( utl::MediaDescriptor::PROP_URL(), OUString() );
::std::string sURLc = OUStringToOString(sURL, RTL_TEXTENCODING_ASCII_US).getStr(); ::std::string sURLc = OUStringToOString(sURL, RTL_TEXTENCODING_ASCII_US).getStr();
writerfilter::TagLogger::Pointer_t debugLogger
(writerfilter::TagLogger::getInstance("DEBUG"));
debugLogger->setFileName(sURLc);
debugLogger->startDocument();
writerfilter::TagLogger::Pointer_t dmapperLogger writerfilter::TagLogger::Pointer_t dmapperLogger
(writerfilter::TagLogger::getInstance("DOMAINMAPPER")); (writerfilter::TagLogger::getInstance("DOMAINMAPPER"));
dmapperLogger->setFileName(sURLc); dmapperLogger->setFileName(sURLc);
...@@ -184,10 +179,9 @@ sal_Bool WriterFilter::filter( const uno::Sequence< beans::PropertyValue >& aDes ...@@ -184,10 +179,9 @@ sal_Bool WriterFilter::filter( const uno::Sequence< beans::PropertyValue >& aDes
} }
pStream.reset(); pStream.reset();
#ifdef DEBUG_IMPORT
#ifdef DEBUG_IMPORT
dmapperLogger->endDocument(); dmapperLogger->endDocument();
debugLogger->endDocument();
#endif #endif
return sal_True; return sal_True;
......
...@@ -31,7 +31,6 @@ ...@@ -31,7 +31,6 @@
#include "OOXMLBinaryObjectReference.hxx" #include "OOXMLBinaryObjectReference.hxx"
#include "OOXMLFastDocumentHandler.hxx" #include "OOXMLFastDocumentHandler.hxx"
#include "OOXMLPropertySetImpl.hxx" #include "OOXMLPropertySetImpl.hxx"
#include "ooxmlLoggers.hxx"
#include <tools/resmgr.hxx> #include <tools/resmgr.hxx>
#include <vcl/svapp.hxx> #include <vcl/svapp.hxx>
...@@ -48,10 +47,6 @@ namespace writerfilter { ...@@ -48,10 +47,6 @@ namespace writerfilter {
namespace ooxml namespace ooxml
{ {
#if OSL_DEBUG_LEVEL > 1
TagLogger::Pointer_t debug_logger(TagLogger::getInstance("DEBUG"));
#endif
OOXMLDocumentImpl::OOXMLDocumentImpl(OOXMLStream::Pointer_t pStream, const uno::Reference<task::XStatusIndicator>& xStatusIndicator) OOXMLDocumentImpl::OOXMLDocumentImpl(OOXMLStream::Pointer_t pStream, const uno::Reference<task::XStatusIndicator>& xStatusIndicator)
: mpStream(pStream) : mpStream(pStream)
, mxStatusIndicator(xStatusIndicator) , mxStatusIndicator(xStatusIndicator)
...@@ -284,12 +279,6 @@ writerfilter::Reference<Stream>::Pointer_t ...@@ -284,12 +279,6 @@ writerfilter::Reference<Stream>::Pointer_t
OOXMLDocumentImpl::getXNoteStream(OOXMLStream::StreamType_t nType, const Id & rType, OOXMLDocumentImpl::getXNoteStream(OOXMLStream::StreamType_t nType, const Id & rType,
const sal_Int32 nId) const sal_Int32 nId)
{ {
#ifdef DEBUG_ELEMENT
debug_logger->startElement("getXNoteStream");
debug_logger->attribute("id", nId);
debug_logger->endElement();
#endif
OOXMLStream::Pointer_t pStream = OOXMLStream::Pointer_t pStream =
(OOXMLDocumentFactory::createStream(mpStream, nType)); (OOXMLDocumentFactory::createStream(mpStream, nType));
// See above, no status indicator for the note stream, either. // See above, no status indicator for the note stream, either.
...@@ -445,10 +434,6 @@ void OOXMLDocumentImpl::resolveFooter(Stream & rStream, ...@@ -445,10 +434,6 @@ void OOXMLDocumentImpl::resolveFooter(Stream & rStream,
void OOXMLDocumentImpl::resolve(Stream & rStream) void OOXMLDocumentImpl::resolve(Stream & rStream)
{ {
#ifdef DEBUG_RESOLVE
debug_logger->startElement("OOXMLDocumentImpl.resolve");
#endif
uno::Reference< xml::sax::XFastParser > xParser uno::Reference< xml::sax::XFastParser > xParser
(mpStream->getFastParser()); (mpStream->getFastParser());
...@@ -517,18 +502,11 @@ void OOXMLDocumentImpl::resolve(Stream & rStream) ...@@ -517,18 +502,11 @@ void OOXMLDocumentImpl::resolve(Stream & rStream)
xParser->parseStream(aParserInput); xParser->parseStream(aParserInput);
} }
catch (...) { catch (...) {
#ifdef DEBUG_ELEMENT
debug_logger->element("exception");
#endif
} }
} }
if (mxStatusIndicator.is()) if (mxStatusIndicator.is())
mxStatusIndicator->end(); mxStatusIndicator->end();
#ifdef DEBUG_RESOLVE
debug_logger->endElement();
#endif
} }
void OOXMLDocumentImpl::incrementProgress() void OOXMLDocumentImpl::incrementProgress()
......
...@@ -125,14 +125,6 @@ void OOXMLFactory::attributes(OOXMLFastContextHandler * pHandler, ...@@ -125,14 +125,6 @@ void OOXMLFactory::attributes(OOXMLFastContextHandler * pHandler,
if (pFactory.get() != NULL) if (pFactory.get() != NULL)
{ {
#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);
debug_logger->attribute("define-num", sBuffer);
#endif
TokenToIdMapPointer pTokenToIdMap = pFactory->getTokenToIdMap(nDefine); TokenToIdMapPointer pTokenToIdMap = pFactory->getTokenToIdMap(nDefine);
AttributeToResourceMapPointer pMap = pFactory->getAttributeToResourceMap(nDefine); AttributeToResourceMapPointer pMap = pFactory->getAttributeToResourceMap(nDefine);
...@@ -142,22 +134,12 @@ void OOXMLFactory::attributes(OOXMLFastContextHandler * pHandler, ...@@ -142,22 +134,12 @@ void OOXMLFactory::attributes(OOXMLFastContextHandler * pHandler,
for (aIt = pMap->begin(); aIt != aEndIt; ++aIt) for (aIt = pMap->begin(); aIt != aEndIt; ++aIt)
{ {
Id nId = (*pTokenToIdMap)[aIt->first]; Id nId = (*pTokenToIdMap)[aIt->first];
#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);
debug_logger->attribute("tokenid-num", sBuffer);
#endif
if (Attribs->hasAttribute(aIt->first)) if (Attribs->hasAttribute(aIt->first))
{ {
switch (aIt->second.m_nResource) switch (aIt->second.m_nResource)
{ {
case RT_Boolean: case RT_Boolean:
{ {
#ifdef DEBUG_FACTORY
debug_logger->element("boolean");
#endif
OUString aValue(Attribs->getValue(aIt->first)); OUString aValue(Attribs->getValue(aIt->first));
OOXMLFastHelper<OOXMLBooleanValue>::newProperty(pHandler, nId, aValue); OOXMLFastHelper<OOXMLBooleanValue>::newProperty(pHandler, nId, aValue);
...@@ -167,9 +149,6 @@ void OOXMLFactory::attributes(OOXMLFastContextHandler * pHandler, ...@@ -167,9 +149,6 @@ void OOXMLFactory::attributes(OOXMLFastContextHandler * pHandler,
break; break;
case RT_String: case RT_String:
{ {
#ifdef DEBUG_FACTORY
debug_logger->element("string");
#endif
OUString aValue(Attribs->getValue(aIt->first)); OUString aValue(Attribs->getValue(aIt->first));
OOXMLFastHelper<OOXMLStringValue>::newProperty OOXMLFastHelper<OOXMLStringValue>::newProperty
(pHandler, nId, aValue); (pHandler, nId, aValue);
...@@ -180,9 +159,6 @@ void OOXMLFactory::attributes(OOXMLFastContextHandler * pHandler, ...@@ -180,9 +159,6 @@ void OOXMLFactory::attributes(OOXMLFastContextHandler * pHandler,
break; break;
case RT_Integer: case RT_Integer:
{ {
#ifdef DEBUG_FACTORY
debug_logger->element("integer");
#endif
OUString aValue(Attribs->getValue(aIt->first)); OUString aValue(Attribs->getValue(aIt->first));
OOXMLFastHelper<OOXMLIntegerValue>::newProperty OOXMLFastHelper<OOXMLIntegerValue>::newProperty
(pHandler, nId, aValue); (pHandler, nId, aValue);
...@@ -193,9 +169,6 @@ void OOXMLFactory::attributes(OOXMLFastContextHandler * pHandler, ...@@ -193,9 +169,6 @@ void OOXMLFactory::attributes(OOXMLFastContextHandler * pHandler,
break; break;
case RT_Hex: case RT_Hex:
{ {
#ifdef DEBUG_FACTORY
debug_logger->element("hex");
#endif
OUString aValue(Attribs->getValue(aIt->first)); OUString aValue(Attribs->getValue(aIt->first));
OOXMLFastHelper<OOXMLHexValue>::newProperty OOXMLFastHelper<OOXMLHexValue>::newProperty
(pHandler, nId, aValue); (pHandler, nId, aValue);
...@@ -206,9 +179,6 @@ void OOXMLFactory::attributes(OOXMLFastContextHandler * pHandler, ...@@ -206,9 +179,6 @@ void OOXMLFactory::attributes(OOXMLFastContextHandler * pHandler,
break; break;
case RT_UniversalMeasure: case RT_UniversalMeasure:
{ {
#ifdef DEBUG_FACTORY
debug_logger->element("universalMeasure");
#endif
OUString aValue(Attribs->getValue(aIt->first)); OUString aValue(Attribs->getValue(aIt->first));
OOXMLFastHelper<OOXMLUniversalMeasureValue>::newProperty(pHandler, nId, aValue); OOXMLFastHelper<OOXMLUniversalMeasureValue>::newProperty(pHandler, nId, aValue);
...@@ -218,9 +188,6 @@ void OOXMLFactory::attributes(OOXMLFastContextHandler * pHandler, ...@@ -218,9 +188,6 @@ void OOXMLFactory::attributes(OOXMLFastContextHandler * pHandler,
break; break;
case RT_List: case RT_List:
{ {
#ifdef DEBUG_FACTORY
debug_logger->startElement("list");
#endif
ListValueMapPointer pListValueMap = ListValueMapPointer pListValueMap =
pFactory->getListValueMap(aIt->second.m_nRef); pFactory->getListValueMap(aIt->second.m_nRef);
...@@ -229,37 +196,19 @@ void OOXMLFactory::attributes(OOXMLFastContextHandler * pHandler, ...@@ -229,37 +196,19 @@ void OOXMLFactory::attributes(OOXMLFastContextHandler * pHandler,
OUString aValue(Attribs->getValue(aIt->first)); OUString aValue(Attribs->getValue(aIt->first));
sal_uInt32 nValue = (*pListValueMap)[aValue]; sal_uInt32 nValue = (*pListValueMap)[aValue];
#ifdef DEBUG_FACTORY
debug_logger->attribute("value", aValue);
debug_logger->attribute("value-num", nValue);
#endif
OOXMLFastHelper<OOXMLIntegerValue>::newProperty OOXMLFastHelper<OOXMLIntegerValue>::newProperty
(pHandler, nId, nValue); (pHandler, nId, nValue);
OOXMLValue::Pointer_t pValue(new OOXMLIntegerValue(nValue)); OOXMLValue::Pointer_t pValue(new OOXMLIntegerValue(nValue));
pFactory->attributeAction(pHandler, aIt->first, pValue); pFactory->attributeAction(pHandler, aIt->first, pValue);
} }
#ifdef DEBUG_FACTORY
debug_logger->endElement();
#endif
} }
break; break;
default: default:
#ifdef DEBUG_FACTORY
debug_logger->element("unknown-attribute-type");
#endif
break; break;
} }
} }
#ifdef DEBUG_FACTORY
debug_logger->endElement();
#endif
} }
#ifdef DEBUG_FACTORY
debug_logger->endElement();
#endif
} }
} }
...@@ -267,11 +216,6 @@ uno::Reference< xml::sax::XFastContextHandler> ...@@ -267,11 +216,6 @@ uno::Reference< xml::sax::XFastContextHandler>
OOXMLFactory::createFastChildContext(OOXMLFastContextHandler * pHandler, OOXMLFactory::createFastChildContext(OOXMLFastContextHandler * pHandler,
Token_t Element) Token_t Element)
{ {
#ifdef DEBUG_FACTORY
debug_logger->startElement("factory.createFastChildContext");
debug_logger->attribute("token", fastTokenToId(Element));
#endif
Id nDefine = pHandler->getDefine(); Id nDefine = pHandler->getDefine();
OOXMLFactory_ns::Pointer_t pFactory = getFactoryForNamespace(nDefine); OOXMLFactory_ns::Pointer_t pFactory = getFactoryForNamespace(nDefine);
...@@ -282,21 +226,12 @@ OOXMLFactory::createFastChildContext(OOXMLFastContextHandler * pHandler, ...@@ -282,21 +226,12 @@ OOXMLFactory::createFastChildContext(OOXMLFastContextHandler * pHandler,
if ((Element & 0xffff) < OOXML_FAST_TOKENS_END) if ((Element & 0xffff) < OOXML_FAST_TOKENS_END)
ret = createFastChildContextFromFactory(pHandler, pFactory, Element); ret = createFastChildContextFromFactory(pHandler, pFactory, Element);
#ifdef DEBUG_FACTORY
debug_logger->endElement();
#endif
return ret; return ret;
} }
void OOXMLFactory::characters(OOXMLFastContextHandler * pHandler, void OOXMLFactory::characters(OOXMLFastContextHandler * pHandler,
const OUString & rString) const OUString & rString)
{ {
#ifdef DEBUG_FACTORY
debug_logger->startElement("factory.characters");
debug_logger->chars(rString);
#endif
Id nDefine = pHandler->getDefine(); Id nDefine = pHandler->getDefine();
OOXMLFactory_ns::Pointer_t pFactory = getFactoryForNamespace(nDefine); OOXMLFactory_ns::Pointer_t pFactory = getFactoryForNamespace(nDefine);
...@@ -304,10 +239,6 @@ void OOXMLFactory::characters(OOXMLFastContextHandler * pHandler, ...@@ -304,10 +239,6 @@ void OOXMLFactory::characters(OOXMLFastContextHandler * pHandler,
{ {
pFactory->charactersAction(pHandler, rString); pFactory->charactersAction(pHandler, rString);
} }
#ifdef DEBUG_FACTORY
debug_logger->endElement();
#endif
} }
void OOXMLFactory::startAction(OOXMLFastContextHandler * pHandler, Token_t /*nToken*/) void OOXMLFactory::startAction(OOXMLFastContextHandler * pHandler, Token_t /*nToken*/)
...@@ -317,13 +248,7 @@ void OOXMLFactory::startAction(OOXMLFastContextHandler * pHandler, Token_t /*nTo ...@@ -317,13 +248,7 @@ void OOXMLFactory::startAction(OOXMLFastContextHandler * pHandler, Token_t /*nTo
if (pFactory.get() != NULL) if (pFactory.get() != NULL)
{ {
#ifdef DEBUG_ELEMENT
debug_logger->startElement("factory.startAction");
#endif
pFactory->startAction(pHandler); pFactory->startAction(pHandler);
#ifdef DEBUG_ELEMENT
debug_logger->endElement();
#endif
} }
} }
...@@ -334,13 +259,7 @@ void OOXMLFactory::endAction(OOXMLFastContextHandler * pHandler, Token_t /*nToke ...@@ -334,13 +259,7 @@ void OOXMLFactory::endAction(OOXMLFastContextHandler * pHandler, Token_t /*nToke
if (pFactory.get() != NULL) if (pFactory.get() != NULL)
{ {
#ifdef DEBUG_ELEMENT
debug_logger->startElement("factory.endAction");
#endif
pFactory->endAction(pHandler); pFactory->endAction(pHandler);
#ifdef DEBUG_ELEMENT
debug_logger->endElement();
#endif
} }
} }
......
...@@ -243,10 +243,6 @@ protected: ...@@ -243,10 +243,6 @@ protected:
Id mnDefine; Id mnDefine;
Token_t mnToken; Token_t mnToken;
#ifdef DEBUG_CONTEXT_HANDLER
string msTokenString;
#endif
// the stream to send the stream events to. // the stream to send the stream events to.
Stream * mpStream; Stream * mpStream;
...@@ -274,10 +270,7 @@ protected: ...@@ -274,10 +270,7 @@ protected:
throw (uno::RuntimeException, xml::sax::SAXException); throw (uno::RuntimeException, xml::sax::SAXException);
void startAction(Token_t Element); void startAction(Token_t Element);
virtual void lcl_startAction(Token_t Element);
void endAction(Token_t Element); void endAction(Token_t Element);
virtual void lcl_endAction(Token_t Element);
virtual OOXMLPropertySet * getPicturePropSet virtual OOXMLPropertySet * getPicturePropSet
(const OUString & rId); (const OUString & rId);
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#include <iostream> #include <iostream>
#include <resourcemodel/QNameToString.hxx> #include <resourcemodel/QNameToString.hxx>
#include "OOXMLFastContextHandler.hxx" #include "OOXMLFastContextHandler.hxx"
#include "ooxmlLoggers.hxx"
namespace writerfilter { namespace writerfilter {
namespace ooxml namespace ooxml
...@@ -52,31 +52,12 @@ uno::Reference<css::xml::sax::XFastContextHandler> ...@@ -52,31 +52,12 @@ uno::Reference<css::xml::sax::XFastContextHandler>
OOXMLFastHelper<T>::createAndSetParentAndDefine OOXMLFastHelper<T>::createAndSetParentAndDefine
(OOXMLFastContextHandler * pHandler, sal_uInt32 nToken, Id nId, Id nDefine) (OOXMLFastContextHandler * pHandler, sal_uInt32 nToken, Id nId, Id nDefine)
{ {
#ifdef DEBUG_HELPER
debug_logger->startElement("helper.createAndSetParentAndDefine");
debug_logger->attribute("context", pHandler->getType());
debug_logger->attribute("id", (*QNameToString::Instance())(nId));
static char buffer[16];
snprintf(buffer, sizeof(buffer), "0x%08" SAL_PRIxUINT32, nId);
debug_logger->attribute("idnum", buffer);
#endif
OOXMLFastContextHandler * pTmp = new T(pHandler); OOXMLFastContextHandler * pTmp = new T(pHandler);
pTmp->setToken(nToken); pTmp->setToken(nToken);
pTmp->setId(nId); pTmp->setId(nId);
pTmp->setDefine(nDefine); pTmp->setDefine(nDefine);
#ifdef DEBUG_HELPER
debug_logger->startElement("created");
debug_logger->addTag(pTmp->toTag());
debug_logger->endElement("created");
debug_logger->endElement("helper.createAndSetParentAndDefine");
#endif
css::uno::Reference<css::xml::sax::XFastContextHandler> aResult(pTmp); css::uno::Reference<css::xml::sax::XFastContextHandler> aResult(pTmp);
return aResult; return aResult;
...@@ -89,26 +70,7 @@ void OOXMLFastHelper<T>::newProperty(OOXMLFastContextHandler * pHandler, ...@@ -89,26 +70,7 @@ void OOXMLFastHelper<T>::newProperty(OOXMLFastContextHandler * pHandler,
{ {
OOXMLValue::Pointer_t pVal(new T(rValue)); OOXMLValue::Pointer_t pVal(new T(rValue));
#ifdef DEBUG_HELPER
string aStr = (*QNameToString::Instance())(nId);
debug_logger->startElement("newProperty-from-string");
debug_logger->attribute("name", aStr);
debug_logger->attribute
("value",
OUStringToOString
(rValue, RTL_TEXTENCODING_ASCII_US).getStr());
if (aStr.empty())
debug_logger->element( "unknown-qname" );
#endif
pHandler->newProperty(nId, pVal); pHandler->newProperty(nId, pVal);
#ifdef DEBUG_HELPER
debug_logger->endElement();
#endif
} }
template <class T> template <class T>
...@@ -118,19 +80,6 @@ void OOXMLFastHelper<T>::newProperty(OOXMLFastContextHandler * pHandler, ...@@ -118,19 +80,6 @@ void OOXMLFastHelper<T>::newProperty(OOXMLFastContextHandler * pHandler,
{ {
OOXMLValue::Pointer_t pVal(new T(nVal)); OOXMLValue::Pointer_t pVal(new T(nVal));
#ifdef DEBUG_HELPER
string aStr = (*QNameToString::Instance())(nId);
debug_logger->startElement("helper.newProperty-from-int");
debug_logger->attribute("name", aStr);
debug_logger->attribute("value", pVal->toString());
if (aStr.empty())
debug_logger->element("unknown-qname");
debug_logger->endElement();
#endif
pHandler->newProperty(nId, pVal); pHandler->newProperty(nId, pVal);
} }
......
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
#include <stdio.h> #include <stdio.h>
#include <iostream> #include <iostream>
#include "OOXMLParserState.hxx" #include "OOXMLParserState.hxx"
#include "ooxmlLoggers.hxx"
namespace writerfilter { namespace writerfilter {
namespace ooxml namespace ooxml
...@@ -118,16 +117,8 @@ void OOXMLParserState::resolveCharacterProperties(Stream & rStream) ...@@ -118,16 +117,8 @@ void OOXMLParserState::resolveCharacterProperties(Stream & rStream)
{ {
if (mpCharacterProps.get() != NULL) if (mpCharacterProps.get() != NULL)
{ {
#ifdef DEBUG_PROPERTIES
debug_logger->startElement("resolveCharacterProperties");
#endif
rStream.props(mpCharacterProps); rStream.props(mpCharacterProps);
mpCharacterProps.reset(new OOXMLPropertySetImpl()); mpCharacterProps.reset(new OOXMLPropertySetImpl());
#ifdef DEBUG_PROPERTIES
debug_logger->endElement();
#endif
} }
} }
......
...@@ -23,7 +23,6 @@ ...@@ -23,7 +23,6 @@
#include <resourcemodel/QNameToString.hxx> #include <resourcemodel/QNameToString.hxx>
#include <com/sun/star/drawing/XShape.hpp> #include <com/sun/star/drawing/XShape.hpp>
#include <ooxml/OOXMLFastTokens.hxx> #include <ooxml/OOXMLFastTokens.hxx>
#include "ooxmlLoggers.hxx"
#include <ooxml/resourceids.hxx> #include <ooxml/resourceids.hxx>
namespace writerfilter { namespace writerfilter {
...@@ -401,28 +400,16 @@ OOXMLPropertySetImpl::~OOXMLPropertySetImpl() ...@@ -401,28 +400,16 @@ OOXMLPropertySetImpl::~OOXMLPropertySetImpl()
void OOXMLPropertySetImpl::resolve(Properties & rHandler) void OOXMLPropertySetImpl::resolve(Properties & rHandler)
{ {
size_t nIt = 0;
// The pProp->resolve(rHandler) call below can cause elements to // The pProp->resolve(rHandler) call below can cause elements to
// be appended to mProperties. I don't think it can cause elements // be appended to mProperties. I don't think it can cause elements
// to be deleted. But let's check with < here just to be safe that // to be deleted. But let's check with < here just to be safe that
// the indexing below works. // the indexing below works.
while (nIt < mProperties.size()) for (size_t nIt = 0; nIt < mProperties.size(); ++nIt)
{ {
OOXMLProperty::Pointer_t pProp = mProperties[nIt]; OOXMLProperty::Pointer_t pProp = mProperties[nIt];
if (pProp.get() != NULL) if (pProp.get() != NULL)
pProp->resolve(rHandler); pProp->resolve(rHandler);
#ifdef DEBUG_RESOLVE
else
{
debug_logger->startElement("error");
debug_logger->chars(std::string("zero-property"));
debug_logger->endElement();
}
#endif
++nIt;
} }
} }
...@@ -455,11 +442,6 @@ string OOXMLPropertySetImpl::getType() const ...@@ -455,11 +442,6 @@ string OOXMLPropertySetImpl::getType() const
void OOXMLPropertySetImpl::add(OOXMLProperty::Pointer_t pProperty) void OOXMLPropertySetImpl::add(OOXMLProperty::Pointer_t pProperty)
{ {
#ifdef DEBUG_PROPERTY_SET
debug_logger->startElement("propertyset.add");
debug_logger->chars(pProperty->toString());
#endif
if (pProperty.get() != NULL && pProperty->getId() != 0x0) if (pProperty.get() != NULL && pProperty->getId() != 0x0)
{ {
/* /*
...@@ -477,14 +459,6 @@ void OOXMLPropertySetImpl::add(OOXMLProperty::Pointer_t pProperty) ...@@ -477,14 +459,6 @@ void OOXMLPropertySetImpl::add(OOXMLProperty::Pointer_t pProperty)
else else
mProperties.push_back(pProperty); mProperties.push_back(pProperty);
} }
#ifdef DEBUG_PROPERTY_SET
else
{
debug_logger->element("warning.property_not_added");
}
debug_logger->endElement("propertyset.add");
#endif
} }
void OOXMLPropertySetImpl::add(OOXMLPropertySet::Pointer_t pPropertySet) void OOXMLPropertySetImpl::add(OOXMLPropertySet::Pointer_t pPropertySet)
......
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
#include "OOXMLStreamImpl.hxx" #include "OOXMLStreamImpl.hxx"
#include "OOXMLFastTokenHandler.hxx" #include "OOXMLFastTokenHandler.hxx"
#include "ooxmlLoggers.hxx"
#include <iostream> #include <iostream>
#include <com/sun/star/embed/XHierarchicalStorageAccess.hpp> #include <com/sun/star/embed/XHierarchicalStorageAccess.hpp>
...@@ -77,9 +76,6 @@ OOXMLStreamImpl::OOXMLStreamImpl ...@@ -77,9 +76,6 @@ OOXMLStreamImpl::OOXMLStreamImpl
OOXMLStreamImpl::~OOXMLStreamImpl() OOXMLStreamImpl::~OOXMLStreamImpl()
{ {
#ifdef DEBUG_STREAM
debug_logger->endElement("stream");
#endif
} }
const OUString & OOXMLStreamImpl::getTarget() const const OUString & OOXMLStreamImpl::getTarget() const
...@@ -364,10 +360,6 @@ void OOXMLStreamImpl::init() ...@@ -364,10 +360,6 @@ void OOXMLStreamImpl::init()
{ {
bool bFound = lcl_getTarget(mxRelationshipAccess, bool bFound = lcl_getTarget(mxRelationshipAccess,
mnStreamType, msId, msTarget); mnStreamType, msId, msTarget);
#ifdef DEBUG_STREAM
debug_logger->startElement("stream");
debug_logger->attribute("target", msTarget);
#endif
if (bFound) if (bFound)
{ {
......
...@@ -62,10 +62,6 @@ uno::Reference&lt; xml::sax::XFastContextHandler &gt; OOXMLFactory::createFastCh ...@@ -62,10 +62,6 @@ uno::Reference&lt; xml::sax::XFastContextHandler &gt; OOXMLFactory::createFastCh
uno::Reference &lt; xml::sax::XFastContextHandler &gt; aResult; uno::Reference &lt; xml::sax::XFastContextHandler &gt; aResult;
Id nDefine = pHandler->getDefine(); Id nDefine = pHandler->getDefine();
#ifdef DEBUG_FACTORY
debug_logger->startElement("factory.createFastChildContextFromFactory");
#endif
if (pFactory.get() != NULL) if (pFactory.get() != NULL)
{ {
CreateElementMapPointer pMap = pFactory-&gt;getCreateElementMap(nDefine); CreateElementMapPointer pMap = pFactory-&gt;getCreateElementMap(nDefine);
...@@ -74,25 +70,6 @@ uno::Reference&lt; xml::sax::XFastContextHandler &gt; OOXMLFactory::createFastCh ...@@ -74,25 +70,6 @@ uno::Reference&lt; xml::sax::XFastContextHandler &gt; OOXMLFactory::createFastCh
if (pMap.get() != NULL) if (pMap.get() != NULL)
{ {
Id nId = (*pTokenMap)[Element]; Id nId = (*pTokenMap)[Element];
#ifdef DEBUG_FACTORY
string sFactoryName(pFactory->getName());
string sDefine(pFactory->getDefineName(nDefine));
string sElement(fastTokenToId(Element));
string sQName((*QNameToString::Instance())(nId));
debug_logger->attribute("factory-name", sFactoryName);
debug_logger->attribute("define", sDefine);
debug_logger->attribute("element", sElement);
debug_logger->attribute("qname", sQName);
static char buffer[16];
snprintf(buffer, sizeof(buffer), "0x%08" SAL_PRIuUINT32, nId);
debug_logger->attribute("idnum", buffer);
snprintf(buffer, sizeof(buffer), "0x%08" SAL_PRIuUINT32, nDefine);
debug_logger->attribute("definenum", buffer);
#endif
CreateElement aCreateElement = (*pMap)[Element]; CreateElement aCreateElement = (*pMap)[Element];
switch (aCreateElement.m_nResource) switch (aCreateElement.m_nResource)
...@@ -127,10 +104,6 @@ uno::Reference&lt; xml::sax::XFastContextHandler &gt; OOXMLFactory::createFastCh ...@@ -127,10 +104,6 @@ uno::Reference&lt; xml::sax::XFastContextHandler &gt; OOXMLFactory::createFastCh
} }
} }
#ifdef DEBUG_FACTORY
debug_logger->endElement();
#endif
return aResult; return aResult;
} }
</xsl:text> </xsl:text>
...@@ -169,10 +142,6 @@ OOXMLFactory_ns::Pointer_t OOXMLFactory::getFactoryForNamespace(Id nId) ...@@ -169,10 +142,6 @@ OOXMLFactory_ns::Pointer_t OOXMLFactory::getFactoryForNamespace(Id nId)
uno::Reference&lt; xml::sax::XFastContextHandler &gt; OOXMLFactory::createFastChildContextFromStart uno::Reference&lt; xml::sax::XFastContextHandler &gt; OOXMLFactory::createFastChildContextFromStart
(OOXMLFastContextHandler * pHandler, Token_t Element) (OOXMLFastContextHandler * pHandler, Token_t Element)
{ {
#ifdef DEBUG_FACTORY
debug_logger->startElement("factory.createFastChildContextFromStart");
#endif
uno::Reference &lt; xml::sax::XFastContextHandler &gt; aResult; uno::Reference &lt; xml::sax::XFastContextHandler &gt; aResult;
OOXMLFactory_ns::Pointer_t pFactory; OOXMLFactory_ns::Pointer_t pFactory;
...@@ -189,9 +158,6 @@ uno::Reference&lt; xml::sax::XFastContextHandler &gt; OOXMLFactory::createFastCh ...@@ -189,9 +158,6 @@ uno::Reference&lt; xml::sax::XFastContextHandler &gt; OOXMLFactory::createFastCh
</xsl:for-each> </xsl:for-each>
<xsl:text> <xsl:text>
#ifdef DEBUG_FACTORY
debug_logger->endElement();
#endif
return aResult; return aResult;
} }
</xsl:text> </xsl:text>
......
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#ifndef INCLUDED_WRITERFILTER_SOURCE_OOXML_OOXMLLOGGERS_HXX
#define INCLUDED_WRITERFILTER_SOURCE_OOXML_OOXMLLOGGERS_HXX
#if OSL_DEBUG_LEVEL > 1
#include <resourcemodel/TagLogger.hxx>
namespace writerfilter {
namespace ooxml {
extern TagLogger::Pointer_t debug_logger;
}
}
#endif
#endif // INCLUDED_WRITERFILTER_SOURCE_OOXML_OOXMLLOGGERS_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment