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

writerfilter: Hide more debug-only stuff behind the DEBUG_DOMAINMAPPER.

Change-Id: I0e86cafab97f0adad516660c6fdf40e13d114bf2
üst 1c876f56
......@@ -30,6 +30,7 @@
namespace writerfilter
{
#ifdef DEBUG_DOMAINMAPPER
class IdToString
{
public:
......@@ -39,6 +40,7 @@ namespace writerfilter
protected:
~IdToString() {}
};
#endif
class TagLogger
{
......
......@@ -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() {}
......
......@@ -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
}
......
......@@ -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");
......
......@@ -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>
......
......@@ -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
{
......
......@@ -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;
};
......
......@@ -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>
......
......@@ -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
}}
......
......@@ -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: */
......@@ -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)
{
......
......@@ -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;
......
......@@ -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()
{
......
......@@ -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();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment