diff options
-rw-r--r-- | filter/source/config/cache/cacheitem.cxx | 3 | ||||
-rw-r--r-- | filter/source/config/cache/cacheitem.hxx | 17 | ||||
-rw-r--r-- | filter/source/config/cache/typedetection.cxx | 23 |
3 files changed, 32 insertions, 11 deletions
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 <unotools/localfilehelper.hxx> #include <comphelper/processfactory.hxx> +#define DEBUG_TYPE_DETECTION 0 + +#if DEBUG_TYPE_DETECTION +#include <iostream> +using std::cout; +using std::endl; +#endif namespace filter{ namespace config{ @@ -226,6 +233,22 @@ struct EqualByName : public std::binary_function<FlatDetectionInfo, FlatDetectio } }; +#if DEBUG_TYPE_DETECTION +void printFlatDetectionList(const char* caption, const FlatDetection& types) +{ + cout << "-- " << caption << endl; + FlatDetection::const_iterator it = types.begin(), itEnd = types.end(); + for (; it != itEnd; ++it) + { + const FlatDetectionInfo& item = *it; + cout << " type='" << item.sType << "'; match by extension (" << item.bMatchByExtension + << "); match by pattern (" << item.bMatchByPattern << "); pre-selected by doc service (" + << item.bPreselectedByDocumentService << ")" << endl; + } + cout << "--" << endl; +} +#endif + } ::rtl::OUString SAL_CALL TypeDetection::queryTypeByDescriptor(css::uno::Sequence< css::beans::PropertyValue >& lDescriptor, |