summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--writerfilter/inc/resourcemodel/Protocol.hxx4
-rw-r--r--writerfilter/inc/resourcemodel/TagLogger.hxx4
-rw-r--r--writerfilter/inc/resourcemodel/util.hxx2
-rw-r--r--writerfilter/source/dmapper/PropertyMapHelper.cxx4
-rw-r--r--writerfilter/source/dmapper/PropertyMapHelper.hxx2
-rw-r--r--writerfilter/source/dmapper/dmapperLoggers.hxx2
-rw-r--r--writerfilter/source/doctok/WW8DocumentImpl.cxx2
-rw-r--r--writerfilter/source/doctok/WW8StreamImpl.cxx4
-rw-r--r--writerfilter/source/doctok/doctokLoggers.hxx4
-rw-r--r--writerfilter/source/ooxml/OOXMLDocumentImpl.cxx4
-rw-r--r--writerfilter/source/ooxml/OOXMLFastContextHandler.cxx161
-rw-r--r--writerfilter/source/ooxml/OOXMLFastContextHandler.hxx45
-rw-r--r--writerfilter/source/ooxml/OOXMLFastDocumentHandler.cxx7
-rw-r--r--writerfilter/source/ooxml/OOXMLFastDocumentHandler.hxx2
-rw-r--r--writerfilter/source/ooxml/OOXMLFastHelper.hxx7
-rw-r--r--writerfilter/source/ooxml/OOXMLParserState.cxx70
-rw-r--r--writerfilter/source/ooxml/OOXMLParserState.hxx18
-rw-r--r--writerfilter/source/ooxml/OOXMLPropertySetImpl.cxx22
-rw-r--r--writerfilter/source/ooxml/OOXMLPropertySetImpl.hxx9
-rw-r--r--writerfilter/source/ooxml/OOXMLStreamImpl.cxx16
-rw-r--r--writerfilter/source/ooxml/OOXMLStreamImpl.hxx4
-rw-r--r--writerfilter/source/ooxml/ooxmlLoggers.hxx3
-rw-r--r--writerfilter/source/resourcemodel/Protocol.cxx2
-rw-r--r--writerfilter/source/resourcemodel/TagLogger.cxx2
-rw-r--r--writerfilter/source/resourcemodel/util.cxx95
25 files changed, 137 insertions, 358 deletions
diff --git a/writerfilter/inc/resourcemodel/Protocol.hxx b/writerfilter/inc/resourcemodel/Protocol.hxx
index d0405861f695..2f4c9f6261ba 100644
--- a/writerfilter/inc/resourcemodel/Protocol.hxx
+++ b/writerfilter/inc/resourcemodel/Protocol.hxx
@@ -30,6 +30,8 @@
#ifndef INCLUDE_WRITERFILTER_PROTOCOL_HXX
#define INCLUDE_WRITERFILTER_PROTOCOL_HXX
+#ifdef DEBUG
+
#include <boost/shared_ptr.hpp>
#include "WW8ResourceModel.hxx"
#include "TagLogger.hxx"
@@ -95,4 +97,6 @@ public:
};
}
+
+#endif // DEBUG
#endif // INCLUDE_WRITERFILTER_PROTOCOL_HXX
diff --git a/writerfilter/inc/resourcemodel/TagLogger.hxx b/writerfilter/inc/resourcemodel/TagLogger.hxx
index 382a3c16ce8e..387d4e0e156a 100644
--- a/writerfilter/inc/resourcemodel/TagLogger.hxx
+++ b/writerfilter/inc/resourcemodel/TagLogger.hxx
@@ -28,6 +28,8 @@
#ifndef INCLUDED_TAG_LOGGER_HXX
#define INCLUDED_TAG_LOGGER_HXX
+#ifdef DEBUG
+
#include <rtl/ustring.hxx>
#include <WriterFilterDllApi.hxx>
#include <resourcemodel/WW8ResourceModel.hxx>
@@ -146,4 +148,6 @@ namespace writerfilter
virtual void sprm(Sprm & sprm);
};
}
+
+#endif // DEBUG
#endif // INCLUDED_TAG_LOGGER_HXX
diff --git a/writerfilter/inc/resourcemodel/util.hxx b/writerfilter/inc/resourcemodel/util.hxx
index 360dfc3d4113..0a700513576a 100644
--- a/writerfilter/inc/resourcemodel/util.hxx
+++ b/writerfilter/inc/resourcemodel/util.hxx
@@ -39,10 +39,12 @@ namespace writerfilter
string WRITERFILTER_DLLPUBLIC xmlify(const string & str);
+#ifdef DEBUG
string WRITERFILTER_DLLPUBLIC propertysetToString
(uno::Reference<beans::XPropertySet> const & rProps);
string toString(uno::Reference< text::XTextRange > textRange);
string toString(const string & rString);
+#endif
}
#endif // INCLUDED_RESOURCEMODEL_UTIL_HXX
diff --git a/writerfilter/source/dmapper/PropertyMapHelper.cxx b/writerfilter/source/dmapper/PropertyMapHelper.cxx
index 555003774113..4fb4c759289d 100644
--- a/writerfilter/source/dmapper/PropertyMapHelper.cxx
+++ b/writerfilter/source/dmapper/PropertyMapHelper.cxx
@@ -32,6 +32,7 @@
#include <resourcemodel/TagLogger.hxx>
#include "PropertyMapHelper.hxx"
+#ifdef DEBUG
namespace writerfilter
{
namespace dmapper
@@ -39,7 +40,7 @@ namespace dmapper
using namespace ::com::sun::star;
- XMLTag::Pointer_t lcl_TableColumnSeparatorsToTag(const uno::Any & rTableColumnSeparators)
+XMLTag::Pointer_t lcl_TableColumnSeparatorsToTag(const uno::Any & rTableColumnSeparators)
{
uno::Sequence<text::TableColumnSeparator> aSeq;
rTableColumnSeparators >>= aSeq;
@@ -127,3 +128,4 @@ XMLTag::Pointer_t lcl_PropertyValueSeqSeqToTag(PropertyValueSeqSeq_t rPropValSeq
}
}
+#endif // DEBUG
diff --git a/writerfilter/source/dmapper/PropertyMapHelper.hxx b/writerfilter/source/dmapper/PropertyMapHelper.hxx
index fc9ea0a85bb4..4a528f1736c0 100644
--- a/writerfilter/source/dmapper/PropertyMapHelper.hxx
+++ b/writerfilter/source/dmapper/PropertyMapHelper.hxx
@@ -28,6 +28,7 @@
*
************************************************************************/
+#ifdef DEBUG
#include "PropertyMap.hxx"
#include <com/sun/star/beans/PropertyValues.hpp>
@@ -46,3 +47,4 @@ typedef uno::Sequence<PropertyValueSeq_t> PropertyValueSeqSeq_t;
XMLTag::Pointer_t lcl_PropertyValueSeqSeqToTag(PropertyValueSeqSeq_t & rPropValSeqSeq);
}
}
+#endif // DEBUG
diff --git a/writerfilter/source/dmapper/dmapperLoggers.hxx b/writerfilter/source/dmapper/dmapperLoggers.hxx
index a19ff4832370..fd9ed722de4a 100644
--- a/writerfilter/source/dmapper/dmapperLoggers.hxx
+++ b/writerfilter/source/dmapper/dmapperLoggers.hxx
@@ -31,6 +31,7 @@
#ifndef INCLUDED_DMAPPER_LOGGERS_HXX
#define INCLUDED_DMAPPER_LOGGERS_HXX
+#ifdef DEBUG
#include <resourcemodel/TagLogger.hxx>
namespace writerfilter {
@@ -38,4 +39,5 @@ namespace writerfilter {
extern TagLogger::Pointer_t dmapper_logger;
}
}
+#endif // DEBUG
#endif // INCLUDED_DMAPPER_LOGGERS_HXX
diff --git a/writerfilter/source/doctok/WW8DocumentImpl.cxx b/writerfilter/source/doctok/WW8DocumentImpl.cxx
index cda79dad1cdf..256a0766b66c 100644
--- a/writerfilter/source/doctok/WW8DocumentImpl.cxx
+++ b/writerfilter/source/doctok/WW8DocumentImpl.cxx
@@ -157,6 +157,7 @@ WW8Document::~WW8Document()
{
}
+#ifdef DEBUG
class WW8IdToString : public IdToString
{
public:
@@ -173,6 +174,7 @@ public:
return s;
}
};
+#endif
WW8DocumentImpl::~WW8DocumentImpl()
{
diff --git a/writerfilter/source/doctok/WW8StreamImpl.cxx b/writerfilter/source/doctok/WW8StreamImpl.cxx
index 4418839919d4..585673bfa887 100644
--- a/writerfilter/source/doctok/WW8StreamImpl.cxx
+++ b/writerfilter/source/doctok/WW8StreamImpl.cxx
@@ -39,7 +39,9 @@ namespace doctok
{
using namespace ::com::sun::star;
- TagLogger::Pointer_t debug_logger(TagLogger::getInstance("DEBUG"));
+#ifdef DEBUG
+TagLogger::Pointer_t debug_logger(TagLogger::getInstance("DEBUG"));
+#endif
WW8Stream::~WW8Stream()
{
diff --git a/writerfilter/source/doctok/doctokLoggers.hxx b/writerfilter/source/doctok/doctokLoggers.hxx
index 8df90348a249..b7dc7e0aa48f 100644
--- a/writerfilter/source/doctok/doctokLoggers.hxx
+++ b/writerfilter/source/doctok/doctokLoggers.hxx
@@ -28,6 +28,8 @@
#ifndef INCLUDED_DOCTOK_LOGGERS_HXX
#define INCLUDED_DOCTOK_LOGGERS_HXX
+#ifdef DEBUG
+
#include <resourcemodel/TagLogger.hxx>
namespace writerfilter {
@@ -36,5 +38,5 @@ namespace writerfilter {
}
}
-
+#endif // DEBUG
#endif // INCLUDED_DOCTOK_LOGGERS_HXX
diff --git a/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx b/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx
index 90c878e3b8e2..87319b596ac0 100644
--- a/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx
+++ b/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx
@@ -42,7 +42,11 @@ using ::com::sun::star::xml::sax::SAXException;
namespace writerfilter {
namespace ooxml
{
+
+#ifdef DEBUG
TagLogger::Pointer_t debug_logger(TagLogger::getInstance("DEBUG"));
+#endif
+
using namespace ::std;
OOXMLDocumentImpl::OOXMLDocumentImpl
diff --git a/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx b/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
index 51960959d185..eb4e3e026618 100644
--- a/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
+++ b/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
@@ -100,7 +100,7 @@ static string resourceToString
set<OOXMLFastContextHandler *> aSetContexts;
-
+#ifdef DEBUG
class OOXMLIdToString : public IdToString
{
public:
@@ -119,6 +119,7 @@ public:
return s;
}
};
+#endif
/*
class OOXMLFastContextHandler
@@ -136,8 +137,7 @@ OOXMLFastContextHandler::OOXMLFastContextHandler
mnTableDepth(0),
mnInstanceNumber(mnInstanceCount),
mnRefCount(0),
- m_xContext(context),
- mbFallback(false)
+ m_xContext(context)
{
mnInstanceCount++;
aSetContexts.insert(this);
@@ -157,8 +157,7 @@ OOXMLFastContextHandler::OOXMLFastContextHandler
mnTableDepth(0),
mnInstanceNumber(mnInstanceCount),
mnRefCount(0),
- m_xContext(pContext->m_xContext),
- mbFallback(false)
+ m_xContext(pContext->m_xContext)
{
if (pContext != NULL)
{
@@ -181,29 +180,6 @@ OOXMLFastContextHandler::~OOXMLFastContextHandler()
aSetContexts.erase(this);
}
-void OOXMLFastContextHandler::dumpOpenContexts()
-{
- debug_logger->startElement("open-contexts");
- XMLTag aTag("open-contexts");
-
- set<OOXMLFastContextHandler *>::iterator aIt(aSetContexts.begin());
- while (aIt != aSetContexts.end())
- {
- debug_logger->startElement("open-context");
- debug_logger->addTag((*aIt)->toTag());
- debug_logger->endElement("open-context");
-
- aIt++;
- }
-
- static char buffer[256];
- snprintf(buffer, sizeof(buffer), "%" SAL_PRI_SIZET "u",
- aSetContexts.size());
-
- debug_logger->attribute("count", buffer);
- debug_logger->endElement("open-contexts");
-}
-
#ifdef DEBUG_MEMORY
void SAL_CALL OOXMLFastContextHandler::acquire()
throw ()
@@ -231,11 +207,6 @@ void SAL_CALL OOXMLFastContextHandler::release()
}
#endif
-sal_uInt32 OOXMLFastContextHandler::getInstanceNumber() const
-{
- return mnInstanceNumber;
-}
-
// ::com::sun::star::xml::sax::XFastContextHandler:
void SAL_CALL OOXMLFastContextHandler::startFastElement
(Token_t Element,
@@ -465,6 +436,7 @@ void OOXMLFastContextHandler::lcl_endAction(Token_t Element)
OOXMLFactory::getInstance()->endAction(this, Element);
}
+#ifdef DEBUG
XMLTag::Pointer_t OOXMLFastContextHandler::toPropertiesTag
(OOXMLPropertySet::Pointer_t pProps)
{
@@ -514,6 +486,7 @@ string OOXMLFastContextHandler::toString() const
{
return toTag()->toString();
}
+#endif
string OOXMLFastContextHandler::getResourceString() const
{
@@ -551,16 +524,6 @@ Id OOXMLFastContextHandler::getDefine() const
return mnDefine;
}
-void OOXMLFastContextHandler::setFallback(bool bFallback)
-{
- mbFallback = bFallback;
-}
-
-bool OOXMLFastContextHandler::isFallback() const
-{
- return mbFallback;
-}
-
OOXMLParserState::Pointer_t OOXMLFastContextHandler::getParserState() const
{
return mpParserState;
@@ -1032,26 +995,6 @@ void OOXMLFastContextHandler::sendTableProperties()
#endif
}
-void OOXMLFastContextHandler::clearCellProps()
-{
-#ifdef DEBUG_ELEMENT
- debug_logger->element("clearCellProps");
-#endif
-
- mpParserState->setCellProperties(OOXMLPropertySet::Pointer_t
- (new OOXMLPropertySetImpl()));
-}
-
-void OOXMLFastContextHandler::clearRowProps()
-{
-#ifdef DEBUG_ELEMENT
- debug_logger->element("clearRowProps");
-#endif
-
- mpParserState->setRowProperties(OOXMLPropertySet::Pointer_t
- (new OOXMLPropertySetImpl()));
-}
-
void OOXMLFastContextHandler::clearTableProps()
{
#ifdef DEBUG_ELEMENT
@@ -1109,11 +1052,6 @@ void OOXMLFastContextHandler::setDefaultStringValue()
{
}
-const ::rtl::OUString & OOXMLFastContextHandler::getText() const
-{
- return aEmptyStr;
-}
-
void OOXMLFastContextHandler::setDocument(OOXMLDocument * pDocument)
{
mpParserState->setDocument(pDocument);
@@ -1298,19 +1236,6 @@ OOXMLFastContextHandler::getComponentContext()
}
/*
- class OOXMLFastContextHandlerNoResource
- */
-OOXMLFastContextHandlerNoResource::OOXMLFastContextHandlerNoResource
-(OOXMLFastContextHandler * pContext)
-: OOXMLFastContextHandler(pContext)
-{
-}
-
-OOXMLFastContextHandlerNoResource::~OOXMLFastContextHandlerNoResource()
-{
-}
-
-/*
class OOXMLFastContextHandlerStream
*/
@@ -1354,12 +1279,6 @@ void OOXMLFastContextHandlerStream::sendProperty(Id nId)
sText.getLength());
}
-void OOXMLFastContextHandlerStream::setPropertySetAttrs
-(OOXMLPropertySet::Pointer_t pPropertySetAttrs)
-{
- mpPropertySetAttrs = pPropertySetAttrs;
-}
-
OOXMLPropertySet::Pointer_t
OOXMLFastContextHandlerStream::getPropertySetAttrs() const
{
@@ -1441,6 +1360,7 @@ OOXMLValue::Pointer_t OOXMLFastContextHandlerProperties::getValue() const
return OOXMLValue::Pointer_t(new OOXMLPropertySetValue(mpPropertySet));
}
+#ifdef DEBUG
XMLTag::Pointer_t OOXMLFastContextHandlerProperties::toTag() const
{
XMLTag::Pointer_t pTag(OOXMLFastContextHandler::toTag());
@@ -1448,6 +1368,7 @@ XMLTag::Pointer_t OOXMLFastContextHandlerProperties::toTag() const
return pTag;
}
+#endif
void OOXMLFastContextHandlerProperties::newProperty
(const Id & rId, OOXMLValue::Pointer_t pVal)
@@ -1982,72 +1903,6 @@ void OOXMLFastContextHandlerTextTable::lcl_endFastElement
class OOXMLFastContextHandlerShape
*/
-class ShapesNoAdd:
- public ::cppu::WeakImplHelper1<
- drawing::XShapes>
-{
-public:
- explicit ShapesNoAdd(uno::Reference< uno::XComponentContext > const & context, uno::Reference< drawing::XShapes> const & xShapes);
-
-private:
- // container::XElementAccess:
- virtual uno::Type SAL_CALL getElementType() throw (uno::RuntimeException);
- virtual ::sal_Bool SAL_CALL hasElements() throw (uno::RuntimeException);
-
- // container::XIndexAccess:
- virtual ::sal_Int32 SAL_CALL getCount() throw (uno::RuntimeException);
- virtual uno::Any SAL_CALL getByIndex(::sal_Int32 Index) throw (uno::RuntimeException, lang::IndexOutOfBoundsException, lang::WrappedTargetException);
-
- // drawing::XShapes:
- virtual void SAL_CALL add(const uno::Reference< drawing::XShape > & xShape) throw (uno::RuntimeException);
- virtual void SAL_CALL remove(const uno::Reference< drawing::XShape > & xShape) throw (uno::RuntimeException);
-
- ShapesNoAdd(ShapesNoAdd &); // not defined
- void operator =(ShapesNoAdd &); // not defined
-
- virtual ~ShapesNoAdd() {}
-
- uno::Reference< uno::XComponentContext > m_xContext;
- uno::Reference< drawing::XShapes > m_xShapes;
-};
-
-ShapesNoAdd::ShapesNoAdd(uno::Reference< uno::XComponentContext > const & context, uno::Reference< drawing::XShapes> const & xShapes) :
-m_xContext(context), m_xShapes(xShapes)
-{}
-
-// container::XElementAccess:
-uno::Type SAL_CALL ShapesNoAdd::getElementType() throw (uno::RuntimeException)
-{
- return m_xShapes->getElementType();
-}
-
-::sal_Bool SAL_CALL ShapesNoAdd::hasElements() throw (uno::RuntimeException)
-{
- return m_xShapes->hasElements();
-}
-
-// container::XIndexAccess:
-::sal_Int32 SAL_CALL ShapesNoAdd::getCount() throw (uno::RuntimeException)
-{
- return m_xShapes->getCount();
-}
-
-uno::Any SAL_CALL ShapesNoAdd::getByIndex(::sal_Int32 Index) throw (uno::RuntimeException, lang::IndexOutOfBoundsException, lang::WrappedTargetException)
-{
- return m_xShapes->getByIndex(Index);
-}
-
-// drawing::XShapes:
-void SAL_CALL ShapesNoAdd::add(const uno::Reference< drawing::XShape > &
- ) throw (uno::RuntimeException)
-{
-}
-
-void SAL_CALL ShapesNoAdd::remove(const uno::Reference< drawing::XShape > & xShape) throw (uno::RuntimeException)
-{
- m_xShapes->remove(xShape);
-}
-
OOXMLFastContextHandlerShape::OOXMLFastContextHandlerShape
(OOXMLFastContextHandler * pContext)
: OOXMLFastContextHandlerProperties(pContext), m_bShapeSent( false ),
diff --git a/writerfilter/source/ooxml/OOXMLFastContextHandler.hxx b/writerfilter/source/ooxml/OOXMLFastContextHandler.hxx
index b67f86fda3e7..0c441f62a180 100644
--- a/writerfilter/source/ooxml/OOXMLFastContextHandler.hxx
+++ b/writerfilter/source/ooxml/OOXMLFastContextHandler.hxx
@@ -132,10 +132,6 @@ public:
virtual ResourceEnum_t getResource() const { return STREAM; }
- static XMLTag::Pointer_t toPropertiesTag(OOXMLPropertySet::Pointer_t);
- virtual XMLTag::Pointer_t toTag() const;
- virtual string toString() const;
-
virtual void attributes
(const uno::Reference< xml::sax::XFastAttributeList > & Attribs)
throw (uno::RuntimeException, xml::sax::SAXException);
@@ -179,18 +175,9 @@ public:
void setDefine(Id nDefine);
Id getDefine() const;
- void setFallback(bool bFallbac);
- bool isFallback() const;
OOXMLParserState::Pointer_t getParserState() const;
-#ifdef DEBUG_MEMORY
- virtual void SAL_CALL acquire() throw();
- virtual void SAL_CALL release() throw();
-#endif
-
- sal_uInt32 getInstanceNumber() const;
-
void sendTableDepth() const;
void setHandle();
@@ -227,8 +214,6 @@ public:
void sendCellProperties();
void sendRowProperties();
void sendTableProperties();
- void clearCellProps();
- void clearRowProps();
void clearTableProps();
void clearProps();
@@ -237,10 +222,18 @@ public:
virtual void setDefaultHexValue();
virtual void setDefaultStringValue();
- const ::rtl::OUString & getText() const;
-
void sendPropertyToParent();
- static void dumpOpenContexts();
+
+#ifdef DEBUG
+ static XMLTag::Pointer_t toPropertiesTag(OOXMLPropertySet::Pointer_t);
+ virtual XMLTag::Pointer_t toTag() const;
+ virtual string toString() const;
+#endif
+
+#ifdef DEBUG_MEMORY
+ virtual void SAL_CALL acquire() throw();
+ virtual void SAL_CALL release() throw();
+#endif
protected:
OOXMLFastContextHandler * mpParent;
@@ -302,14 +295,6 @@ private:
static sal_uInt32 mnInstanceCount;
- bool mbFallback;
-};
-
-class OOXMLFastContextHandlerNoResource : public OOXMLFastContextHandler
-{
-public:
- OOXMLFastContextHandlerNoResource(OOXMLFastContextHandler * pContext);
- virtual ~OOXMLFastContextHandlerNoResource();
};
class OOXMLFastContextHandlerStream : public OOXMLFastContextHandler
@@ -329,10 +314,10 @@ public:
void handleHyperlink();
protected:
- void setPropertySetAttrs(OOXMLPropertySet::Pointer_t pPropertySetAttrs);
virtual void resolvePropertySetAttrs();
virtual void lcl_characters(const ::rtl::OUString & aChars)
throw (uno::RuntimeException, xml::sax::SAXException);
+
private:
mutable OOXMLPropertySet::Pointer_t mpPropertySetAttrs;
};
@@ -346,8 +331,6 @@ public:
virtual OOXMLValue::Pointer_t getValue() const;
virtual ResourceEnum_t getResource() const { return PROPERTIES; }
- virtual XMLTag::Pointer_t toTag() const;
-
virtual void newProperty(const Id & nId, OOXMLValue::Pointer_t pVal);
void handleXNotes();
@@ -360,6 +343,10 @@ public:
virtual void setPropertySet(OOXMLPropertySet::Pointer_t pPropertySet);
virtual OOXMLPropertySet::Pointer_t getPropertySet() const;
+#ifdef DEBUG
+ virtual XMLTag::Pointer_t toTag() const;
+#endif
+
protected:
/// the properties
OOXMLPropertySet::Pointer_t mpPropertySet;
diff --git a/writerfilter/source/ooxml/OOXMLFastDocumentHandler.cxx b/writerfilter/source/ooxml/OOXMLFastDocumentHandler.cxx
index f4feddf341ac..0536590145f8 100644
--- a/writerfilter/source/ooxml/OOXMLFastDocumentHandler.cxx
+++ b/writerfilter/source/ooxml/OOXMLFastDocumentHandler.cxx
@@ -152,13 +152,6 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL
return OOXMLFactory::getInstance()->createFastChildContextFromStart(getContextHandler().get(), Element);
}
-OOXMLParserState::Pointer_t OOXMLFastDocumentHandler::getParserState() const
-{
- OOXMLParserState::Pointer_t pParserState;
-
- return getContextHandler()->getParserState();
-}
-
uno::Reference< xml::sax::XFastContextHandler > SAL_CALL
OOXMLFastDocumentHandler::createUnknownChildContext
(const ::rtl::OUString &
diff --git a/writerfilter/source/ooxml/OOXMLFastDocumentHandler.hxx b/writerfilter/source/ooxml/OOXMLFastDocumentHandler.hxx
index 86f835c5c0a4..2fb6ee5e6abb 100644
--- a/writerfilter/source/ooxml/OOXMLFastDocumentHandler.hxx
+++ b/writerfilter/source/ooxml/OOXMLFastDocumentHandler.hxx
@@ -95,8 +95,6 @@ public:
void setDocument(OOXMLDocument * pDocument);
void setXNoteId(const ::rtl::OUString & rXNoteId);
- OOXMLParserState::Pointer_t getParserState() const;
-
private:
OOXMLFastDocumentHandler(OOXMLFastDocumentHandler &); // not defined
void operator =(OOXMLFastDocumentHandler &); // not defined
diff --git a/writerfilter/source/ooxml/OOXMLFastHelper.hxx b/writerfilter/source/ooxml/OOXMLFastHelper.hxx
index 2d21083487ff..5d4587922a54 100644
--- a/writerfilter/source/ooxml/OOXMLFastHelper.hxx
+++ b/writerfilter/source/ooxml/OOXMLFastHelper.hxx
@@ -84,8 +84,6 @@ OOXMLFastHelper<T>::createAndSetParent
debug_logger->attribute("context", pHandler->getType());
debug_logger->attribute("token", fastTokenToId(pTmp->getToken()));
debug_logger->attribute("id", (*QNameToString::Instance())(nId));
- if (pTmp->isFallback())
- debug_logger->attribute("fallback", "yes");
debug_logger->startElement("created");
debug_logger->addTag(pTmp->toTag());
@@ -119,8 +117,6 @@ OOXMLFastHelper<T>::createAndSetParentAndDefine
snprintf(buffer, sizeof(buffer), "0x%08" SAL_PRIxUINT32, nId);
debug_logger->attribute("idnum", buffer);
- if (pTmp->isFallback())
- debug_logger->attribute("fallback", "yes");
debug_logger->startElement("created");
debug_logger->addTag(pTmp->toTag());
@@ -158,9 +154,6 @@ OOXMLFastHelper<T>::createAndSetParentRef
debug_logger->attribute("context", pHandler->getType());
debug_logger->attribute("type", fastTokenToId(nToken));
- if (pTmp->isFallback())
- debug_logger->attribute("fallback", "yes");
-
debug_logger->startElement("created");
debug_logger->chars(pTmp->getType());
debug_logger->endElement("created");
diff --git a/writerfilter/source/ooxml/OOXMLParserState.cxx b/writerfilter/source/ooxml/OOXMLParserState.cxx
index e38593777a55..fb347d02048e 100644
--- a/writerfilter/source/ooxml/OOXMLParserState.cxx
+++ b/writerfilter/source/ooxml/OOXMLParserState.cxx
@@ -103,11 +103,6 @@ bool OOXMLParserState::isForwardEvents() const
return mbForwardEvents;
}
-void OOXMLParserState::incContextCount()
-{
- mnContexts++;
-}
-
const string OOXMLParserState::getHandle() const
{
char sBuffer[256];
@@ -122,11 +117,6 @@ void OOXMLParserState::setHandle()
mnHandle = mnContexts;
}
-unsigned int OOXMLParserState::getContextCount() const
-{
- return mnContexts;
-}
-
void OOXMLParserState::setDocument(OOXMLDocument * pDocument)
{
mpDocument = pDocument;
@@ -147,44 +137,11 @@ const rtl::OUString & OOXMLParserState::getXNoteId() const
return mpDocument->getXNoteId();
}
-void OOXMLParserState::setXNoteType(const Id & rId)
-{
- mpDocument->setXNoteType(rId);
-}
-
-const Id & OOXMLParserState::getXNoteType() const
-{
- return mpDocument->getXNoteType();
-}
-
const ::rtl::OUString & OOXMLParserState::getTarget() const
{
return mpDocument->getTarget();
}
-void OOXMLParserState::newCharacterProperty(const Id & rId,
- OOXMLValue::Pointer_t pVal)
-{
- if (rId != 0x0)
- {
- if (mpCharacterProps.get() == NULL)
- mpCharacterProps =
- OOXMLPropertySet::Pointer_t(new OOXMLPropertySetImpl());
-
- OOXMLPropertyImpl::Pointer_t pProperty
- (new OOXMLPropertyImpl(rId, pVal, OOXMLPropertyImpl::ATTRIBUTE));
-
-#ifdef DEBUG_PROPERTIES
- debug_logger->startElement("<newCharacterProperty");
- debug_logger->chars(pProperty->toString());
- debug_logger->endElement("newCharacterProperty");
-#endif
-
- mpCharacterProps->add(pProperty);
- }
-
-}
-
void OOXMLParserState::resolveCharacterProperties(Stream & rStream)
{
if (mpCharacterProps.get() != NULL)
@@ -202,11 +159,6 @@ void OOXMLParserState::resolveCharacterProperties(Stream & rStream)
}
}
-OOXMLPropertySet::Pointer_t OOXMLParserState::getCharacterProperties() const
-{
- return mpCharacterProps;
-}
-
void OOXMLParserState::setCharacterProperties
(OOXMLPropertySet::Pointer_t pProps)
{
@@ -317,6 +269,22 @@ void OOXMLParserState::endTable()
mTableProps.pop();
}
+void OOXMLParserState::incContextCount()
+{
+ mnContexts++;
+}
+
+#ifdef DEBUG
+unsigned int OOXMLParserState::getContextCount() const
+{
+ return mnContexts;
+}
+
+string OOXMLParserState::toString() const
+{
+ return toTag()->toString();
+}
+
XMLTag::Pointer_t OOXMLParserState::toTag() const
{
XMLTag::Pointer_t pTag(new XMLTag("parserstate"));
@@ -352,10 +320,6 @@ XMLTag::Pointer_t OOXMLParserState::toTag() const
return pTag;
}
-
-string OOXMLParserState::toString() const
-{
- return toTag()->toString();
-}
+#endif
}}
diff --git a/writerfilter/source/ooxml/OOXMLParserState.hxx b/writerfilter/source/ooxml/OOXMLParserState.hxx
index affdd7dbe61c..2dd118a5b96b 100644
--- a/writerfilter/source/ooxml/OOXMLParserState.hxx
+++ b/writerfilter/source/ooxml/OOXMLParserState.hxx
@@ -29,9 +29,12 @@
#include <stack>
#include <ooxml/OOXMLDocument.hxx>
-#include <resourcemodel/TagLogger.hxx>
#include "OOXMLPropertySetImpl.hxx"
+#ifdef DEBUG
+#include <resourcemodel/TagLogger.hxx>
+#endif
+
namespace writerfilter {
namespace ooxml
{
@@ -76,24 +79,18 @@ public:
void setForwardEvents(bool bForwardEvents);
bool isForwardEvents() const;
- void incContextCount();
const string getHandle() const;
void setHandle();
- unsigned int getContextCount() const;
void setDocument(OOXMLDocument * pDocument);
OOXMLDocument * getDocument() const;
void setXNoteId(const rtl::OUString & rId);
const rtl::OUString & getXNoteId() const;
- void setXNoteType(const Id & rId);
- const Id & getXNoteType() const;
const rtl::OUString & getTarget() const;
- void newCharacterProperty(const Id & rId, OOXMLValue::Pointer_t pVal);
void resolveCharacterProperties(Stream & rStream);
- OOXMLPropertySet::Pointer_t getCharacterProperties() const;
void setCharacterProperties(OOXMLPropertySet::Pointer_t pProps);
void resolveCellProperties(Stream & rStream);
void setCellProperties(OOXMLPropertySet::Pointer_t pProps);
@@ -105,8 +102,15 @@ public:
void startTable();
void endTable();
+ void incContextCount();
+
+#ifdef DEBUG
+public:
+ unsigned int getContextCount() const;
string toString() const;
XMLTag::Pointer_t toTag() const;
+#endif
+
};
}}
diff --git a/writerfilter/source/ooxml/OOXMLPropertySetImpl.cxx b/writerfilter/source/ooxml/OOXMLPropertySetImpl.cxx
index 2f8844f1af01..f106972b23c0 100644
--- a/writerfilter/source/ooxml/OOXMLPropertySetImpl.cxx
+++ b/writerfilter/source/ooxml/OOXMLPropertySetImpl.cxx
@@ -198,10 +198,6 @@ OOXMLValue::OOXMLValue()
{
}
-OOXMLValue::OOXMLValue(const rtl::OUString & /*rValue*/)
-{
-}
-
OOXMLValue::~OOXMLValue()
{
}
@@ -659,24 +655,6 @@ string OOXMLHexValue::toString() const
}
/*
- class OOXMLListValue
-*/
-OOXMLListValue::OOXMLListValue()
-: OOXMLIntegerValue(0)
-{
-}
-
-OOXMLListValue::OOXMLListValue(sal_Int32 nValue)
-: OOXMLIntegerValue(nValue)
-{
-}
-
-
-OOXMLListValue::~OOXMLListValue()
-{
-}
-
-/*
class OOXMLShapeValue
*/
diff --git a/writerfilter/source/ooxml/OOXMLPropertySetImpl.hxx b/writerfilter/source/ooxml/OOXMLPropertySetImpl.hxx
index 78c39b79d515..a04fc5f5d1af 100644
--- a/writerfilter/source/ooxml/OOXMLPropertySetImpl.hxx
+++ b/writerfilter/source/ooxml/OOXMLPropertySetImpl.hxx
@@ -48,7 +48,6 @@ class OOXMLValue : public Value
{
public:
typedef boost::shared_ptr<OOXMLValue> Pointer_t;
- OOXMLValue(const rtl::OUString & rValue);
OOXMLValue();
virtual ~OOXMLValue();
@@ -222,14 +221,6 @@ public:
virtual OOXMLValue * clone() const;
};
-class OOXMLListValue : public OOXMLIntegerValue
-{
-public:
- OOXMLListValue();
- OOXMLListValue(sal_Int32 nValue);
- virtual ~OOXMLListValue();
-};
-
class OOXMLShapeValue : public OOXMLValue
{
protected:
diff --git a/writerfilter/source/ooxml/OOXMLStreamImpl.cxx b/writerfilter/source/ooxml/OOXMLStreamImpl.cxx
index 91188eeda701..8b879f4b0aec 100644
--- a/writerfilter/source/ooxml/OOXMLStreamImpl.cxx
+++ b/writerfilter/source/ooxml/OOXMLStreamImpl.cxx
@@ -69,22 +69,6 @@ OOXMLStreamImpl::OOXMLStreamImpl
}
OOXMLStreamImpl::OOXMLStreamImpl
-(uno::Reference<uno::XComponentContext> xContext,
- uno::Reference<io::XInputStream> xStorageStream, const rtl::OUString & rId)
-: mxContext(xContext),
- mxStorageStream(xStorageStream),
- mnStreamType(UNKNOWN),
- msId(rId)
-{
- mxStorage.set
- (comphelper::OStorageHelper::GetStorageOfFormatFromInputStream
- (OFOPXML_STORAGE_FORMAT_STRING, mxStorageStream));
- mxRelationshipAccess.set(mxStorage, uno::UNO_QUERY_THROW);
-
- init();
-}
-
-OOXMLStreamImpl::OOXMLStreamImpl
(OOXMLStreamImpl & rOOXMLStream, const rtl::OUString & rId)
: mxContext(rOOXMLStream.mxContext),
mxStorageStream(rOOXMLStream.mxStorageStream),
diff --git a/writerfilter/source/ooxml/OOXMLStreamImpl.hxx b/writerfilter/source/ooxml/OOXMLStreamImpl.hxx
index 64682fab250c..15409fe8ae2a 100644
--- a/writerfilter/source/ooxml/OOXMLStreamImpl.hxx
+++ b/writerfilter/source/ooxml/OOXMLStreamImpl.hxx
@@ -71,10 +71,6 @@ public:
uno::Reference<io::XInputStream> xStorageStream,
StreamType_t nType);
OOXMLStreamImpl(OOXMLStreamImpl & rStream, const rtl::OUString & rId);
- OOXMLStreamImpl
- (uno::Reference<uno::XComponentContext> xContext,
- uno::Reference<io::XInputStream> xStorageStream,
- const rtl::OUString & rId);
virtual ~OOXMLStreamImpl();
diff --git a/writerfilter/source/ooxml/ooxmlLoggers.hxx b/writerfilter/source/ooxml/ooxmlLoggers.hxx
index b58a41bdabcd..54191244b968 100644
--- a/writerfilter/source/ooxml/ooxmlLoggers.hxx
+++ b/writerfilter/source/ooxml/ooxmlLoggers.hxx
@@ -28,6 +28,8 @@
#ifndef INCLUDED_OOXML_LOGGERS_HXX
#define INCLUDED_OOXML_LOGGERS_HXX
+#ifdef DEBUG
+
#include <resourcemodel/TagLogger.hxx>
namespace writerfilter {
@@ -35,4 +37,5 @@ namespace writerfilter {
extern TagLogger::Pointer_t debug_logger;
}
}
+#endif
#endif // INCLUDED_OOXML_LOGGERS_HXX
diff --git a/writerfilter/source/resourcemodel/Protocol.cxx b/writerfilter/source/resourcemodel/Protocol.cxx
index 7ae3c06f2675..51d12eb4f2d6 100644
--- a/writerfilter/source/resourcemodel/Protocol.cxx
+++ b/writerfilter/source/resourcemodel/Protocol.cxx
@@ -28,6 +28,7 @@
*
************************************************************************/
+#ifdef DEBUG
#include <stdio.h>
#include <rtl/ustrbuf.hxx>
#include <resourcemodel/Protocol.hxx>
@@ -214,3 +215,4 @@ void TableProtocol::entry(int pos,
}
}
+#endif // DEBUG
diff --git a/writerfilter/source/resourcemodel/TagLogger.cxx b/writerfilter/source/resourcemodel/TagLogger.cxx
index bee3c0b7b39a..fa61d7635efb 100644
--- a/writerfilter/source/resourcemodel/TagLogger.cxx
+++ b/writerfilter/source/resourcemodel/TagLogger.cxx
@@ -25,6 +25,7 @@
*
************************************************************************/
+#ifdef DEBUG
#include <fstream>
#include <string.h>
#include <resourcemodel/TagLogger.hxx>
@@ -365,3 +366,4 @@ namespace writerfilter
}
+#endif // DEBUG
diff --git a/writerfilter/source/resourcemodel/util.cxx b/writerfilter/source/resourcemodel/util.cxx
index 47d325654d5b..3d041d18c126 100644
--- a/writerfilter/source/resourcemodel/util.cxx
+++ b/writerfilter/source/resourcemodel/util.cxx
@@ -64,6 +64,37 @@ void logger(string prefix, string message)
logger_stream().flush();
}
+ string xmlify(const string & str)
+ {
+ string result = "";
+ char sBuffer[16];
+
+ for (string::const_iterator aIt = str.begin(); aIt != str.end(); ++aIt)
+ {
+ char c = *aIt;
+
+ if (isprint(c) && c != '\"')
+ {
+ if (c == '<')
+ result += "&lt;";
+ else if (c == '>')
+ result += "&gt;";
+ else if (c == '&')
+ result += "&amp;";
+ else
+ result += c;
+ }
+ else
+ {
+ snprintf(sBuffer, sizeof(sBuffer), "\\%03d", c);
+ result += sBuffer;
+ }
+ }
+
+ return result;
+ }
+
+#ifdef DEBUG
string propertysetToString(uno::Reference<beans::XPropertySet> const & xPropSet)
{
string sResult;
@@ -368,57 +399,29 @@ string propertysetToString(uno::Reference<beans::XPropertySet> const & xPropSet)
return sResult;
}
- string xmlify(const string & str)
- {
- string result = "";
- char sBuffer[16];
-
- for (string::const_iterator aIt = str.begin(); aIt != str.end(); ++aIt)
- {
- char c = *aIt;
-
- if (isprint(c) && c != '\"')
- {
- if (c == '<')
- result += "&lt;";
- else if (c == '>')
- result += "&gt;";
- else if (c == '&')
- result += "&amp;";
- else
- result += c;
- }
- else
- {
- snprintf(sBuffer, sizeof(sBuffer), "\\%03d", c);
- result += sBuffer;
- }
- }
- return result;
- }
+string toString(uno::Reference< text::XTextRange > textRange)
+{
+ string result;
- string toString(uno::Reference< text::XTextRange > textRange)
+ if (textRange.get())
{
- string result;
-
- if (textRange.get())
- {
- rtl::OUString aOUStr = textRange->getString();
- rtl::OString aOStr(aOUStr.getStr(), aOUStr.getLength(), RTL_TEXTENCODING_ASCII_US );
-
- result = aOStr.getStr();
- }
- else
- {
- result="(nil)";
- }
+ rtl::OUString aOUStr = textRange->getString();
+ rtl::OString aOStr(aOUStr.getStr(), aOUStr.getLength(), RTL_TEXTENCODING_ASCII_US );
- return result;
+ result = aOStr.getStr();
}
-
- string toString(const string & rString)
+ else
{
- return rString;
+ result="(nil)";
}
+
+ return result;
+}
+
+string toString(const string & rString)
+{
+ return rString;
+}
+#endif
}