diff options
-rw-r--r-- | writerfilter/source/filter/ImportFilter.cxx | 8 | ||||
-rw-r--r-- | writerfilter/source/ooxml/OOXMLDocumentImpl.cxx | 22 | ||||
-rw-r--r-- | writerfilter/source/ooxml/OOXMLFactory.cxx | 81 | ||||
-rw-r--r-- | writerfilter/source/ooxml/OOXMLFastContextHandler.cxx | 425 | ||||
-rw-r--r-- | writerfilter/source/ooxml/OOXMLFastContextHandler.hxx | 7 | ||||
-rw-r--r-- | writerfilter/source/ooxml/OOXMLFastHelper.hxx | 53 | ||||
-rw-r--r-- | writerfilter/source/ooxml/OOXMLParserState.cxx | 9 | ||||
-rw-r--r-- | writerfilter/source/ooxml/OOXMLPropertySetImpl.cxx | 28 | ||||
-rw-r--r-- | writerfilter/source/ooxml/OOXMLStreamImpl.cxx | 8 | ||||
-rw-r--r-- | writerfilter/source/ooxml/factoryimpl.xsl | 34 | ||||
-rw-r--r-- | writerfilter/source/ooxml/ooxmlLoggers.hxx | 35 |
11 files changed, 4 insertions, 706 deletions
diff --git a/writerfilter/source/filter/ImportFilter.cxx b/writerfilter/source/filter/ImportFilter.cxx index 353565ff9b37..14d5877434a3 100644 --- a/writerfilter/source/filter/ImportFilter.cxx +++ b/writerfilter/source/filter/ImportFilter.cxx @@ -81,11 +81,6 @@ sal_Bool WriterFilter::filter( const uno::Sequence< beans::PropertyValue >& aDes OUString sURL = aMediaDesc.getUnpackedValueOrDefault( utl::MediaDescriptor::PROP_URL(), OUString() ); ::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::getInstance("DOMAINMAPPER")); dmapperLogger->setFileName(sURLc); @@ -184,10 +179,9 @@ sal_Bool WriterFilter::filter( const uno::Sequence< beans::PropertyValue >& aDes } pStream.reset(); -#ifdef DEBUG_IMPORT +#ifdef DEBUG_IMPORT dmapperLogger->endDocument(); - debugLogger->endDocument(); #endif return sal_True; diff --git a/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx b/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx index 5b45c82ab571..aca59c1d3a3f 100644 --- a/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx +++ b/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx @@ -31,7 +31,6 @@ #include "OOXMLBinaryObjectReference.hxx" #include "OOXMLFastDocumentHandler.hxx" #include "OOXMLPropertySetImpl.hxx" -#include "ooxmlLoggers.hxx" #include <tools/resmgr.hxx> #include <vcl/svapp.hxx> @@ -48,10 +47,6 @@ namespace writerfilter { 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) : mpStream(pStream) , mxStatusIndicator(xStatusIndicator) @@ -284,12 +279,6 @@ writerfilter::Reference<Stream>::Pointer_t OOXMLDocumentImpl::getXNoteStream(OOXMLStream::StreamType_t nType, const Id & rType, const sal_Int32 nId) { -#ifdef DEBUG_ELEMENT - debug_logger->startElement("getXNoteStream"); - debug_logger->attribute("id", nId); - debug_logger->endElement(); -#endif - OOXMLStream::Pointer_t pStream = (OOXMLDocumentFactory::createStream(mpStream, nType)); // See above, no status indicator for the note stream, either. @@ -445,10 +434,6 @@ void OOXMLDocumentImpl::resolveFooter(Stream & rStream, void OOXMLDocumentImpl::resolve(Stream & rStream) { -#ifdef DEBUG_RESOLVE - debug_logger->startElement("OOXMLDocumentImpl.resolve"); -#endif - uno::Reference< xml::sax::XFastParser > xParser (mpStream->getFastParser()); @@ -517,18 +502,11 @@ void OOXMLDocumentImpl::resolve(Stream & rStream) xParser->parseStream(aParserInput); } catch (...) { -#ifdef DEBUG_ELEMENT - debug_logger->element("exception"); -#endif } } if (mxStatusIndicator.is()) mxStatusIndicator->end(); - -#ifdef DEBUG_RESOLVE - debug_logger->endElement(); -#endif } void OOXMLDocumentImpl::incrementProgress() diff --git a/writerfilter/source/ooxml/OOXMLFactory.cxx b/writerfilter/source/ooxml/OOXMLFactory.cxx index 1f778c3295a3..834d7a686dd8 100644 --- a/writerfilter/source/ooxml/OOXMLFactory.cxx +++ b/writerfilter/source/ooxml/OOXMLFactory.cxx @@ -125,14 +125,6 @@ void OOXMLFactory::attributes(OOXMLFastContextHandler * pHandler, 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); AttributeToResourceMapPointer pMap = pFactory->getAttributeToResourceMap(nDefine); @@ -142,22 +134,12 @@ void OOXMLFactory::attributes(OOXMLFastContextHandler * pHandler, for (aIt = pMap->begin(); aIt != aEndIt; ++aIt) { 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)) { switch (aIt->second.m_nResource) { case RT_Boolean: { -#ifdef DEBUG_FACTORY - debug_logger->element("boolean"); -#endif OUString aValue(Attribs->getValue(aIt->first)); OOXMLFastHelper<OOXMLBooleanValue>::newProperty(pHandler, nId, aValue); @@ -167,9 +149,6 @@ void OOXMLFactory::attributes(OOXMLFastContextHandler * pHandler, break; case RT_String: { -#ifdef DEBUG_FACTORY - debug_logger->element("string"); -#endif OUString aValue(Attribs->getValue(aIt->first)); OOXMLFastHelper<OOXMLStringValue>::newProperty (pHandler, nId, aValue); @@ -180,9 +159,6 @@ void OOXMLFactory::attributes(OOXMLFastContextHandler * pHandler, break; case RT_Integer: { -#ifdef DEBUG_FACTORY - debug_logger->element("integer"); -#endif OUString aValue(Attribs->getValue(aIt->first)); OOXMLFastHelper<OOXMLIntegerValue>::newProperty (pHandler, nId, aValue); @@ -193,9 +169,6 @@ void OOXMLFactory::attributes(OOXMLFastContextHandler * pHandler, break; case RT_Hex: { -#ifdef DEBUG_FACTORY - debug_logger->element("hex"); -#endif OUString aValue(Attribs->getValue(aIt->first)); OOXMLFastHelper<OOXMLHexValue>::newProperty (pHandler, nId, aValue); @@ -206,9 +179,6 @@ void OOXMLFactory::attributes(OOXMLFastContextHandler * pHandler, break; case RT_UniversalMeasure: { -#ifdef DEBUG_FACTORY - debug_logger->element("universalMeasure"); -#endif OUString aValue(Attribs->getValue(aIt->first)); OOXMLFastHelper<OOXMLUniversalMeasureValue>::newProperty(pHandler, nId, aValue); @@ -218,9 +188,6 @@ void OOXMLFactory::attributes(OOXMLFastContextHandler * pHandler, break; case RT_List: { -#ifdef DEBUG_FACTORY - debug_logger->startElement("list"); -#endif ListValueMapPointer pListValueMap = pFactory->getListValueMap(aIt->second.m_nRef); @@ -229,37 +196,19 @@ void OOXMLFactory::attributes(OOXMLFastContextHandler * pHandler, OUString aValue(Attribs->getValue(aIt->first)); sal_uInt32 nValue = (*pListValueMap)[aValue]; -#ifdef DEBUG_FACTORY - debug_logger->attribute("value", aValue); - debug_logger->attribute("value-num", nValue); -#endif - OOXMLFastHelper<OOXMLIntegerValue>::newProperty (pHandler, nId, nValue); OOXMLValue::Pointer_t pValue(new OOXMLIntegerValue(nValue)); pFactory->attributeAction(pHandler, aIt->first, pValue); } -#ifdef DEBUG_FACTORY - debug_logger->endElement(); -#endif } break; default: -#ifdef DEBUG_FACTORY - debug_logger->element("unknown-attribute-type"); -#endif break; } } -#ifdef DEBUG_FACTORY - debug_logger->endElement(); -#endif } - -#ifdef DEBUG_FACTORY - debug_logger->endElement(); -#endif } } @@ -267,11 +216,6 @@ 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); @@ -282,21 +226,12 @@ OOXMLFactory::createFastChildContext(OOXMLFastContextHandler * pHandler, if ((Element & 0xffff) < OOXML_FAST_TOKENS_END) ret = createFastChildContextFromFactory(pHandler, pFactory, Element); -#ifdef DEBUG_FACTORY - debug_logger->endElement(); -#endif - return ret; } void OOXMLFactory::characters(OOXMLFastContextHandler * pHandler, const 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); @@ -304,10 +239,6 @@ void OOXMLFactory::characters(OOXMLFastContextHandler * pHandler, { pFactory->charactersAction(pHandler, rString); } - -#ifdef DEBUG_FACTORY - debug_logger->endElement(); -#endif } void OOXMLFactory::startAction(OOXMLFastContextHandler * pHandler, Token_t /*nToken*/) @@ -317,13 +248,7 @@ void OOXMLFactory::startAction(OOXMLFastContextHandler * pHandler, Token_t /*nTo if (pFactory.get() != NULL) { -#ifdef DEBUG_ELEMENT - debug_logger->startElement("factory.startAction"); -#endif pFactory->startAction(pHandler); -#ifdef DEBUG_ELEMENT - debug_logger->endElement(); -#endif } } @@ -334,13 +259,7 @@ void OOXMLFactory::endAction(OOXMLFastContextHandler * pHandler, Token_t /*nToke if (pFactory.get() != NULL) { -#ifdef DEBUG_ELEMENT - debug_logger->startElement("factory.endAction"); -#endif pFactory->endAction(pHandler); -#ifdef DEBUG_ELEMENT - debug_logger->endElement(); -#endif } } diff --git a/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx b/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx index cd71adbb9443..4fb0d49dd2a1 100644 --- a/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx +++ b/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx @@ -38,7 +38,6 @@ #include "OOXMLFastContextHandler.hxx" #include "OOXMLFactory.hxx" #include "Handler.hxx" -#include "ooxmlLoggers.hxx" static const sal_Unicode uCR = 0xd; static const sal_Unicode uFtnEdnRef = 0x2; @@ -219,17 +218,6 @@ void SAL_CALL OOXMLFastContextHandler::startFastElement const uno::Reference< xml::sax::XFastAttributeList > & Attribs) throw (uno::RuntimeException, xml::sax::SAXException, std::exception) { -#ifdef DEBUG_CONTEXT_HANDLER - debug_logger->startElement("contexthandler.element"); - string sToken = fastTokenToId(Element); - mpParserState->getXPathLogger().startElement(sToken); - debug_logger->attribute("token", sToken); - debug_logger->attribute("type", getType()); - debug_logger->attribute("xpath", mpParserState->getXPathLogger().getXPath()); - debug_logger->startElement("at-start"); - dumpXml( debug_logger ); - debug_logger->endElement(); -#endif if (oox::getNamespace(Element) == static_cast<sal_Int32>(NS_mce)) m_bDiscardChildren = prepareMceContext(Element, Attribs); @@ -241,29 +229,15 @@ void SAL_CALL OOXMLFastContextHandler::startFastElement } void SAL_CALL OOXMLFastContextHandler::startUnknownElement -(const OUString & Namespace, const OUString & Name, +(const OUString & /*Namespace*/, const OUString & /*Name*/, const uno::Reference< xml::sax::XFastAttributeList > & /*Attribs*/) throw (uno::RuntimeException, xml::sax::SAXException, std::exception) { -#ifdef DEBUG_CONTEXT_HANDLER - debug_logger->startElement("contexthandler.unknown-element"); - debug_logger->attribute("namespace", Namespace); - debug_logger->attribute("name", Name); - mpParserState->getXPathLogger().startElement("unknown"); -#else - (void) Namespace; - (void) Name; -#endif } void SAL_CALL OOXMLFastContextHandler::endFastElement(Token_t Element) throw (uno::RuntimeException, xml::sax::SAXException, std::exception) { -#ifdef DEBUG_CONTEXT_HANDLER - string sToken = fastTokenToId(Element); - (void) sToken; -#endif - if (Element == (NS_mce | OOXML_Choice) || Element == (NS_mce | OOXML_Fallback)) m_bDiscardChildren = false; else if (Element == (NS_mce | OOXML_AlternateContent)) @@ -273,17 +247,8 @@ throw (uno::RuntimeException, xml::sax::SAXException, std::exception) m_bDiscardChildren = aState.m_bDiscardChildren; m_bTookChoice = aState.m_bTookChoice; } - else if (!m_bDiscardChildren) lcl_endFastElement(Element); - -#ifdef DEBUG_CONTEXT_HANDLER - debug_logger->startElement("at-end"); - dumpXml( debug_logger ); - debug_logger->endElement(); - debug_logger->endElement(); - mpParserState->getXPathLogger().endElement(); -#endif } void OOXMLFastContextHandler::lcl_startFastElement @@ -310,10 +275,6 @@ void SAL_CALL OOXMLFastContextHandler::endUnknownElement (const OUString & , const OUString & ) throw (uno::RuntimeException, xml::sax::SAXException, std::exception) { -#ifdef DEBUG_CONTEXT_HANDLER - debug_logger->endElement(); - mpParserState->getXPathLogger().endElement(); -#endif } uno::Reference< xml::sax::XFastContextHandler > SAL_CALL @@ -322,23 +283,12 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL const uno::Reference< xml::sax::XFastAttributeList > & Attribs) throw (uno::RuntimeException, xml::sax::SAXException, std::exception) { -#ifdef DEBUG_CONTEXT_HANDLER - debug_logger->startElement("contexthandler.createFastChildContext"); - debug_logger->attribute("token", fastTokenToId(Element)); - debug_logger->attribute("type", getType()); - debug_logger->attribute("discard-children", OUString::number(m_bDiscardChildren)); -#endif - uno::Reference< xml::sax::XFastContextHandler > xResult; if ((Element & 0xffff0000) != NS_mce && !m_bDiscardChildren) xResult.set(lcl_createFastChildContext(Element, Attribs)); else if ((Element & 0xffff0000) == NS_mce) xResult = this; -#ifdef DEBUG_CONTEXT_HANDLER - debug_logger->endElement(); -#endif - return xResult; } @@ -358,16 +308,6 @@ OOXMLFastContextHandler::createUnknownChildContext const uno::Reference< xml::sax::XFastAttributeList > & /*Attribs*/) throw (uno::RuntimeException, xml::sax::SAXException, std::exception) { -#ifdef DEBUG_CONTEXT_HANDLER - debug_logger->startElement("contexthandler.createUnknownChildContext"); - debug_logger->attribute("namespace", Namespace); - debug_logger->attribute("name", Name); - debug_logger->endElement(); -#else - (void) Namespace; - (void) Name; -#endif - return uno::Reference< xml::sax::XFastContextHandler > (new OOXMLFastContextHandler(*const_cast<const OOXMLFastContextHandler *>(this))); } @@ -430,33 +370,11 @@ void OOXMLFastContextHandler::attributes void OOXMLFastContextHandler::startAction(Token_t Element) { -#ifdef DEBUG_CONTEXT_HANDLER - debug_logger->startElement("contexthandler.startAction"); -#endif - lcl_startAction(Element); -#ifdef DEBUG_CONTEXT_HANDLER - debug_logger->endElement(); -#endif -} - -void OOXMLFastContextHandler::lcl_startAction(Token_t Element) -{ OOXMLFactory::getInstance()->startAction(this, Element); } void OOXMLFastContextHandler::endAction(Token_t Element) { -#ifdef DEBUG_CONTEXT_HANDLER - debug_logger->startElement("contexthandler.endAction"); -#endif - lcl_endAction(Element); -#ifdef DEBUG_CONTEXT_HANDLER - debug_logger->endElement(); -#endif -} - -void OOXMLFastContextHandler::lcl_endAction(Token_t Element) -{ OOXMLFactory::getInstance()->endAction(this, Element); } @@ -493,17 +411,6 @@ void OOXMLFastContextHandler::dumpXml( const TagLogger::Pointer_t pLogger ) cons void OOXMLFastContextHandler::setId(Id rId) { -#ifdef DEBUG_CONTEXT_HANDLER - debug_logger->startElement("contexthandler.setId"); - - static char sBuffer[256]; - snprintf(sBuffer, sizeof(sBuffer), "%" SAL_PRIuUINT32, rId); - - debug_logger->attribute("id", std::string(sBuffer)); - debug_logger->attribute("name", (*QNameToString::Instance())(rId)); - debug_logger->endElement(); -#endif - mId = rId; } @@ -526,10 +433,6 @@ OOXMLParserState::Pointer_t OOXMLFastContextHandler::getParserState() const void OOXMLFastContextHandler::setToken(Token_t nToken) { mnToken = nToken; - -#ifdef DEBUG_CONTEXT_HANDLER - msTokenString = fastTokenToId(mnToken); -#endif } Token_t OOXMLFastContextHandler::getToken() const @@ -551,10 +454,6 @@ OOXMLPropertySet * OOXMLFastContextHandler::getPicturePropSet void OOXMLFastContextHandler::sendTableDepth() const { -#ifdef DEBUG_CONTEXT_HANDLER - debug_logger->startElement("contexthandler.sendTableDepth"); -#endif - if (mnTableDepth > 0) { OOXMLPropertySet * pProps = new OOXMLPropertySetImpl(); @@ -575,9 +474,6 @@ void OOXMLFastContextHandler::sendTableDepth() const mpStream->props(writerfilter::Reference<Properties>::Pointer_t(pProps)); } -#ifdef DEBUG_CONTEXT_HANDLER - debug_logger->endElement(); -#endif } void OOXMLFastContextHandler::setHandle() @@ -588,10 +484,6 @@ void OOXMLFastContextHandler::setHandle() void OOXMLFastContextHandler::startCharacterGroup() { -#ifdef DEBUG_CONTEXT_HANDLER - debug_logger->element("contexthandler.startCharacterGroup"); -#endif - if (isForwardEvents()) { if (mpParserState->isInCharacterGroup()) @@ -611,10 +503,6 @@ void OOXMLFastContextHandler::startCharacterGroup() void OOXMLFastContextHandler::endCharacterGroup() { -#ifdef DEBUG_CONTEXT_HANDLER - debug_logger->element("contexthandler.endCharacterGroup"); -#endif - if (isForwardEvents() && mpParserState->isInCharacterGroup()) { mpStream->endCharacterGroup(); @@ -624,10 +512,6 @@ void OOXMLFastContextHandler::endCharacterGroup() void OOXMLFastContextHandler::startParagraphGroup() { -#ifdef DEBUG_CONTEXT_HANDLER - debug_logger->element("contexthandler.startParagraphGroup"); -#endif - if (isForwardEvents()) { if (mpParserState->isInParagraphGroup()) @@ -646,10 +530,6 @@ void OOXMLFastContextHandler::startParagraphGroup() void OOXMLFastContextHandler::endParagraphGroup() { -#ifdef DEBUG_CONTEXT_HANDLER - debug_logger->element("contexthandler.endParagraphGroup"); -#endif - if (isForwardEvents()) { if (mpParserState->isInCharacterGroup()) @@ -665,10 +545,6 @@ void OOXMLFastContextHandler::endParagraphGroup() void OOXMLFastContextHandler::startSdt() { -#ifdef DEBUG_CONTEXT_HANDLER - debug_logger->element("contexthandler.startSdt"); -#endif - OOXMLPropertySet * pProps = new OOXMLPropertySetImpl(); OOXMLValue::Pointer_t pVal(new OOXMLIntegerValue(1)); OOXMLProperty::Pointer_t pProp(new OOXMLPropertyImpl(NS_ooxml::LN_CT_SdtBlock_sdtContent, pVal, OOXMLPropertyImpl::ATTRIBUTE)); @@ -678,10 +554,6 @@ void OOXMLFastContextHandler::startSdt() void OOXMLFastContextHandler::endSdt() { -#ifdef DEBUG_CONTEXT_HANDLER - debug_logger->element("contexthandler.endSdt"); -#endif - OOXMLPropertySet * pProps = new OOXMLPropertySetImpl(); OOXMLValue::Pointer_t pVal(new OOXMLIntegerValue(1)); OOXMLProperty::Pointer_t pProp(new OOXMLPropertyImpl(NS_ooxml::LN_CT_SdtBlock_sdtEndContent, pVal, OOXMLPropertyImpl::ATTRIBUTE)); @@ -691,10 +563,6 @@ void OOXMLFastContextHandler::endSdt() void OOXMLFastContextHandler::startSectionGroup() { -#ifdef DEBUG_CONTEXT_HANDLER - debug_logger->element("contexthandler.startSectionGroup"); -#endif - if (isForwardEvents()) { if (mpParserState->isInSectionGroup()) @@ -711,10 +579,6 @@ void OOXMLFastContextHandler::startSectionGroup() void OOXMLFastContextHandler::endSectionGroup() { -#ifdef DEBUG_CONTEXT_HANDLER - debug_logger->element("contexthandler.endSectionGroup"); -#endif - if (isForwardEvents()) { if (mpParserState->isInParagraphGroup()) @@ -751,9 +615,6 @@ OOXMLPropertySet::Pointer_t OOXMLFastContextHandler::getPropertySet() const void OOXMLFastContextHandler::startField() { -#ifdef DEBUG_CONTEXT_HANDLER - debug_logger->element("contexthandler.startField"); -#endif startCharacterGroup(); if (isForwardEvents()) mpStream->text(&cFieldStart, 1); @@ -762,9 +623,6 @@ void OOXMLFastContextHandler::startField() void OOXMLFastContextHandler::fieldSeparator() { -#ifdef DEBUG_CONTEXT_HANDLER - debug_logger->element("contexthandler.fieldSeparator"); -#endif startCharacterGroup(); if (isForwardEvents()) mpStream->text(&cFieldSep, 1); @@ -773,9 +631,6 @@ void OOXMLFastContextHandler::fieldSeparator() void OOXMLFastContextHandler::endField() { -#ifdef DEBUG_CONTEXT_HANDLER - debug_logger->element("contexthandler.endField"); -#endif startCharacterGroup(); if (isForwardEvents()) mpStream->text(&cFieldEnd, 1); @@ -784,82 +639,54 @@ void OOXMLFastContextHandler::endField() void OOXMLFastContextHandler::ftnednref() { -#ifdef DEBUG_CONTEXT_HANDLER - debug_logger->element("contexthandler.ftnednref"); -#endif if (isForwardEvents()) mpStream->utext((const sal_uInt8*)&uFtnEdnRef, 1); } void OOXMLFastContextHandler::ftnednsep() { -#ifdef DEBUG_CONTEXT_HANDLER - debug_logger->element("contexthandler.ftnednsep"); -#endif if (isForwardEvents()) mpStream->utext((const sal_uInt8*)&uFtnEdnSep, 1); } void OOXMLFastContextHandler::ftnedncont() { -#ifdef DEBUG_CONTEXT_HANDLER - debug_logger->element("contexthandler.ftnedncont"); -#endif if (isForwardEvents()) mpStream->text(&cFtnEdnCont, 1); } void OOXMLFastContextHandler::pgNum() { -#ifdef DEBUG_CONTEXT_HANDLER - debug_logger->element("contexthandler.pgNum"); -#endif if (isForwardEvents()) mpStream->utext((const sal_uInt8*)&uPgNum, 1); } void OOXMLFastContextHandler::tab() { -#ifdef DEBUG_CONTEXT_HANDLER - debug_logger->element("contexthandler.tab"); -#endif if (isForwardEvents()) mpStream->utext((const sal_uInt8*)&uTab, 1); } void OOXMLFastContextHandler::cr() { -#ifdef DEBUG_CONTEXT_HANDLER - debug_logger->element("contexthandler.cr"); -#endif if (isForwardEvents()) mpStream->utext((const sal_uInt8*)&uCR, 1); } void OOXMLFastContextHandler::noBreakHyphen() { -#ifdef DEBUG_CONTEXT_HANDLER - debug_logger->element("contexthandler.noBreakHyphen"); -#endif if (isForwardEvents()) mpStream->utext((const sal_uInt8*)&uNoBreakHyphen, 1); } void OOXMLFastContextHandler::softHyphen() { -#ifdef DEBUG_CONTEXT_HANDLER - debug_logger->element("contexthandler.softHyphen"); -#endif if (isForwardEvents()) mpStream->utext((const sal_uInt8*)&uSoftHyphen, 1); } void OOXMLFastContextHandler::handleLastParagraphInSection() { -#ifdef DEBUG_CONTEXT_HANDLER - debug_logger->element("contexthandler.handleLastParagraphInSection"); -#endif - if (mpParserState->isLastParagraphInSection()) { mpParserState->setLastParagraphInSection(false); @@ -869,9 +696,6 @@ void OOXMLFastContextHandler::handleLastParagraphInSection() void OOXMLFastContextHandler::endOfParagraph() { -#ifdef DEBUG_CONTEXT_HANDLER - debug_logger->element("contexthandler.endOfParagraph"); -#endif if (! mpParserState->isInCharacterGroup()) startCharacterGroup(); if (isForwardEvents()) @@ -882,9 +706,6 @@ void OOXMLFastContextHandler::endOfParagraph() void OOXMLFastContextHandler::startTxbxContent() { -#ifdef DEBUG_CONTEXT_HANDLER - debug_logger->element("contexthandler.startTxbxContent"); -#endif /* This usually means there are recursive <w:p> elements, and the ones inside and outside of w:txbxContent should not interfere (e.g. @@ -899,20 +720,12 @@ void OOXMLFastContextHandler::startTxbxContent() void OOXMLFastContextHandler::endTxbxContent() { -#ifdef DEBUG_CONTEXT_HANDLER - debug_logger->element("contexthandler.endTxbxContent"); -#endif endParagraphGroup(); mpParserState->endTxbxContent(); } void OOXMLFastContextHandler::text(const OUString & sText) { -#ifdef DEBUG_CONTEXT_HANDLER - debug_logger->startElement("contexthandler.text"); - debug_logger->chars(sText); - debug_logger->endElement(); -#endif if (isForwardEvents()) mpStream->utext(reinterpret_cast < const sal_uInt8 * > (sText.getStr()), @@ -931,69 +744,35 @@ void OOXMLFastContextHandler::text(const OUString & sText) */ void OOXMLFastContextHandler::positionOffset(const OUString & sText) { -#ifdef DEBUG_ELEMENT - debug_logger->startElement("positionOffset"); - debug_logger->chars(sText); - debug_logger->endElement(); -#endif if (isForwardEvents()) ::writerfilter::dmapper::PositionHandler::setPositionOffset( sText, inPositionV ); } void OOXMLFastContextHandler::alignH(const OUString & sText) { -#ifdef DEBUG_ELEMENT - debug_logger->startElement("alignH"); - debug_logger->chars(sText); - debug_logger->endElement(); -#endif if (isForwardEvents()) ::writerfilter::dmapper::PositionHandler::setAlignH( sText ); } void OOXMLFastContextHandler::alignV(const OUString & sText) { -#ifdef DEBUG_ELEMENT - debug_logger->startElement("alignV"); - debug_logger->chars(sText); - debug_logger->endElement(); -#endif if (isForwardEvents()) ::writerfilter::dmapper::PositionHandler::setAlignV( sText ); } void OOXMLFastContextHandler::positivePercentage(const OUString& rText) { -#ifdef DEBUG_ELEMENT - debug_logger->startElement("positivePercentage"); - debug_logger->chars(rText); - debug_logger->endElement(); -#endif if (isForwardEvents()) mpStream->positivePercentage(rText); } void OOXMLFastContextHandler::propagateCharacterProperties() { -#ifdef DEBUG_CONTEXT_HANDLER - debug_logger->startElement("contexthandler.propagateCharacterProperties"); - debug_logger->propertySet(getPropertySet(), - IdToString::Pointer_t(new OOXMLIdToString())); - debug_logger->endElement(); -#endif - mpParserState->setCharacterProperties(getPropertySet()); } void OOXMLFastContextHandler::propagateCharacterPropertiesAsSet(const Id & rId) { -#ifdef DEBUG_CONTEXT_HANDLER - debug_logger->startElement("contexthandler.propagateCharacterPropertiesAsSet"); - debug_logger->propertySet(getPropertySet(), - IdToString::Pointer_t(new OOXMLIdToString())); - debug_logger->endElement(); -#endif - OOXMLValue::Pointer_t pValue(new OOXMLPropertySetValue(getPropertySet())); OOXMLPropertySet::Pointer_t pPropertySet(new OOXMLPropertySetImpl()); @@ -1011,91 +790,44 @@ bool OOXMLFastContextHandler::propagatesProperties() const void OOXMLFastContextHandler::propagateCellProperties() { -#ifdef DEBUG_CONTEXT_HANDLER - debug_logger->element("contexthandler.propagateCellProperties"); -#endif - mpParserState->setCellProperties(getPropertySet()); } void OOXMLFastContextHandler::propagateRowProperties() { -#ifdef DEBUG_CONTEXT_HANDLER - debug_logger->element("contexthandler.propagateRowProperties"); -#endif - mpParserState->setRowProperties(getPropertySet()); } void OOXMLFastContextHandler::propagateTableProperties() { OOXMLPropertySet::Pointer_t pProps = getPropertySet(); -#ifdef DEBUG_CONTEXT_HANDLER - debug_logger->startElement("contexthandler.propagateTableProperties"); - debug_logger->propertySet(getPropertySet(), - IdToString::Pointer_t(new OOXMLIdToString())); - debug_logger->endElement(); -#endif mpParserState->setTableProperties(pProps); } void OOXMLFastContextHandler::sendCellProperties() { -#ifdef DEBUG_CONTEXT_HANDLER - debug_logger->startElement("contexthandler.sendCellProperties"); -#endif - mpParserState->resolveCellProperties(*mpStream); - -#ifdef DEBUG_CONTEXT_HANDLER - debug_logger->endElement(); -#endif } void OOXMLFastContextHandler::sendRowProperties() { -#ifdef DEBUG_CONTEXT_HANDLER - debug_logger->startElement("contexthandler.sendRowProperties"); -#endif - mpParserState->resolveRowProperties(*mpStream); - -#ifdef DEBUG_CONTEXT_HANDLER - debug_logger->endElement(); -#endif } void OOXMLFastContextHandler::sendTableProperties() { -#ifdef DEBUG_CONTEXT_HANDLER - debug_logger->startElement("contexthandler.sendTableProperties"); -#endif - mpParserState->resolveTableProperties(*mpStream); - -#ifdef DEBUG_CONTEXT_HANDLER - debug_logger->endElement(); -#endif } void OOXMLFastContextHandler::clearTableProps() { -#ifdef DEBUG_CONTEXT_HANDLER - debug_logger->element("contexthandler.clearTableProps"); -#endif - mpParserState->setTableProperties(OOXMLPropertySet::Pointer_t (new OOXMLPropertySetImpl())); } void OOXMLFastContextHandler::sendPropertiesWithId(const Id & rId) { -#ifdef DEBUG_CONTEXT_HANDLER - debug_logger->startElement("contexthandler.sendPropertiesWithId"); - debug_logger->attribute("id", fastTokenToId(rId)); -#endif - OOXMLValue::Pointer_t pValue(new OOXMLPropertySetValue(getPropertySet())); OOXMLPropertySet::Pointer_t pPropertySet(new OOXMLPropertySetImpl()); @@ -1104,20 +836,10 @@ void OOXMLFastContextHandler::sendPropertiesWithId(const Id & rId) pPropertySet->add(pProp); mpStream->props(pPropertySet); - -#ifdef DEBUG_CONTEXT_HANDLER - debug_logger->propertySet(getPropertySet(), - IdToString::Pointer_t(new OOXMLIdToString())); - debug_logger->endElement(); -#endif } void OOXMLFastContextHandler::clearProps() { -#ifdef DEBUG_CONTEXT_HANDLER - debug_logger->element("contexthandler.clearProps"); -#endif - setPropertySet(OOXMLPropertySet::Pointer_t(new OOXMLPropertySetImpl())); } @@ -1149,17 +871,6 @@ OOXMLDocumentImpl* OOXMLFastContextHandler::getDocument() void OOXMLFastContextHandler::setForwardEvents(bool bForwardEvents) { -#ifdef DEBUG_CONTEXT_HANDLER - debug_logger->startElement("contexthandler.setForwardEvents"); - - if (bForwardEvents) - debug_logger->chars(std::string("true")); - else - debug_logger->chars(std::string("false")); - - debug_logger->endElement(); -#endif - mpParserState->setForwardEvents(bForwardEvents); } @@ -1246,10 +957,6 @@ void OOXMLFastContextHandler::resolvePropertySetAttrs() void OOXMLFastContextHandler::sendPropertyToParent() { -#ifdef DEBUG_CONTEXT_HANDLER - debug_logger->element("sendPropertyToParent"); -#endif - if (mpParent != NULL) { OOXMLPropertySet::Pointer_t pProps(mpParent->getPropertySet()); @@ -1266,9 +973,6 @@ void OOXMLFastContextHandler::sendPropertyToParent() void OOXMLFastContextHandler::sendPropertiesToParent() { -#ifdef DEBUG_CONTEXT_HANDLER - debug_logger->startElement("contexthandler.sendPropertiesToParent"); -#endif if (mpParent != NULL) { OOXMLPropertySet::Pointer_t pParentProps(mpParent->getPropertySet()); @@ -1291,9 +995,6 @@ void OOXMLFastContextHandler::sendPropertiesToParent() } } } -#ifdef DEBUG_CONTEXT_HANDLER - debug_logger->endElement(); -#endif } uno::Reference< uno::XComponentContext > @@ -1331,13 +1032,6 @@ void OOXMLFastContextHandlerStream::newProperty(const Id & rId, void OOXMLFastContextHandlerStream::sendProperty(Id nId) { -#ifdef DEBUG_CONTEXT_HANDLER - debug_logger->startElement("contexthandler.sendProperty"); - debug_logger->attribute("id", (*QNameToString::Instance())(nId)); - debug_logger->chars(xmlify(getPropertySetAttrs()->toString())); - debug_logger->endElement(); -#endif - OOXMLPropertySetEntryToString aHandler(nId); getPropertySetAttrs()->resolve(aHandler); const OUString & sText = aHandler.getString(); @@ -1354,11 +1048,6 @@ OOXMLFastContextHandlerStream::getPropertySetAttrs() const void OOXMLFastContextHandlerStream::resolvePropertySetAttrs() { -#ifdef DEBUG_CONTEXT_HANDLER - debug_logger->startElement("contexthandler.resolvePropertySetAttrs"); - debug_logger->chars(mpPropertySetAttrs->toString()); - debug_logger->endElement(); -#endif mpStream->props(mpPropertySetAttrs); } @@ -1502,40 +1191,24 @@ void OOXMLFastContextHandlerProperties::handleHdrFtr() void OOXMLFastContextHandlerProperties::handleComment() { -#ifdef DEBUG_ELEMENT - debug_logger->element("handleComment"); -#endif - OOXMLCommentHandler aCommentHandler(this); getPropertySet()->resolve(aCommentHandler); } void OOXMLFastContextHandlerProperties::handlePicture() { -#ifdef DEBUG_ELEMENT - debug_logger->element("handlePicture"); -#endif - OOXMLPictureHandler aPictureHandler(this); getPropertySet()->resolve(aPictureHandler); } void OOXMLFastContextHandlerProperties::handleBreak() { -#ifdef DEBUG_ELEMENT - debug_logger->element("handleBreak"); -#endif - OOXMLBreakHandler aBreakHandler(*mpStream); getPropertySet()->resolve(aBreakHandler); } void OOXMLFastContextHandlerProperties::handleOLE() { -#ifdef DEBUG_ELEMENT - debug_logger->element("handleOLE"); -#endif - OOXMLOLEHandler aOLEHandler(this); getPropertySet()->resolve(aOLEHandler); } @@ -1549,12 +1222,6 @@ void OOXMLFastContextHandlerProperties::handleFontRel() void OOXMLFastContextHandlerProperties::setParent (OOXMLFastContextHandler * pParent) { -#ifdef DEBUG_ELEMENT - debug_logger->startElement("setParent"); - debug_logger->chars(std::string("OOXMLFastContextHandlerProperties")); - debug_logger->endElement(); -#endif - OOXMLFastContextHandler::setParent(pParent); if (mpParent->getResource() == STREAM) @@ -1600,12 +1267,6 @@ void OOXMLFastContextHandlerPropertyTable::lcl_endFastElement writerfilter::Reference<Table>::Pointer_t pTable(mTable.clone()); -#ifdef DEBUG_PROPERTIES - debug_logger->startElement("table"); - debug_logger->attribute("id", (*QNameToString::Instance())(mId)); - debug_logger->endElement(); -#endif - mpStream->table(mId, pTable); endAction(Element); @@ -1627,16 +1288,7 @@ OOXMLFastContextHandlerValue::~OOXMLFastContextHandlerValue() void OOXMLFastContextHandlerValue::setValue(OOXMLValue::Pointer_t pValue) { -#ifdef DEBUG_CONTEXT_HANDLER - debug_logger->startElement("contexthandler.setValue"); - debug_logger->attribute("value", pValue->toString()); -#endif - mpValue = pValue; - -#ifdef DEBUG_CONTEXT_HANDLER - debug_logger->endElement(); -#endif } OOXMLValue::Pointer_t OOXMLFastContextHandlerValue::getValue() const @@ -1655,10 +1307,6 @@ throw (uno::RuntimeException, xml::sax::SAXException) void OOXMLFastContextHandlerValue::setDefaultBooleanValue() { -#ifdef DEBUG_ELEMENT - debug_logger->element("setDefaultBooleanValue"); -#endif - if (mpValue.get() == NULL) { OOXMLValue::Pointer_t pValue(new OOXMLBooleanValue(true)); @@ -1668,10 +1316,6 @@ void OOXMLFastContextHandlerValue::setDefaultBooleanValue() void OOXMLFastContextHandlerValue::setDefaultIntegerValue() { -#ifdef DEBUG_ELEMENT - debug_logger->element("setDefaultIntegerValue"); -#endif - if (mpValue.get() == NULL) { OOXMLValue::Pointer_t pValue(new OOXMLIntegerValue(0)); @@ -1681,10 +1325,6 @@ void OOXMLFastContextHandlerValue::setDefaultIntegerValue() void OOXMLFastContextHandlerValue::setDefaultHexValue() { -#ifdef DEBUG_ELEMENT - debug_logger->element("setDefaultHexValue"); -#endif - if (mpValue.get() == NULL) { OOXMLValue::Pointer_t pValue(new OOXMLHexValue(0)); @@ -1694,10 +1334,6 @@ void OOXMLFastContextHandlerValue::setDefaultHexValue() void OOXMLFastContextHandlerValue::setDefaultStringValue() { -#ifdef DEBUG_ELEMENT - debug_logger->element("setDefaultStringValue"); -#endif - if (mpValue.get() == NULL) { OOXMLValue::Pointer_t pValue(new OOXMLStringValue(OUString())); @@ -1740,13 +1376,6 @@ void OOXMLFastContextHandlerTable::lcl_endFastElement writerfilter::Reference<Table>::Pointer_t pTable(mTable.clone()); if (isForwardEvents() && mId != 0x0) { -#ifdef DEBUG_PROPERTIES - debug_logger->startElement("table"); - string str = (*QNameToString::Instance())(mId); - debug_logger->attribute("id", str); - debug_logger->endElement(); -#endif - mpStream->table(mId, pTable); } } @@ -1818,23 +1447,11 @@ void OOXMLFastContextHandlerXNote::lcl_endFastElement void OOXMLFastContextHandlerXNote::checkId(OOXMLValue::Pointer_t pValue) { -#ifdef DEBUG_ELEMENT - debug_logger->startElement("checkId"); - debug_logger->attribute("myId", sal_Int32(pValue->getInt())); - debug_logger->attribute("id", getXNoteId()); - debug_logger->endElement(); -#endif - mnMyXNoteId = sal_Int32(pValue->getInt()); } void OOXMLFastContextHandlerXNote::checkType(OOXMLValue::Pointer_t pValue) { -#ifdef DEBUG_ELEMENT - debug_logger->startElement("checkType"); - debug_logger->attribute("myType", sal_Int32(pValue->getInt())); - debug_logger->endElement(); -#endif mnMyXNoteType = pValue->getInt(); } @@ -1883,12 +1500,6 @@ void OOXMLFastContextHandlerTextTableCell::endCell() pProps->add(pProp); } -#ifdef DEBUG_PROPERTIES - debug_logger->startElement("endcell"); - debug_logger->propertySet(OOXMLPropertySet::Pointer_t(pProps->clone()), - IdToString::Pointer_t(new OOXMLIdToString())); - debug_logger->endElement(); -#endif mpStream->props(writerfilter::Reference<Properties>::Pointer_t(pProps)); } } @@ -1940,13 +1551,6 @@ void OOXMLFastContextHandlerTextTableRow::endRow() pProps->add(pProp); } -#ifdef DEBUG_PROPERTIES - debug_logger->startElement("endrow"); - debug_logger->propertySet(OOXMLPropertySet::Pointer_t(pProps->clone()), - IdToString::Pointer_t(new OOXMLIdToString())); - debug_logger->endElement(); -#endif - mpStream->props(writerfilter::Reference<Properties>::Pointer_t(pProps)); } @@ -1996,12 +1600,6 @@ void OOXMLFastContextHandlerTextTableRow::handleGridBefore( OOXMLValue::Pointer_ pProps->add(pProp); } - #ifdef DEBUG_PROPERTIES - debug_logger->startElement("handlegridbefore"); - debug_logger->propertySet(OOXMLPropertySet::Pointer_t(pProps->clone()), - IdToString::Pointer_t(new OOXMLIdToString())); - debug_logger->endElement(); - #endif mpStream->props(writerfilter::Reference<Properties>::Pointer_t(pProps)); // fake <w:tcBorders> with no border @@ -2116,11 +1714,6 @@ OOXMLFastContextHandlerShape::OOXMLFastContextHandlerShape mrShapeContext->setDrawPage(getDocument()->getDrawPage()); mrShapeContext->setInputStream(getDocument()->getStorageStream()); -#ifdef DEBUG_ELEMENT - debug_logger->startElement("setRelationFragmentPath"); - debug_logger->attribute("path", mpParserState->getTarget()); - debug_logger->endElement(); -#endif mrShapeContext->setRelationFragmentPath (mpParserState->getTarget()); } @@ -2406,22 +1999,6 @@ OOXMLFastContextHandlerWrapper::lcl_createFastChildContext Id nNameSpace = Element & 0xffff0000; -#ifdef DEBUG_ELEMENT - debug_logger->startElement("Wrapper-createChildContext"); - debug_logger->attribute("token", fastTokenToId(Element)); - - const set<Id>::const_iterator aEnd(mMyNamespaces.end()); - for (set<Id>::const_iterator aIt(mMyNamespaces.begin()); - aIt != aEnd; ++aIt) - { - debug_logger->startElement("namespace"); - debug_logger->attribute("id", fastTokenToId(*aIt)); - debug_logger->endElement(); - } - - debug_logger->endElement(); -#endif - bool bInNamespaces = mMyNamespaces.find(nNameSpace) != mMyNamespaces.end(); bool bInTokens = mMyTokens.find( Element ) != mMyTokens.end( ); diff --git a/writerfilter/source/ooxml/OOXMLFastContextHandler.hxx b/writerfilter/source/ooxml/OOXMLFastContextHandler.hxx index afc685bb321e..0590638b8128 100644 --- a/writerfilter/source/ooxml/OOXMLFastContextHandler.hxx +++ b/writerfilter/source/ooxml/OOXMLFastContextHandler.hxx @@ -243,10 +243,6 @@ protected: Id mnDefine; Token_t mnToken; -#ifdef DEBUG_CONTEXT_HANDLER - string msTokenString; -#endif - // the stream to send the stream events to. Stream * mpStream; @@ -274,10 +270,7 @@ protected: throw (uno::RuntimeException, xml::sax::SAXException); void startAction(Token_t Element); - virtual void lcl_startAction(Token_t Element); void endAction(Token_t Element); - virtual void lcl_endAction(Token_t Element); - virtual OOXMLPropertySet * getPicturePropSet (const OUString & rId); diff --git a/writerfilter/source/ooxml/OOXMLFastHelper.hxx b/writerfilter/source/ooxml/OOXMLFastHelper.hxx index 93281dc45855..b272683057e7 100644 --- a/writerfilter/source/ooxml/OOXMLFastHelper.hxx +++ b/writerfilter/source/ooxml/OOXMLFastHelper.hxx @@ -22,7 +22,7 @@ #include <iostream> #include <resourcemodel/QNameToString.hxx> #include "OOXMLFastContextHandler.hxx" -#include "ooxmlLoggers.hxx" + namespace writerfilter { namespace ooxml @@ -52,31 +52,12 @@ uno::Reference<css::xml::sax::XFastContextHandler> OOXMLFastHelper<T>::createAndSetParentAndDefine (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); pTmp->setToken(nToken); pTmp->setId(nId); 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); return aResult; @@ -89,26 +70,7 @@ void OOXMLFastHelper<T>::newProperty(OOXMLFastContextHandler * pHandler, { 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); - -#ifdef DEBUG_HELPER - debug_logger->endElement(); -#endif - } template <class T> @@ -118,19 +80,6 @@ void OOXMLFastHelper<T>::newProperty(OOXMLFastContextHandler * pHandler, { 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); } diff --git a/writerfilter/source/ooxml/OOXMLParserState.cxx b/writerfilter/source/ooxml/OOXMLParserState.cxx index e74a81c508a9..130520d231f4 100644 --- a/writerfilter/source/ooxml/OOXMLParserState.cxx +++ b/writerfilter/source/ooxml/OOXMLParserState.cxx @@ -20,7 +20,6 @@ #include <stdio.h> #include <iostream> #include "OOXMLParserState.hxx" -#include "ooxmlLoggers.hxx" namespace writerfilter { namespace ooxml @@ -118,16 +117,8 @@ void OOXMLParserState::resolveCharacterProperties(Stream & rStream) { if (mpCharacterProps.get() != NULL) { -#ifdef DEBUG_PROPERTIES - debug_logger->startElement("resolveCharacterProperties"); -#endif - rStream.props(mpCharacterProps); mpCharacterProps.reset(new OOXMLPropertySetImpl()); - -#ifdef DEBUG_PROPERTIES - debug_logger->endElement(); -#endif } } diff --git a/writerfilter/source/ooxml/OOXMLPropertySetImpl.cxx b/writerfilter/source/ooxml/OOXMLPropertySetImpl.cxx index 76fa69b81952..7fd89342f74e 100644 --- a/writerfilter/source/ooxml/OOXMLPropertySetImpl.cxx +++ b/writerfilter/source/ooxml/OOXMLPropertySetImpl.cxx @@ -23,7 +23,6 @@ #include <resourcemodel/QNameToString.hxx> #include <com/sun/star/drawing/XShape.hpp> #include <ooxml/OOXMLFastTokens.hxx> -#include "ooxmlLoggers.hxx" #include <ooxml/resourceids.hxx> namespace writerfilter { @@ -401,28 +400,16 @@ OOXMLPropertySetImpl::~OOXMLPropertySetImpl() void OOXMLPropertySetImpl::resolve(Properties & rHandler) { - size_t nIt = 0; - // The pProp->resolve(rHandler) call below can cause elements to // 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 // the indexing below works. - while (nIt < mProperties.size()) + for (size_t nIt = 0; nIt < mProperties.size(); ++nIt) { OOXMLProperty::Pointer_t pProp = mProperties[nIt]; if (pProp.get() != NULL) 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 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) { /* @@ -477,14 +459,6 @@ void OOXMLPropertySetImpl::add(OOXMLProperty::Pointer_t pProperty) else 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) diff --git a/writerfilter/source/ooxml/OOXMLStreamImpl.cxx b/writerfilter/source/ooxml/OOXMLStreamImpl.cxx index f107924e26a1..9aa896b59dac 100644 --- a/writerfilter/source/ooxml/OOXMLStreamImpl.cxx +++ b/writerfilter/source/ooxml/OOXMLStreamImpl.cxx @@ -19,7 +19,6 @@ #include "OOXMLStreamImpl.hxx" #include "OOXMLFastTokenHandler.hxx" -#include "ooxmlLoggers.hxx" #include <iostream> #include <com/sun/star/embed/XHierarchicalStorageAccess.hpp> @@ -77,9 +76,6 @@ OOXMLStreamImpl::OOXMLStreamImpl OOXMLStreamImpl::~OOXMLStreamImpl() { -#ifdef DEBUG_STREAM - debug_logger->endElement("stream"); -#endif } const OUString & OOXMLStreamImpl::getTarget() const @@ -364,10 +360,6 @@ void OOXMLStreamImpl::init() { bool bFound = lcl_getTarget(mxRelationshipAccess, mnStreamType, msId, msTarget); -#ifdef DEBUG_STREAM - debug_logger->startElement("stream"); - debug_logger->attribute("target", msTarget); -#endif if (bFound) { diff --git a/writerfilter/source/ooxml/factoryimpl.xsl b/writerfilter/source/ooxml/factoryimpl.xsl index 8695c1c28128..63d7412e1983 100644 --- a/writerfilter/source/ooxml/factoryimpl.xsl +++ b/writerfilter/source/ooxml/factoryimpl.xsl @@ -62,10 +62,6 @@ uno::Reference< xml::sax::XFastContextHandler > OOXMLFactory::createFastCh uno::Reference < xml::sax::XFastContextHandler > aResult; Id nDefine = pHandler->getDefine(); -#ifdef DEBUG_FACTORY - debug_logger->startElement("factory.createFastChildContextFromFactory"); -#endif - if (pFactory.get() != NULL) { CreateElementMapPointer pMap = pFactory->getCreateElementMap(nDefine); @@ -74,25 +70,6 @@ uno::Reference< xml::sax::XFastContextHandler > OOXMLFactory::createFastCh if (pMap.get() != NULL) { 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]; switch (aCreateElement.m_nResource) @@ -127,10 +104,6 @@ uno::Reference< xml::sax::XFastContextHandler > OOXMLFactory::createFastCh } } -#ifdef DEBUG_FACTORY - debug_logger->endElement(); -#endif - return aResult; } </xsl:text> @@ -169,10 +142,6 @@ OOXMLFactory_ns::Pointer_t OOXMLFactory::getFactoryForNamespace(Id nId) uno::Reference< xml::sax::XFastContextHandler > OOXMLFactory::createFastChildContextFromStart (OOXMLFastContextHandler * pHandler, Token_t Element) { -#ifdef DEBUG_FACTORY - debug_logger->startElement("factory.createFastChildContextFromStart"); -#endif - uno::Reference < xml::sax::XFastContextHandler > aResult; OOXMLFactory_ns::Pointer_t pFactory; @@ -189,9 +158,6 @@ uno::Reference< xml::sax::XFastContextHandler > OOXMLFactory::createFastCh </xsl:for-each> <xsl:text> -#ifdef DEBUG_FACTORY - debug_logger->endElement(); -#endif return aResult; } </xsl:text> diff --git a/writerfilter/source/ooxml/ooxmlLoggers.hxx b/writerfilter/source/ooxml/ooxmlLoggers.hxx deleted file mode 100644 index f8f37a9b7475..000000000000 --- a/writerfilter/source/ooxml/ooxmlLoggers.hxx +++ /dev/null @@ -1,35 +0,0 @@ -/* -*- 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: */ |