From 71ca001ae1621a0a48fb7377c2afd3697e2a2203 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Mon, 4 Feb 2013 11:28:44 -0500 Subject: Add some debug bits for type detection code. The code is used only during debugging and needs to be explicitly enabled by setting DEBUG_TYPE_DETECTION to 1 and inserting the function that prints debug outputs. Change-Id: I72f31eb86f7fcc99030e3bb6c2a869d076b066fd --- filter/source/config/cache/cacheitem.cxx | 3 +++ filter/source/config/cache/cacheitem.hxx | 17 ++++++----------- filter/source/config/cache/typedetection.cxx | 23 +++++++++++++++++++++++ 3 files changed, 32 insertions(+), 11 deletions(-) (limited to 'filter/source/config/cache') diff --git a/filter/source/config/cache/cacheitem.cxx b/filter/source/config/cache/cacheitem.cxx index 005285d1524c..d33c3fb9e364 100644 --- a/filter/source/config/cache/cacheitem.cxx +++ b/filter/source/config/cache/cacheitem.cxx @@ -389,6 +389,9 @@ sal_Bool CacheItem::dontHaveProps(const CacheItem& lProps) const return sal_True; } +FlatDetectionInfo::FlatDetectionInfo() : + bMatchByExtension(false), bMatchByPattern(false), bPreselectedByDocumentService(false) {} + } // namespace config } // namespace filter diff --git a/filter/source/config/cache/cacheitem.hxx b/filter/source/config/cache/cacheitem.hxx index 33e7272d4df8..5e018905aa4b 100644 --- a/filter/source/config/cache/cacheitem.hxx +++ b/filter/source/config/cache/cacheitem.hxx @@ -206,26 +206,21 @@ typedef ::boost::unordered_map< ::rtl::OUString , structure can decide then, if a deep detection should be suppressed e.g. if an URLPattern was used. */ -struct FlatDetectionInfo +struct FlatDetectionInfo { // the internal type name ::rtl::OUString sType; // this type was found by a matching the URL extension - sal_Bool bMatchByExtension; + bool bMatchByExtension; // this type was found by a matching URL Pattern - sal_Bool bMatchByPattern; + bool bMatchByPattern; // the user selected this type implicit by selecting a corresponding office module - sal_Bool bPreselectedByDocumentService; - - FlatDetectionInfo() - : sType (::rtl::OUString()) - , bMatchByExtension (sal_False ) - , bMatchByPattern (sal_False ) - , bPreselectedByDocumentService(sal_False ) - {} + bool bPreselectedByDocumentService; + + FlatDetectionInfo(); }; typedef ::std::list< FlatDetectionInfo > FlatDetection; diff --git a/filter/source/config/cache/typedetection.cxx b/filter/source/config/cache/typedetection.cxx index f3772e524101..e7c0bc048e17 100644 --- a/filter/source/config/cache/typedetection.cxx +++ b/filter/source/config/cache/typedetection.cxx @@ -34,6 +34,13 @@ #include #include +#define DEBUG_TYPE_DETECTION 0 + +#if DEBUG_TYPE_DETECTION +#include +using std::cout; +using std::endl; +#endif namespace filter{ namespace config{ @@ -226,6 +233,22 @@ struct EqualByName : public std::binary_function& lDescriptor, -- cgit