diff options
Diffstat (limited to 'filter/source/config/cache/typedetection.hxx')
-rw-r--r-- | filter/source/config/cache/typedetection.hxx | 45 |
1 files changed, 17 insertions, 28 deletions
diff --git a/filter/source/config/cache/typedetection.hxx b/filter/source/config/cache/typedetection.hxx index b0281d5f983d..6ff70e64eba4 100644 --- a/filter/source/config/cache/typedetection.hxx +++ b/filter/source/config/cache/typedetection.hxx @@ -16,8 +16,7 @@ * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_FILTER_SOURCE_CONFIG_CACHE_TYPEDETECTION_HXX -#define INCLUDED_FILTER_SOURCE_CONFIG_CACHE_TYPEDETECTION_HXX +#pragma once #include "basecontainer.hxx" #include <com/sun/star/document/XTypeDetection.hpp> @@ -25,6 +24,7 @@ #include <unotools/mediadescriptor.hxx> #include <cppuhelper/compbase.hxx> #include <cppuhelper/implbase.hxx> +#include <comphelper/compbase.hxx> namespace filter::config { @@ -70,18 +70,21 @@ public: private: - bool impl_getPreselectionForType( + static bool impl_getPreselectionForType( + std::unique_lock<std::mutex>& rGuard, const OUString& sPreSelType, const css::util::URL& aParsedURL, FlatDetection& rFlatTypes, bool bDocService); - void impl_getPreselectionForDocumentService( + static void impl_getPreselectionForDocumentService( + std::unique_lock<std::mutex>& rGuard, const OUString& sPreSelDocumentService, const css::util::URL& aParsedURL, FlatDetection& rFlatTypes); - OUString impl_getTypeFromFilter(const OUString& rFilterName); + static OUString impl_getTypeFromFilter(std::unique_lock<std::mutex>& rGuard, const OUString& rFilterName); /** * Get all format types that we handle. */ - void impl_getAllFormatTypes( + static void impl_getAllFormatTypes( + std::unique_lock<std::mutex>& rGuard, const css::util::URL& aParsedURL, utl::MediaDescriptor const & rDescriptor, FlatDetection& rFlatTypes); @@ -99,10 +102,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. @@ -117,12 +116,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. @@ -133,7 +126,6 @@ private: OUString impl_detectTypeFlatAndDeep( utl::MediaDescriptor& rDescriptor , const FlatDetection& lFlatTypes , bool bAllowDeep , - std::vector<OUString>& rUsedDetectors, OUString& rLastChance ); @@ -184,7 +176,7 @@ private: @return [string] a valid type name or an empty string if user canceled interaction. */ - OUString impl_askUserForTypeAndFilterIfAllowed(utl::MediaDescriptor& rDescriptor); + static OUString impl_askUserForTypeAndFilterIfAllowed(utl::MediaDescriptor& rDescriptor); /** @short check if an input stream is already part of the @@ -241,8 +233,8 @@ private: @return TRUE the specified type and its registrations was valid(!) and could be set on the descriptor. */ - bool impl_validateAndSetTypeOnDescriptor( utl::MediaDescriptor& rDescriptor, - const OUString& sType ); + static bool impl_validateAndSetTypeOnDescriptor( utl::MediaDescriptor& rDescriptor, + const OUString& sType ); /** @short validate the specified filter and its relationships @@ -262,7 +254,8 @@ private: @return TRUE the specified type and its registrations was valid(!) and could be set on the descriptor. */ - bool impl_validateAndSetFilterOnDescriptor( utl::MediaDescriptor& rDescriptor, + static bool impl_validateAndSetFilterOnDescriptor( + utl::MediaDescriptor& rDescriptor, const OUString& sFilter ); @@ -328,15 +321,14 @@ public: }; -class TerminateDetection : public cppu::WeakComponentImplHelper<css::frame::XTerminateListener> +class TerminateDetection : public comphelper::WeakComponentImplHelper<css::frame::XTerminateListener> { private: - osl::Mutex m_aLock; TypeDetection* m_pTypeDetection; public: - using cppu::WeakComponentImplHelperBase::disposing; + using comphelper::WeakComponentImplHelperBase::disposing; virtual void SAL_CALL disposing(const css::lang::EventObject&) override { } @@ -352,14 +344,11 @@ public: } TerminateDetection(TypeDetection* pTypeDetection) - : cppu::WeakComponentImplHelper<css::frame::XTerminateListener>(m_aLock) - , m_pTypeDetection(pTypeDetection) + : m_pTypeDetection(pTypeDetection) { } }; } -#endif // INCLUDED_FILTER_SOURCE_CONFIG_CACHE_TYPEDETECTION_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |