diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2012-05-24 21:21:31 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2012-05-25 02:04:17 -0400 |
commit | 6e82a984a3bfbdaef405e445c6c6e345682920ee (patch) | |
tree | b10eea16c4f4c08fc86ea93312efeeaf35f81a79 /filter | |
parent | cc0b7db44ea58f9395d0d89a0f2bdac32a272eb7 (diff) |
Patterns should precede extensions.
Change-Id: Ib401fb6287efda68d07732382fc814961138d8a9
Diffstat (limited to 'filter')
-rw-r--r-- | filter/source/config/cache/typedetection.cxx | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/filter/source/config/cache/typedetection.cxx b/filter/source/config/cache/typedetection.cxx index cac9b1456f72..303ebfcfeb7e 100644 --- a/filter/source/config/cache/typedetection.cxx +++ b/filter/source/config/cache/typedetection.cxx @@ -109,13 +109,16 @@ TypeDetection::~TypeDetection() namespace { /** - * Types with matching extension come first, then types that are supported - * by the document service come next. + * Types with matching pattern first, then extension, then types that are + * supported by the document service come next. */ struct SortByPriority : public std::binary_function<FlatDetectionInfo, FlatDetectionInfo, bool> { bool operator() (const FlatDetectionInfo& r1, const FlatDetectionInfo& r2) const { + if (r1.bMatchByPattern != r2.bMatchByPattern) + return r1.bMatchByPattern; + if (r1.bMatchByExtension != r2.bMatchByExtension) return r1.bMatchByExtension; |