[Libreoffice-commits] .: writerfilter/inc writerfilter/source
Miklos Vajna
vmiklos at kemper.freedesktop.org
Wed Dec 21 16:46:05 PST 2011
writerfilter/inc/resourcemodel/TagLogger.hxx | 11 +++
writerfilter/source/resourcemodel/TagLogger.cxx | 69 ++++++++++++++++++++++++
2 files changed, 80 insertions(+)
New commits:
commit acfdec468d54d44f94ca6752bbbfbdab07ef9a0c
Author: Miklos Vajna <vmiklos at frugalware.org>
Date: Thu Dec 22 01:46:33 2011 +0100
writerfilter: fix dbglevel=2 build
This basically reverts e8f980d10cf95b8bced1ca18a55b2a4784f6dcc9 and
b0e993d42e1df8c68c4c2684ab9dda27a1329594, while keeping callcatcher
happy.
diff --git a/writerfilter/inc/resourcemodel/TagLogger.hxx b/writerfilter/inc/resourcemodel/TagLogger.hxx
index 44dc901..f5ca4eb 100644
--- a/writerfilter/inc/resourcemodel/TagLogger.hxx
+++ b/writerfilter/inc/resourcemodel/TagLogger.hxx
@@ -73,7 +73,18 @@ namespace writerfilter
void element(const std::string & name);
void unoPropertySet(uno::Reference<beans::XPropertySet> rPropSet);
#endif
+#if OSL_DEBUG_LEVEL > 1
+ void startElement(const std::string & name);
+#endif
void attribute(const std::string & name, const std::string & value);
+#if OSL_DEBUG_LEVEL > 1
+ void attribute(const std::string & name, const ::rtl::OUString & value);
+ void attribute(const std::string & name, sal_uInt32 value);
+ void attribute(const std::string & name, const uno::Any aAny);
+ void chars(const std::string & chars);
+ void chars(const ::rtl::OUString & chars);
+ void endElement();
+#endif
#ifdef DEBUG_CONTEXT_HANDLER
void propertySet(writerfilter::Reference<Properties>::Pointer_t props,
diff --git a/writerfilter/source/resourcemodel/TagLogger.cxx b/writerfilter/source/resourcemodel/TagLogger.cxx
index dcdd461..7ee16fe 100644
--- a/writerfilter/source/resourcemodel/TagLogger.cxx
+++ b/writerfilter/source/resourcemodel/TagLogger.cxx
@@ -156,6 +156,15 @@ namespace writerfilter
#endif
+#if OSL_DEBUG_LEVEL > 1
+ void TagLogger::startElement(const string & name)
+ {
+ xmlChar* xmlName = xmlCharStrdup( name.c_str() );
+ xmlTextWriterStartElement( pWriter, xmlName );
+ xmlFree( xmlName );
+ }
+#endif
+
void TagLogger::attribute(const string & name, const string & value)
{
xmlChar* xmlName = xmlCharStrdup( name.c_str() );
@@ -166,6 +175,66 @@ namespace writerfilter
xmlFree( xmlName );
}
+#if OSL_DEBUG_LEVEL > 1
+ void TagLogger::attribute(const string & name, const ::rtl::OUString & value)
+ {
+ attribute( name, OUStringToOString( value, RTL_TEXTENCODING_ASCII_US ).getStr() );
+ }
+
+ void TagLogger::attribute(const string & name, sal_uInt32 value)
+ {
+ xmlChar* xmlName = xmlCharStrdup( name.c_str() );
+ xmlTextWriterWriteFormatAttribute( pWriter, xmlName,
+ "%" SAL_PRIuUINT32, value );
+ xmlFree( xmlName );
+ }
+
+ void TagLogger::attribute(const string & name, const uno::Any aAny)
+ {
+ string aTmpStrInt;
+ string aTmpStrFloat;
+ string aTmpStrString;
+
+ sal_Int32 nInt = 0;
+ float nFloat = 0.0;
+ ::rtl::OUString aStr;
+
+ xmlChar* xmlName = xmlCharStrdup( name.c_str() );
+ if ( aAny >>= nInt )
+ {
+ xmlTextWriterWriteFormatAttribute( pWriter, xmlName,
+ "%" SAL_PRIdINT32, nInt );
+ }
+ else if ( aAny >>= nFloat )
+ {
+ xmlTextWriterWriteFormatAttribute( pWriter, xmlName,
+ "%f", nFloat );
+ }
+ else if ( aAny >>= aStr )
+ {
+ attribute( name, aStr );
+ }
+ xmlFree( xmlName );
+ }
+
+ void TagLogger::chars(const string & rChars)
+ {
+ xmlChar* xmlChars = xmlCharStrdup( rChars.c_str() );
+ xmlTextWriterWriteString( pWriter, xmlChars );
+ xmlFree( xmlChars );
+ }
+
+ void TagLogger::chars(const ::rtl::OUString & rChars)
+ {
+ chars(OUStringToOString(rChars, RTL_TEXTENCODING_ASCII_US).getStr());
+ }
+
+ void TagLogger::endElement()
+ {
+ xmlTextWriterEndElement( pWriter );
+ }
+#endif
+
#ifdef DEBUG_CONTEXT_HANDLER
class PropertySetDumpHandler : public Properties
{
More information about the Libreoffice-commits
mailing list