[PATCH] fdo#45084: Don't clear type and filter on every deep detection failure.

Kohei Yoshida kohei.yoshida at suse.com
Fri Jan 27 13:55:09 PST 2012

Because pre-selected filter is stored in the media descriptor, clearing
it every time a deep detection fails (which is bound to happen at least
once or twice during each type detection run) is probably not a good
idea.  Pre-selected filter data is used after all possible deep detection
runs are performed.
 filter/source/config/cache/typedetection.cxx |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/filter/source/config/cache/typedetection.cxx b/filter/source/config/cache/typedetection.cxx
index 7a5ec96..e34fc0b 100644
--- a/filter/source/config/cache/typedetection.cxx
+++ b/filter/source/config/cache/typedetection.cxx
@@ -1050,6 +1050,9 @@ void TypeDetection::impl_seekStreamToZero(comphelper::MediaDescriptor& rDescript
     // b) returned type is unknown  => return "" too and remove TYPE/FILTER prop from descriptor
     // c) returned type is valid    => check TYPE/FILTER props inside descriptor and return the type
+    if (sDeepType.isEmpty())
+        return rtl::OUString();
     // this special helper checks for a valid type
     // and set right values on the descriptor!
     sal_Bool bValidType = impl_validateAndSetTypeOnDescriptor(rDescriptor, sDeepType);


More information about the LibreOffice mailing list