[Libreoffice-commits] core.git: writerfilter/inc writerfilter/source
Jan Holesovsky
kendy at collabora.com
Thu Jun 19 04:07:56 PDT 2014
writerfilter/inc/resourcemodel/TagLogger.hxx | 2 +
writerfilter/inc/resourcemodel/WW8ResourceModel.hxx | 6 +++
writerfilter/inc/resourcemodel/util.hxx | 2 -
writerfilter/source/ooxml/OOXMLFastContextHandler.cxx | 6 +--
writerfilter/source/ooxml/OOXMLPropertySet.hxx | 4 ++
writerfilter/source/ooxml/OOXMLPropertySetImpl.cxx | 30 ++++++++++++++++--
writerfilter/source/ooxml/OOXMLPropertySetImpl.hxx | 28 ++++++++++++++++
writerfilter/source/ooxml/factoryimpl.xsl | 2 +
writerfilter/source/ooxml/fasttokens.py | 2 +
writerfilter/source/resourcemodel/util.cxx | 5 +--
writerfilter/source/rtftok/rtfsprm.cxx | 6 ++-
writerfilter/source/rtftok/rtfsprm.hxx | 2 +
writerfilter/source/rtftok/rtfvalue.cxx | 2 +
writerfilter/source/rtftok/rtfvalue.hxx | 2 +
14 files changed, 88 insertions(+), 11 deletions(-)
New commits:
commit f8c5a61e052c500201c7bfc4c36f127c0ac36b30
Author: Jan Holesovsky <kendy at collabora.com>
Date: Thu Jun 19 09:37:43 2014 +0200
writerfilter: Hide more debug-only stuff behind the DEBUG_DOMAINMAPPER.
Change-Id: I0e86cafab97f0adad516660c6fdf40e13d114bf2
diff --git a/writerfilter/inc/resourcemodel/TagLogger.hxx b/writerfilter/inc/resourcemodel/TagLogger.hxx
index c75af7b..92ad860 100644
--- a/writerfilter/inc/resourcemodel/TagLogger.hxx
+++ b/writerfilter/inc/resourcemodel/TagLogger.hxx
@@ -30,6 +30,7 @@
namespace writerfilter
{
+#ifdef DEBUG_DOMAINMAPPER
class IdToString
{
public:
@@ -39,6 +40,7 @@ namespace writerfilter
protected:
~IdToString() {}
};
+#endif
class TagLogger
{
diff --git a/writerfilter/inc/resourcemodel/WW8ResourceModel.hxx b/writerfilter/inc/resourcemodel/WW8ResourceModel.hxx
index 0d36342..995dd55 100644
--- a/writerfilter/inc/resourcemodel/WW8ResourceModel.hxx
+++ b/writerfilter/inc/resourcemodel/WW8ResourceModel.hxx
@@ -333,7 +333,9 @@ public:
/**
Returns string representation of this value.
*/
+#ifdef DEBUG_DOMAINMAPPER
virtual std::string toString() const = 0;
+#endif
};
/**
@@ -382,12 +384,16 @@ public:
/**
Returns name of sprm.
*/
+#ifdef DEBUG_DOMAINMAPPER
virtual std::string getName() const = 0;
+#endif
/**
Returns string repesentation of sprm.
*/
+#ifdef DEBUG_DOMAINMAPPER
virtual std::string toString() const = 0;
+#endif
protected:
~Sprm() {}
diff --git a/writerfilter/inc/resourcemodel/util.hxx b/writerfilter/inc/resourcemodel/util.hxx
index 24abfe8..b176cd82 100644
--- a/writerfilter/inc/resourcemodel/util.hxx
+++ b/writerfilter/inc/resourcemodel/util.hxx
@@ -26,7 +26,7 @@
namespace writerfilter
{
-#if OSL_DEBUG_LEVEL > 1
+#ifdef DEBUG_DOMAINMAPPER
std::string toString(css::uno::Reference< css::text::XTextRange > textRange);
#endif
}
diff --git a/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx b/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
index 49db4fb..cc20804 100644
--- a/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
+++ b/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
@@ -87,7 +87,7 @@ static string resourceToString
set<OOXMLFastContextHandler *> aSetContexts;
-#if OSL_DEBUG_LEVEL > 1
+#ifdef DEBUG_DOMAINMAPPER
class OOXMLIdToString : public IdToString
{
public:
@@ -377,7 +377,7 @@ void OOXMLFastContextHandler::endAction(Token_t Element)
OOXMLFactory::getInstance()->endAction(this, Element);
}
-#if OSL_DEBUG_LEVEL > 1
+#ifdef DEBUG_DOMAINMAPPER
void OOXMLFastContextHandler::dumpXml( const TagLogger::Pointer_t pLogger ) const
{
pLogger->startElement("context");
@@ -1088,7 +1088,7 @@ OOXMLValue::Pointer_t OOXMLFastContextHandlerProperties::getValue() const
return OOXMLValue::Pointer_t(new OOXMLPropertySetValue(mpPropertySet));
}
-#if OSL_DEBUG_LEVEL > 1
+#ifdef DEBUG_DOMAINMAPPER
void OOXMLFastContextHandlerProperties::dumpXml( const TagLogger::Pointer_t pLogger) const
{
pLogger->startElement("context");
diff --git a/writerfilter/source/ooxml/OOXMLPropertySet.hxx b/writerfilter/source/ooxml/OOXMLPropertySet.hxx
index 76ac56a..354bdd7 100644
--- a/writerfilter/source/ooxml/OOXMLPropertySet.hxx
+++ b/writerfilter/source/ooxml/OOXMLPropertySet.hxx
@@ -37,8 +37,10 @@ public:
virtual writerfilter::Reference<BinaryObj>::Pointer_t getBinary() SAL_OVERRIDE = 0;
virtual writerfilter::Reference<Stream>::Pointer_t getStream() SAL_OVERRIDE = 0;
virtual writerfilter::Reference<Properties>::Pointer_t getProps() SAL_OVERRIDE = 0;
+#ifdef DEBUG_DOMAINMAPPER
virtual std::string getName() const SAL_OVERRIDE = 0;
virtual std::string toString() const SAL_OVERRIDE = 0;
+#endif
virtual void resolve(Properties & rProperties) = 0;
virtual Sprm * clone() = 0;
@@ -58,7 +60,9 @@ public:
virtual OOXMLPropertySet * clone() const = 0;
virtual void setType(const std::string & rsType) = 0;
+#ifdef DEBUG_DOMAINMAPPER
virtual std::string toString() = 0;
+#endif
};
class OOXMLTable : public writerfilter::Reference<Table>
diff --git a/writerfilter/source/ooxml/OOXMLPropertySetImpl.cxx b/writerfilter/source/ooxml/OOXMLPropertySetImpl.cxx
index b058522..c45a0e0 100644
--- a/writerfilter/source/ooxml/OOXMLPropertySetImpl.cxx
+++ b/writerfilter/source/ooxml/OOXMLPropertySetImpl.cxx
@@ -104,13 +104,12 @@ writerfilter::Reference<Properties>::Pointer_t OOXMLPropertyImpl::getProps()
return pResult;
}
+#ifdef DEBUG_DOMAINMAPPER
string OOXMLPropertyImpl::getName() const
{
string sResult;
-#ifdef DEBUG_DOMAINMAPPER
sResult = (*QNameToString::Instance())(mId);
-#endif
if (sResult.length() == 0)
sResult = fastTokenToId(mId);
@@ -125,7 +124,9 @@ string OOXMLPropertyImpl::getName() const
return sResult;
}
+#endif
+#ifdef DEBUG_DOMAINMAPPER
string OOXMLPropertyImpl::toString() const
{
string sResult = "(";
@@ -140,6 +141,7 @@ string OOXMLPropertyImpl::toString() const
return sResult;
}
+#endif
Sprm::Kind OOXMLPropertyImpl::getKind()
{
@@ -215,10 +217,12 @@ writerfilter::Reference<BinaryObj>::Pointer_t OOXMLValue::getBinary()
return writerfilter::Reference<BinaryObj>::Pointer_t();
}
+#ifdef DEBUG_DOMAINMAPPER
string OOXMLValue::toString() const
{
return "OOXMLValue";
}
+#endif
OOXMLValue * OOXMLValue::clone() const
{
@@ -244,10 +248,12 @@ writerfilter::Reference<BinaryObj>::Pointer_t OOXMLBinaryValue::getBinary()
return mpBinaryObj;
}
+#ifdef DEBUG_DOMAINMAPPER
string OOXMLBinaryValue::toString() const
{
return "BinaryObj";
}
+#endif
OOXMLValue * OOXMLBinaryValue::clone() const
{
@@ -294,10 +300,12 @@ uno::Any OOXMLBooleanValue::getAny() const
return aResult;
}
+#ifdef DEBUG_DOMAINMAPPER
string OOXMLBooleanValue::toString() const
{
return mbValue ? "true" : "false";
}
+#endif
OOXMLValue * OOXMLBooleanValue::clone() const
{
@@ -329,10 +337,12 @@ OUString OOXMLStringValue::getString() const
return mStr;
}
+#ifdef DEBUG_DOMAINMAPPER
string OOXMLStringValue::toString() const
{
return OUStringToOString(mStr, RTL_TEXTENCODING_ASCII_US).getStr();
}
+#endif
OOXMLValue * OOXMLStringValue::clone() const
{
@@ -358,10 +368,12 @@ uno::Any OOXMLInputStreamValue::getAny() const
return aAny;
}
+#ifdef DEBUG_DOMAINMAPPER
string OOXMLInputStreamValue::toString() const
{
return "InputStream";
}
+#endif
OOXMLValue * OOXMLInputStreamValue::clone() const
{
@@ -488,6 +500,7 @@ void OOXMLPropertySetImpl::setType(const string & rsType)
msType = rsType;
}
+#ifdef DEBUG_DOMAINMAPPER
string OOXMLPropertySetImpl::toString()
{
string sResult = "[";
@@ -514,6 +527,7 @@ string OOXMLPropertySetImpl::toString()
return sResult;
}
+#endif
/*
class OOXMLPropertySetValue
@@ -535,6 +549,7 @@ writerfilter::Reference<Properties>::Pointer_t OOXMLPropertySetValue::getPropert
(mpPropertySet->clone());
}
+#ifdef DEBUG_DOMAINMAPPER
string OOXMLPropertySetValue::toString() const
{
char sBuffer[256];
@@ -543,6 +558,7 @@ string OOXMLPropertySetValue::toString() const
return "OOXMLPropertySetValue(" + string(sBuffer) + ")";
}
+#endif
OOXMLValue * OOXMLPropertySetValue::clone() const
{
@@ -585,6 +601,7 @@ OOXMLValue * OOXMLIntegerValue::clone() const
return new OOXMLIntegerValue(*this);
}
+#ifdef DEBUG_DOMAINMAPPER
string OOXMLIntegerValue::toString() const
{
char buffer[256];
@@ -592,6 +609,7 @@ string OOXMLIntegerValue::toString() const
return buffer;
}
+#endif
/*
class OOXMLHexValue
@@ -621,6 +639,7 @@ OOXMLValue * OOXMLHexValue::clone() const
return new OOXMLHexValue(*this);
}
+#ifdef DEBUG_DOMAINMAPPER
string OOXMLHexValue::toString() const
{
char buffer[256];
@@ -628,6 +647,7 @@ string OOXMLHexValue::toString() const
return buffer;
}
+#endif
// OOXMLUniversalMeasureValue
@@ -653,10 +673,12 @@ OOXMLValue* OOXMLUniversalMeasureValue::clone() const
return new OOXMLUniversalMeasureValue(*this);
}
+#ifdef DEBUG_DOMAINMAPPER
string OOXMLUniversalMeasureValue::toString() const
{
return OString::number(mnValue).getStr();
}
+#endif
/*
class OOXMLShapeValue
@@ -677,10 +699,12 @@ uno::Any OOXMLShapeValue::getAny() const
return uno::Any(mrShape);
}
+#ifdef DEBUG_DOMAINMAPPER
string OOXMLShapeValue::toString() const
{
return "Shape";
}
+#endif
OOXMLValue * OOXMLShapeValue::clone() const
{
@@ -706,10 +730,12 @@ uno::Any OOXMLStarMathValue::getAny() const
return uno::Any(component);
}
+#ifdef DEBUG_DOMAINMAPPER
string OOXMLStarMathValue::toString() const
{
return "StarMath";
}
+#endif
OOXMLValue * OOXMLStarMathValue::clone() const
{
diff --git a/writerfilter/source/ooxml/OOXMLPropertySetImpl.hxx b/writerfilter/source/ooxml/OOXMLPropertySetImpl.hxx
index 9f18561..a26f4fd 100644
--- a/writerfilter/source/ooxml/OOXMLPropertySetImpl.hxx
+++ b/writerfilter/source/ooxml/OOXMLPropertySetImpl.hxx
@@ -49,7 +49,9 @@ public:
virtual writerfilter::Reference<Properties>::Pointer_t getProperties() SAL_OVERRIDE;
virtual writerfilter::Reference<Stream>::Pointer_t getStream() SAL_OVERRIDE;
virtual writerfilter::Reference<BinaryObj>::Pointer_t getBinary() SAL_OVERRIDE;
+#ifdef DEBUG_DOMAINMAPPER
virtual std::string toString() const SAL_OVERRIDE;
+#endif
virtual OOXMLValue * clone() const;
};
@@ -74,9 +76,13 @@ public:
virtual writerfilter::Reference<BinaryObj>::Pointer_t getBinary() SAL_OVERRIDE;
virtual writerfilter::Reference<Stream>::Pointer_t getStream() SAL_OVERRIDE;
virtual writerfilter::Reference<Properties>::Pointer_t getProps() SAL_OVERRIDE;
+#ifdef DEBUG_DOMAINMAPPER
virtual std::string getName() const SAL_OVERRIDE;
+#endif
virtual Kind getKind() SAL_OVERRIDE;
+#ifdef DEBUG_DOMAINMAPPER
virtual std::string toString() const SAL_OVERRIDE;
+#endif
virtual Sprm * clone() SAL_OVERRIDE;
virtual void resolve(Properties & rProperties) SAL_OVERRIDE;
};
@@ -90,7 +96,9 @@ public:
virtual ~OOXMLBinaryValue();
virtual writerfilter::Reference<BinaryObj>::Pointer_t getBinary() SAL_OVERRIDE;
+#ifdef DEBUG_DOMAINMAPPER
virtual std::string toString() const SAL_OVERRIDE;
+#endif
virtual OOXMLValue * clone() const SAL_OVERRIDE;
};
@@ -106,7 +114,9 @@ public:
virtual int getInt() const SAL_OVERRIDE;
virtual bool getBool() const SAL_OVERRIDE;
virtual css::uno::Any getAny() const SAL_OVERRIDE;
+#ifdef DEBUG_DOMAINMAPPER
virtual std::string toString() const SAL_OVERRIDE;
+#endif
virtual OOXMLValue * clone() const SAL_OVERRIDE;
};
@@ -120,7 +130,9 @@ public:
virtual css::uno::Any getAny() const SAL_OVERRIDE;
virtual OUString getString() const SAL_OVERRIDE;
+#ifdef DEBUG_DOMAINMAPPER
virtual std::string toString() const SAL_OVERRIDE;
+#endif
virtual OOXMLValue * clone() const SAL_OVERRIDE;
};
@@ -134,7 +146,9 @@ public:
virtual ~OOXMLInputStreamValue();
virtual css::uno::Any getAny() const SAL_OVERRIDE;
+#ifdef DEBUG_DOMAINMAPPER
virtual std::string toString() const SAL_OVERRIDE;
+#endif
virtual OOXMLValue * clone() const SAL_OVERRIDE;
};
@@ -168,7 +182,9 @@ public:
virtual void setType(const std::string & rsType) SAL_OVERRIDE;
+#ifdef DEBUG_DOMAINMAPPER
virtual std::string toString() SAL_OVERRIDE;
+#endif
};
class OOXMLPropertySetValue : public OOXMLValue
@@ -179,7 +195,9 @@ public:
virtual ~OOXMLPropertySetValue();
virtual writerfilter::Reference<Properties>::Pointer_t getProperties() SAL_OVERRIDE;
+#ifdef DEBUG_DOMAINMAPPER
virtual std::string toString() const SAL_OVERRIDE;
+#endif
virtual OOXMLValue * clone() const SAL_OVERRIDE;
};
@@ -194,7 +212,9 @@ public:
virtual int getInt() const SAL_OVERRIDE;
virtual css::uno::Any getAny() const SAL_OVERRIDE;
+#ifdef DEBUG_DOMAINMAPPER
virtual std::string toString() const SAL_OVERRIDE;
+#endif
virtual OOXMLValue * clone() const SAL_OVERRIDE;
};
@@ -208,7 +228,9 @@ public:
virtual ~OOXMLHexValue();
virtual int getInt() const SAL_OVERRIDE;
+#ifdef DEBUG_DOMAINMAPPER
virtual std::string toString() const SAL_OVERRIDE;
+#endif
virtual OOXMLValue * clone() const SAL_OVERRIDE;
};
@@ -222,7 +244,9 @@ public:
virtual ~OOXMLUniversalMeasureValue();
virtual int getInt() const SAL_OVERRIDE;
+#ifdef DEBUG_DOMAINMAPPER
virtual std::string toString() const SAL_OVERRIDE;
+#endif
virtual OOXMLValue* clone() const SAL_OVERRIDE;
};
@@ -235,7 +259,9 @@ public:
virtual ~OOXMLShapeValue();
virtual css::uno::Any getAny() const SAL_OVERRIDE;
+#ifdef DEBUG_DOMAINMAPPER
virtual std::string toString() const SAL_OVERRIDE;
+#endif
virtual OOXMLValue * clone() const SAL_OVERRIDE;
};
@@ -248,7 +274,9 @@ public:
virtual ~OOXMLStarMathValue();
virtual css::uno::Any getAny() const SAL_OVERRIDE;
+#ifdef DEBUG_DOMAINMAPPER
virtual std::string toString() const SAL_OVERRIDE;
+#endif
virtual OOXMLValue * clone() const SAL_OVERRIDE;
};
diff --git a/writerfilter/source/ooxml/factoryimpl.xsl b/writerfilter/source/ooxml/factoryimpl.xsl
index 63d7412..f1fb236 100644
--- a/writerfilter/source/ooxml/factoryimpl.xsl
+++ b/writerfilter/source/ooxml/factoryimpl.xsl
@@ -177,6 +177,7 @@ public:
};
}
+#ifdef DEBUG_DOMAINMAPPER
string fastTokenToId(sal_uInt32 nToken)
{
</xsl:text>
@@ -218,6 +219,7 @@ string fastTokenToId(sal_uInt32 nToken)
return sResult;
}
+#endif
</xsl:text>
</xsl:template>
diff --git a/writerfilter/source/ooxml/fasttokens.py b/writerfilter/source/ooxml/fasttokens.py
index c8c2ca0..a364252 100644
--- a/writerfilter/source/ooxml/fasttokens.py
+++ b/writerfilter/source/ooxml/fasttokens.py
@@ -63,7 +63,9 @@ print("""const Token_t OOXML_FAST_TOKENS_END =5805;
namespace writerfilter {
namespace ooxml {
+#ifdef DEBUG_DOMAINMAPPER
string fastTokenToId(sal_uInt32 nToken);
+#endif
}}
diff --git a/writerfilter/source/resourcemodel/util.cxx b/writerfilter/source/resourcemodel/util.cxx
index 4b5549e..1eff140 100644
--- a/writerfilter/source/resourcemodel/util.cxx
+++ b/writerfilter/source/resourcemodel/util.cxx
@@ -36,8 +36,7 @@ namespace writerfilter
using namespace com::sun::star;
using namespace std;
-#if OSL_DEBUG_LEVEL > 1
-
+#ifdef DEBUG_DOMAINMAPPER
string toString(uno::Reference< text::XTextRange > textRange)
{
string result;
@@ -56,8 +55,8 @@ string toString(uno::Reference< text::XTextRange > textRange)
return result;
}
-
#endif
+
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/rtftok/rtfsprm.cxx b/writerfilter/source/rtftok/rtfsprm.cxx
index 5e637fb..53d4368 100644
--- a/writerfilter/source/rtftok/rtfsprm.cxx
+++ b/writerfilter/source/rtftok/rtfsprm.cxx
@@ -56,20 +56,21 @@ Sprm::Kind RTFSprm::getKind()
return Sprm::UNKNOWN;
}
+#ifdef DEBUG_DOMAINMAPPER
std::string RTFSprm::getName() const
{
return "RTFSprm";
}
+#endif
+#ifdef DEBUG_DOMAINMAPPER
std::string RTFSprm::toString() const
{
OStringBuffer aBuf("RTFSprm");
std::string sResult;
-#ifdef DEBUG_DOMAINMAPPER
sResult = (*QNameToString::Instance())(m_nKeyword);
-#endif
aBuf.append(" ('");
if (sResult.length() == 0)
@@ -82,6 +83,7 @@ std::string RTFSprm::toString() const
return aBuf.makeStringAndClear().getStr();
}
+#endif
RTFValue::Pointer_t RTFSprms::find(Id nKeyword, bool bFirst, bool bForWrite)
{
diff --git a/writerfilter/source/rtftok/rtfsprm.hxx b/writerfilter/source/rtftok/rtfsprm.hxx
index ccf25ad..576277c 100644
--- a/writerfilter/source/rtftok/rtfsprm.hxx
+++ b/writerfilter/source/rtftok/rtfsprm.hxx
@@ -111,8 +111,10 @@ public:
virtual writerfilter::Reference<Stream>::Pointer_t getStream() SAL_OVERRIDE;
virtual writerfilter::Reference<Properties>::Pointer_t getProps() SAL_OVERRIDE;
virtual Kind getKind() SAL_OVERRIDE;
+#ifdef DEBUG_DOMAINMAPPER
virtual std::string getName() const SAL_OVERRIDE;
virtual std::string toString() const SAL_OVERRIDE;
+#endif
private:
Id m_nKeyword;
RTFValue::Pointer_t& m_pValue;
diff --git a/writerfilter/source/rtftok/rtfvalue.cxx b/writerfilter/source/rtftok/rtfvalue.cxx
index f11facd..bbfafd4 100644
--- a/writerfilter/source/rtftok/rtfvalue.cxx
+++ b/writerfilter/source/rtftok/rtfvalue.cxx
@@ -210,6 +210,7 @@ writerfilter::Reference<BinaryObj>::Pointer_t RTFValue::getBinary()
return writerfilter::Reference<BinaryObj>::Pointer_t();
}
+#ifdef DEBUG_DOMAINMAPPER
std::string RTFValue::toString() const
{
if (!m_sValue.isEmpty() || m_bForceString)
@@ -217,6 +218,7 @@ std::string RTFValue::toString() const
else
return OString::number(m_nValue).getStr();
}
+#endif
RTFValue* RTFValue::Clone()
{
diff --git a/writerfilter/source/rtftok/rtfvalue.hxx b/writerfilter/source/rtftok/rtfvalue.hxx
index 797b340..af7d857 100644
--- a/writerfilter/source/rtftok/rtfvalue.hxx
+++ b/writerfilter/source/rtftok/rtfvalue.hxx
@@ -46,7 +46,9 @@ public:
virtual writerfilter::Reference<Properties>::Pointer_t getProperties() SAL_OVERRIDE;
virtual writerfilter::Reference<Stream>::Pointer_t getStream() SAL_OVERRIDE;
virtual writerfilter::Reference<BinaryObj>::Pointer_t getBinary() SAL_OVERRIDE;
+#ifdef DEBUG_DOMAINMAPPER
virtual std::string toString() const SAL_OVERRIDE;
+#endif
virtual RTFValue* Clone();
virtual RTFValue* CloneWithSprms(RTFSprms const& rAttributes, RTFSprms const& rSprms);
RTFSprms& getAttributes();
More information about the Libreoffice-commits
mailing list