[Libreoffice-commits] core.git: filter/source

Mike Kaganski (via logerrit) logerrit at kemper.freedesktop.org
Tue Sep 7 22:29:50 UTC 2021


 filter/source/config/cache/typedetection.cxx |    9 +--------
 filter/source/config/cache/typedetection.hxx |   11 -----------
 2 files changed, 1 insertion(+), 19 deletions(-)

New commits:
commit 8151f3a1d99ab740d2affdccc7115faa156bf3ad
Author:     Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Tue Sep 7 23:21:17 2021 +0200
Commit:     Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Wed Sep 8 00:29:17 2021 +0200

    Drop unused rUsedDetectors argument
    
    ... ever since commit e4003b67062e575f9b77772488f9b9691fa9fc38
    
      Author: Kohei Yoshida
      Date:   Thu Mar 7 01:35:09 2013 -0500
    
          Make check passes.  Remove deep-only detection for real.
    
          Now the type detection process is a lot more simpler.
    
    Change-Id: Ib0c08e28edf85a3642e187798a08ed2e143bf56c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121765
    Tested-by: Mike Kaganski <mike.kaganski at collabora.com>
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>

diff --git a/filter/source/config/cache/typedetection.cxx b/filter/source/config/cache/typedetection.cxx
index 1fd7cccc49ab..774005722a32 100644
--- a/filter/source/config/cache/typedetection.cxx
+++ b/filter/source/config/cache/typedetection.cxx
@@ -422,9 +422,8 @@ OUString SAL_CALL TypeDetection::queryTypeByDescriptor(css::uno::Sequence< css::
         // outside (bAllowDeep=sal_False) or break the whole detection by
         // throwing an exception if creation of the might needed input
         // stream failed by e.g. an IO exception ...
-        std::vector<OUString> lUsedDetectors;
         if (!lFlatTypes.empty())
-            sType = impl_detectTypeFlatAndDeep(stlDescriptor, lFlatTypes, bAllowDeep, lUsedDetectors, sLastChance);
+            sType = impl_detectTypeFlatAndDeep(stlDescriptor, lFlatTypes, bAllowDeep, sLastChance);
 
         // flat detection failed
         // pure deep detection failed
@@ -855,13 +854,11 @@ void TypeDetection::impl_getAllFormatTypes(
 OUString TypeDetection::impl_detectTypeFlatAndDeep(      utl::MediaDescriptor& rDescriptor   ,
                                                           const FlatDetection&                 lFlatTypes    ,
                                                                 bool                       bAllowDeep    ,
-                                                                std::vector<OUString>&         rUsedDetectors,
                                                                 OUString&               rLastChance   )
 {
     // reset it everytimes, so the outside code can distinguish between
     // a set and a not set value.
     rLastChance.clear();
-    rUsedDetectors.clear();
 
     // step over all possible types for this URL.
     // solutions:
@@ -919,10 +916,6 @@ OUString TypeDetection::impl_detectTypeFlatAndDeep(      utl::MediaDescriptor& r
                 continue;
             }
 
-            // don't forget to add every real asked deep detection service here.
-            // Such detectors will be ignored if may be "impl_detectTypeDeepOnly()"
-            // must be called later!
-            rUsedDetectors.push_back(sDetectService);
             OUString sDeepType = impl_askDetectService(sDetectService, rDescriptor);
 
             // d)
diff --git a/filter/source/config/cache/typedetection.hxx b/filter/source/config/cache/typedetection.hxx
index 21f598055fda..79145e836d17 100644
--- a/filter/source/config/cache/typedetection.hxx
+++ b/filter/source/config/cache/typedetection.hxx
@@ -98,10 +98,6 @@ private:
                     was used without getting any result. Then this "last-chance-type"
                     should be returned. Of course using of it can fail too ... but it's a try :-)
 
-                    As an optimization - this method collects the names of all used deep
-                    detection services. This information can be useful inside the may be
-                    afterwards called method "impl_detectTypeDeepOnly()"!
-
         @param      rDescriptor
                     provides any easy-to-use stl interface to the MediaDescriptor.
                     Note : Its content will be adapted to returned result of this method.
@@ -116,12 +112,6 @@ private:
                     Note: it will be reset to an empty string every time. So
                     a set value of "rLastChance" can be detected outside very easy.
 
-        @param      rUsedDetectors
-                    used as [out] parameter. It contains a list of names of all deep
-                    detection services, which was used inside this method.
-                    Such detectors can be ignored later if "impl_detectTypeDeepOnly()"
-                    is called.
-
         @param      bAllowDeep
                     enable/disable using of a might existing deep detection service.
 
@@ -132,7 +122,6 @@ private:
     OUString impl_detectTypeFlatAndDeep(      utl::MediaDescriptor& rDescriptor   ,
                                                const FlatDetection&                 lFlatTypes    ,
                                                      bool                       bAllowDeep    ,
-                                                     std::vector<OUString>&         rUsedDetectors,
                                                      OUString&               rLastChance   );
 
 


More information about the Libreoffice-commits mailing list