diff options
-rw-r--r-- | unusedcode.easy | 10 | ||||
-rw-r--r-- | writerfilter/inc/resourcemodel/LoggedResources.hxx | 8 | ||||
-rw-r--r-- | writerfilter/inc/resourcemodel/TagLogger.hxx | 5 | ||||
-rw-r--r-- | writerfilter/source/resourcemodel/LoggedResources.cxx | 38 | ||||
-rw-r--r-- | writerfilter/source/resourcemodel/TagLogger.cxx | 101 |
5 files changed, 91 insertions, 71 deletions
diff --git a/unusedcode.easy b/unusedcode.easy index d58f94dcab24..7e7f321f207e 100644 --- a/unusedcode.easy +++ b/unusedcode.easy @@ -3163,16 +3163,6 @@ vcl::unotools::rectangle2DFromRectangle(Rectangle const&) vcl::unotools::rectangleFromRealRectangle2D(com::sun::star::geometry::RealRectangle2D const&) vcl::unotools::sizeFromB2ISize(basegfx::B2IVector const&) void ScCompressedArrayIterator<int, unsigned short>::Follow<unsigned char>(ScCompressedArrayIterator<int, unsigned char> const&) -writerfilter::LoggedResourcesHelper::attribute(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) -writerfilter::LoggedResourcesHelper::attribute(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int) -writerfilter::LoggedResourcesHelper::chars(rtl::OUString const&) -writerfilter::LoggedResourcesHelper::chars(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) -writerfilter::LoggedResourcesHelper::endElement(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) -writerfilter::LoggedResourcesHelper::setPrefix(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) -writerfilter::LoggedResourcesHelper::startElement(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) -writerfilter::PropertySetDumpHandler::PropertySetDumpHandler(writerfilter::TagLogger*, boost::shared_ptr<writerfilter::IdToString>) -writerfilter::TagLogger::endDocument() -writerfilter::TagLogger::unoPropertySet(com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet>) writerfilter::TagLogger::~TagLogger() writerfilter::XPathLogger::XPathLogger() writerfilter::XPathLogger::endElement() diff --git a/writerfilter/inc/resourcemodel/LoggedResources.hxx b/writerfilter/inc/resourcemodel/LoggedResources.hxx index 23129b8b4c93..0658e765c8f4 100644 --- a/writerfilter/inc/resourcemodel/LoggedResources.hxx +++ b/writerfilter/inc/resourcemodel/LoggedResources.hxx @@ -36,6 +36,7 @@ namespace writerfilter { +#ifdef DEBUG_LOGGING class WRITERFILTER_RESOURCEMODEL_DLLPUBLIC LoggedResourcesHelper { public: @@ -55,6 +56,7 @@ private: TagLogger::Pointer_t mpLogger; string msPrefix; }; +#endif class WRITERFILTER_RESOURCEMODEL_DLLPUBLIC LoggedStream : public Stream { @@ -93,7 +95,9 @@ protected: virtual void lcl_substream(Id name, writerfilter::Reference<Stream>::Pointer_t ref) = 0; virtual void lcl_info(const string & info) = 0; +#ifdef DEBUG_LOGGING LoggedResourcesHelper mHelper; +#endif }; class WRITERFILTER_RESOURCEMODEL_DLLPUBLIC LoggedProperties : public Properties @@ -109,7 +113,9 @@ protected: virtual void lcl_attribute(Id name, Value & val) = 0; virtual void lcl_sprm(Sprm & sprm) = 0; +#ifdef DEBUG_LOGGING LoggedResourcesHelper mHelper; +#endif }; class WRITERFILTER_RESOURCEMODEL_DLLPUBLIC LoggedTable : public Table @@ -123,7 +129,9 @@ public: protected: virtual void lcl_entry(int pos, writerfilter::Reference<Properties>::Pointer_t ref) = 0; +#ifdef DEBUG_LOGGING LoggedResourcesHelper mHelper; +#endif }; } diff --git a/writerfilter/inc/resourcemodel/TagLogger.hxx b/writerfilter/inc/resourcemodel/TagLogger.hxx index acae4225c703..46f0718cb745 100644 --- a/writerfilter/inc/resourcemodel/TagLogger.hxx +++ b/writerfilter/inc/resourcemodel/TagLogger.hxx @@ -65,12 +65,13 @@ namespace writerfilter #ifdef DEBUG_IMPORT void setFileName(const std::string & filename); - void startDocument(); + void endDocument(); #endif #ifdef DEBUG_DOMAINMAPPER void element(const std::string & name); + void unoPropertySet(uno::Reference<beans::XPropertySet> rPropSet); #endif void startElement(const std::string & name); void attribute(const std::string & name, const std::string & value); @@ -80,9 +81,7 @@ namespace writerfilter void chars(const std::string & chars); void chars(const ::rtl::OUString & chars); void endElement(); - void endDocument(); - void unoPropertySet(uno::Reference<beans::XPropertySet> rPropSet); #ifdef DEBUG_CONTEXT_HANDLER void propertySet(writerfilter::Reference<Properties>::Pointer_t props, IdToString::Pointer_t pIdToString); diff --git a/writerfilter/source/resourcemodel/LoggedResources.cxx b/writerfilter/source/resourcemodel/LoggedResources.cxx index bafce66ada72..24cf9baa4dee 100644 --- a/writerfilter/source/resourcemodel/LoggedResources.cxx +++ b/writerfilter/source/resourcemodel/LoggedResources.cxx @@ -32,6 +32,7 @@ namespace writerfilter { +#ifdef DEBUG_LOGGING // class: LoggedResourcesHelper LoggedResourcesHelper::LoggedResourcesHelper(TagLogger::Pointer_t pLogger, const string & sPrefix) @@ -77,11 +78,20 @@ void LoggedResourcesHelper::setPrefix(const string & rPrefix) { msPrefix = rPrefix; } +#endif // class: LoggedStream -LoggedStream::LoggedStream(TagLogger::Pointer_t pLogger, const string & sPrefix) -: mHelper(pLogger, sPrefix) +LoggedStream::LoggedStream( +#ifdef DEBUG_LOGGING + TagLogger::Pointer_t pLogger, + const string & sPrefix +) : mHelper(pLogger, sPrefix) +#else + TagLogger::Pointer_t, + const string& +) +#endif { } @@ -260,8 +270,16 @@ void LoggedStream::info(const string & _info) } // class LoggedProperties -LoggedProperties::LoggedProperties(TagLogger::Pointer_t pLogger, const string & sPrefix) -: mHelper(pLogger, sPrefix) +LoggedProperties::LoggedProperties( +#ifdef DEBUG_LOGGING + TagLogger::Pointer_t pLogger, + const string & sPrefix +) : mHelper(pLogger, sPrefix) +#else + TagLogger::Pointer_t, + const string& +) +#endif { } @@ -296,8 +314,16 @@ void LoggedProperties::sprm(Sprm & _sprm) #endif } -LoggedTable::LoggedTable(TagLogger::Pointer_t pLogger, const string & sPrefix) -: mHelper(pLogger, sPrefix) +LoggedTable::LoggedTable( +#ifdef DEBUG_LOGGING + TagLogger::Pointer_t pLogger, + const string & sPrefix +) : mHelper(pLogger, sPrefix) +#else + TagLogger::Pointer_t, + const string& +) +#endif { } diff --git a/writerfilter/source/resourcemodel/TagLogger.cxx b/writerfilter/source/resourcemodel/TagLogger.cxx index dd8cc6b7d77b..016dd2bb0aee 100644 --- a/writerfilter/source/resourcemodel/TagLogger.cxx +++ b/writerfilter/source/resourcemodel/TagLogger.cxx @@ -81,6 +81,20 @@ namespace writerfilter pWriter = xmlNewTextWriterFilename( fileName.c_str(), 0 ); xmlTextWriterSetIndent( pWriter, 4 ); } + + void TagLogger::startDocument() + { + xmlTextWriterStartDocument( pWriter, NULL, NULL, NULL ); + xmlTextWriterStartElement( pWriter, BAD_CAST( "root" ) ); + } + + void TagLogger::endDocument() + { + xmlTextWriterEndDocument( pWriter ); + xmlFreeTextWriter( pWriter ); + pWriter = NULL; + } + #endif TagLogger::Pointer_t TagLogger::getInstance(const char * name) @@ -104,20 +118,45 @@ namespace writerfilter return aIt->second; } -#ifdef DEBUG_IMPORT - void TagLogger::startDocument() - { - xmlTextWriterStartDocument( pWriter, NULL, NULL, NULL ); - xmlTextWriterStartElement( pWriter, BAD_CAST( "root" ) ); - } -#endif - #ifdef DEBUG_DOMAINMAPPER void TagLogger::element(const string & name) { startElement(name); endElement(); } + + void TagLogger::unoPropertySet(uno::Reference<beans::XPropertySet> rPropSet) + { + uno::Reference<beans::XPropertySetInfo> xPropSetInfo(rPropSet->getPropertySetInfo()); + uno::Sequence<beans::Property> aProps(xPropSetInfo->getProperties()); + + startElement( "unoPropertySet" ); + + for (int i = 0; i < aProps.getLength(); ++i) + { + startElement( "property" ); + ::rtl::OUString sName(aProps[i].Name); + + attribute( "name", sName ); + try + { + attribute( "value", rPropSet->getPropertyValue( sName ) ); + } + catch (uno::Exception) + { + startElement( "exception" ); + + chars("getPropertyValue(\""); + chars(sName); + chars("\")"); + + endElement( ); + } + endElement( ); + } + endElement( ); + } + #endif void TagLogger::startElement(const string & name) @@ -195,16 +234,9 @@ namespace writerfilter xmlTextWriterEndElement( pWriter ); } - void TagLogger::endDocument() - { - xmlTextWriterEndDocument( pWriter ); - xmlFreeTextWriter( pWriter ); - pWriter = NULL; - } - - +#ifdef DEBUG_CONTEXT_HANDLER class PropertySetDumpHandler : public Properties -{ + { IdToString::Pointer_t mpIdToString; TagLogger::Pointer_t m_pLogger; @@ -268,7 +300,6 @@ namespace writerfilter m_pLogger->endElement(); } -#ifdef DEBUG_CONTEXT_HANDLER void TagLogger::propertySet(writerfilter::Reference<Properties>::Pointer_t props, IdToString::Pointer_t pIdToString) { @@ -282,40 +313,6 @@ namespace writerfilter } #endif - void TagLogger::unoPropertySet(uno::Reference<beans::XPropertySet> rPropSet) - { - uno::Reference<beans::XPropertySetInfo> xPropSetInfo(rPropSet->getPropertySetInfo()); - uno::Sequence<beans::Property> aProps(xPropSetInfo->getProperties()); - - startElement( "unoPropertySet" ); - - for (int i = 0; i < aProps.getLength(); ++i) - { - startElement( "property" ); - ::rtl::OUString sName(aProps[i].Name); - - attribute( "name", sName ); - try - { - attribute( "value", rPropSet->getPropertyValue( sName ) ); - } - catch (uno::Exception) - { - startElement( "exception" ); - - chars("getPropertyValue(\""); - chars(sName); - chars("\")"); - - endElement( ); - } - - endElement( ); - } - - endElement( ); - } - } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |