diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2013-11-13 08:52:41 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2013-11-14 11:13:24 +0100 |
commit | 24cad6a6490b245bd88ec3e3c87195628914f6a2 (patch) | |
tree | 12d9e7ec629054f5ad0a6990783d3e639449afeb /filter | |
parent | 8061c8c70b7ffcd8f472d2f5b909911f2095fec7 (diff) |
Move MediaDescriptor from comphelper to unotools
...so it will be able to use SvtSecurityOptions internally.
Change-Id: Id7433247e8fc53651935578510bedbcca5aa2ac9
Diffstat (limited to 'filter')
-rw-r--r-- | filter/source/config/cache/typedetection.cxx | 74 | ||||
-rw-r--r-- | filter/source/config/cache/typedetection.hxx | 22 | ||||
-rw-r--r-- | filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx | 10 |
3 files changed, 53 insertions, 53 deletions
diff --git a/filter/source/config/cache/typedetection.cxx b/filter/source/config/cache/typedetection.cxx index efb4051474fb..c6258e6cb227 100644 --- a/filter/source/config/cache/typedetection.cxx +++ b/filter/source/config/cache/typedetection.cxx @@ -370,14 +370,14 @@ OUString SAL_CALL TypeDetection::queryTypeByDescriptor(css::uno::Sequence< css:: throw (css::uno::RuntimeException) { // make the descriptor more useable :-) - ::comphelper::MediaDescriptor stlDescriptor(lDescriptor); + utl::MediaDescriptor stlDescriptor(lDescriptor); // SAFE -> ---------------------------------- ::osl::ResettableMutexGuard aLock(m_aLock); //******************************************* // parse given URL to split it into e.g. main and jump marks ... - OUString sURL = stlDescriptor.getUnpackedValueOrDefault(::comphelper::MediaDescriptor::PROP_URL(), OUString()); + OUString sURL = stlDescriptor.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_URL(), OUString()); #if OSL_DEBUG_LEVEL > 0 if (stlDescriptor.find( "FileName" ) != stlDescriptor.end()) @@ -390,13 +390,13 @@ OUString SAL_CALL TypeDetection::queryTypeByDescriptor(css::uno::Sequence< css:: xParser->parseStrict(aURL); OUString aSelectedFilter = stlDescriptor.getUnpackedValueOrDefault( - comphelper::MediaDescriptor::PROP_FILTERNAME(), OUString()); + utl::MediaDescriptor::PROP_FILTERNAME(), OUString()); if (!aSelectedFilter.isEmpty()) { // Caller specified the filter type. Honor it. Just get the default // type for that filter, and bail out. if (impl_validateAndSetFilterOnDescriptor(stlDescriptor, aSelectedFilter)) - return stlDescriptor[comphelper::MediaDescriptor::PROP_TYPENAME()].get<OUString>(); + return stlDescriptor[utl::MediaDescriptor::PROP_TYPENAME()].get<OUString>(); } FlatDetection lFlatTypes; @@ -466,13 +466,13 @@ OUString SAL_CALL TypeDetection::queryTypeByDescriptor(css::uno::Sequence< css:: -void TypeDetection::impl_checkResultsAndAddBestFilter(::comphelper::MediaDescriptor& rDescriptor, +void TypeDetection::impl_checkResultsAndAddBestFilter(utl::MediaDescriptor& rDescriptor, OUString& sType ) { // a) // Dont overwrite a might preselected filter! OUString sFilter = rDescriptor.getUnpackedValueOrDefault( - ::comphelper::MediaDescriptor::PROP_FILTERNAME(), + utl::MediaDescriptor::PROP_FILTERNAME(), OUString()); if (!sFilter.isEmpty()) return; @@ -481,7 +481,7 @@ void TypeDetection::impl_checkResultsAndAddBestFilter(::comphelper::MediaDescrip // check a preselected document service too. // Then we have to search a suitable filter witin this module. OUString sDocumentService = rDescriptor.getUnpackedValueOrDefault( - ::comphelper::MediaDescriptor::PROP_DOCUMENTSERVICE(), + utl::MediaDescriptor::PROP_DOCUMENTSERVICE(), OUString()); if (!sDocumentService.isEmpty()) { @@ -528,8 +528,8 @@ void TypeDetection::impl_checkResultsAndAddBestFilter(::comphelper::MediaDescrip if (!sFilter.isEmpty()) { - rDescriptor[::comphelper::MediaDescriptor::PROP_TYPENAME() ] <<= sRealType; - rDescriptor[::comphelper::MediaDescriptor::PROP_FILTERNAME()] <<= sFilter; + rDescriptor[utl::MediaDescriptor::PROP_TYPENAME() ] <<= sRealType; + rDescriptor[utl::MediaDescriptor::PROP_FILTERNAME()] <<= sFilter; sType = sRealType; return; } @@ -559,8 +559,8 @@ void TypeDetection::impl_checkResultsAndAddBestFilter(::comphelper::MediaDescrip // <- SAFE // no exception => found valid type and filter => set it on the given descriptor - rDescriptor[::comphelper::MediaDescriptor::PROP_TYPENAME() ] <<= sType ; - rDescriptor[::comphelper::MediaDescriptor::PROP_FILTERNAME()] <<= sFilter; + rDescriptor[utl::MediaDescriptor::PROP_TYPENAME() ] <<= sType ; + rDescriptor[utl::MediaDescriptor::PROP_FILTERNAME()] <<= sFilter; return; } catch(const css::uno::Exception&) @@ -614,8 +614,8 @@ void TypeDetection::impl_checkResultsAndAddBestFilter(::comphelper::MediaDescrip if (!sFilter.isEmpty()) { - rDescriptor[::comphelper::MediaDescriptor::PROP_TYPENAME() ] <<= sType ; - rDescriptor[::comphelper::MediaDescriptor::PROP_FILTERNAME()] <<= sFilter; + rDescriptor[utl::MediaDescriptor::PROP_TYPENAME() ] <<= sType ; + rDescriptor[utl::MediaDescriptor::PROP_FILTERNAME()] <<= sFilter; return; } } @@ -797,7 +797,7 @@ OUString TypeDetection::impl_getTypeFromFilter(const OUString& rFilterName) } void TypeDetection::impl_getAllFormatTypes( - const util::URL& aParsedURL, comphelper::MediaDescriptor& rDescriptor, FlatDetection& rFlatTypes) + const util::URL& aParsedURL, utl::MediaDescriptor& rDescriptor, FlatDetection& rFlatTypes) { rFlatTypes.clear(); @@ -858,19 +858,19 @@ void TypeDetection::impl_getAllFormatTypes( rFlatTypes.unique(EqualByType()); // Mark pre-selected type (if any) to have it prioritized. - OUString sSelectedType = rDescriptor.getUnpackedValueOrDefault(comphelper::MediaDescriptor::PROP_TYPENAME(), OUString()); + OUString sSelectedType = rDescriptor.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_TYPENAME(), OUString()); if (!sSelectedType.isEmpty()) impl_getPreselectionForType(sSelectedType, aParsedURL, rFlatTypes, false); // Mark all types preferred by the current document service, to have it prioritized. - OUString sSelectedDoc = rDescriptor.getUnpackedValueOrDefault(comphelper::MediaDescriptor::PROP_DOCUMENTSERVICE(), OUString()); + OUString sSelectedDoc = rDescriptor.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_DOCUMENTSERVICE(), OUString()); if (!sSelectedDoc.isEmpty()) impl_getPreselectionForDocumentService(sSelectedDoc, aParsedURL, rFlatTypes); } -OUString TypeDetection::impl_detectTypeFlatAndDeep( ::comphelper::MediaDescriptor& rDescriptor , +OUString TypeDetection::impl_detectTypeFlatAndDeep( utl::MediaDescriptor& rDescriptor , const FlatDetection& lFlatTypes , sal_Bool bAllowDeep , OUStringList& rUsedDetectors, @@ -957,12 +957,12 @@ OUString TypeDetection::impl_detectTypeFlatAndDeep( ::comphelper::MediaDesc // <- SAFE ---------------------------------- } -void TypeDetection::impl_seekStreamToZero(comphelper::MediaDescriptor& rDescriptor) +void TypeDetection::impl_seekStreamToZero(utl::MediaDescriptor& rDescriptor) { // try to seek to 0 ... // But because XSeekable is an optional interface ... try it only .-) css::uno::Reference< css::io::XInputStream > xStream = rDescriptor.getUnpackedValueOrDefault( - ::comphelper::MediaDescriptor::PROP_INPUTSTREAM(), + utl::MediaDescriptor::PROP_INPUTSTREAM(), css::uno::Reference< css::io::XInputStream >()); css::uno::Reference< css::io::XSeekable > xSeek(xStream, css::uno::UNO_QUERY); if (xSeek.is()) @@ -982,7 +982,7 @@ void TypeDetection::impl_seekStreamToZero(comphelper::MediaDescriptor& rDescript } OUString TypeDetection::impl_askDetectService(const OUString& sDetectService, - ::comphelper::MediaDescriptor& rDescriptor ) + utl::MediaDescriptor& rDescriptor ) { // Open the stream and add it to the media descriptor if this method is called for the first time. // All following requests to this method will detect, that there already exists a stream .-) @@ -1068,21 +1068,21 @@ OUString TypeDetection::impl_askDetectService(const OUString& sDet -OUString TypeDetection::impl_askUserForTypeAndFilterIfAllowed(::comphelper::MediaDescriptor& rDescriptor) +OUString TypeDetection::impl_askUserForTypeAndFilterIfAllowed(utl::MediaDescriptor& rDescriptor) { css::uno::Reference< css::task::XInteractionHandler > xInteraction = - rDescriptor.getUnpackedValueOrDefault(::comphelper::MediaDescriptor::PROP_INTERACTIONHANDLER(), + rDescriptor.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_INTERACTIONHANDLER(), css::uno::Reference< css::task::XInteractionHandler >()); if (!xInteraction.is()) return OUString(); OUString sURL = - rDescriptor.getUnpackedValueOrDefault(::comphelper::MediaDescriptor::PROP_URL(), + rDescriptor.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_URL(), OUString()); css::uno::Reference< css::io::XInputStream > xStream = - rDescriptor.getUnpackedValueOrDefault(::comphelper::MediaDescriptor::PROP_INPUTSTREAM(), + rDescriptor.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_INPUTSTREAM(), css::uno::Reference< css::io::XInputStream >()); // Dont distrub the user for "non existing files - means empty URLs" or @@ -1118,7 +1118,7 @@ OUString TypeDetection::impl_askUserForTypeAndFilterIfAllowed(::comphelper::Medi return OUString(); OUString sType; - rDescriptor[::comphelper::MediaDescriptor::PROP_TYPENAME()] >>= sType; + rDescriptor[utl::MediaDescriptor::PROP_TYPENAME()] >>= sType; return sType; } catch(const css::uno::Exception&) @@ -1129,12 +1129,12 @@ OUString TypeDetection::impl_askUserForTypeAndFilterIfAllowed(::comphelper::Medi -void TypeDetection::impl_openStream(::comphelper::MediaDescriptor& rDescriptor) +void TypeDetection::impl_openStream(utl::MediaDescriptor& rDescriptor) throw (css::uno::Exception) { sal_Bool bSuccess = sal_False; - OUString sURL = rDescriptor.getUnpackedValueOrDefault( ::comphelper::MediaDescriptor::PROP_URL(), OUString() ); - sal_Bool bRequestedReadOnly = rDescriptor.getUnpackedValueOrDefault( ::comphelper::MediaDescriptor::PROP_READONLY(), sal_False ); + OUString sURL = rDescriptor.getUnpackedValueOrDefault( utl::MediaDescriptor::PROP_URL(), OUString() ); + sal_Bool bRequestedReadOnly = rDescriptor.getUnpackedValueOrDefault( utl::MediaDescriptor::PROP_READONLY(), sal_False ); if ( !sURL.isEmpty() && ::utl::LocalFileHelper::IsLocalFile( INetURLObject( sURL ).GetMainURL( INetURLObject::NO_DECODE ) ) ) { // OOo uses own file locking mechanics in case of local file @@ -1154,16 +1154,16 @@ void TypeDetection::impl_openStream(::comphelper::MediaDescriptor& rDescriptor) // this argument should be either removed or an additional argument should be added so that application // can separate the case when the user explicitly requests readonly document. // The current solution is to remove it here. - rDescriptor.erase( ::comphelper::MediaDescriptor::PROP_READONLY() ); + rDescriptor.erase( utl::MediaDescriptor::PROP_READONLY() ); } } -void TypeDetection::impl_removeTypeFilterFromDescriptor(::comphelper::MediaDescriptor& rDescriptor) +void TypeDetection::impl_removeTypeFilterFromDescriptor(utl::MediaDescriptor& rDescriptor) { - ::comphelper::MediaDescriptor::iterator pItType = rDescriptor.find(::comphelper::MediaDescriptor::PROP_TYPENAME() ); - ::comphelper::MediaDescriptor::iterator pItFilter = rDescriptor.find(::comphelper::MediaDescriptor::PROP_FILTERNAME()); + utl::MediaDescriptor::iterator pItType = rDescriptor.find(utl::MediaDescriptor::PROP_TYPENAME() ); + utl::MediaDescriptor::iterator pItFilter = rDescriptor.find(utl::MediaDescriptor::PROP_FILTERNAME()); if (pItType != rDescriptor.end()) rDescriptor.erase(pItType); if (pItFilter != rDescriptor.end()) @@ -1172,14 +1172,14 @@ void TypeDetection::impl_removeTypeFilterFromDescriptor(::comphelper::MediaDescr -sal_Bool TypeDetection::impl_validateAndSetTypeOnDescriptor( ::comphelper::MediaDescriptor& rDescriptor, +sal_Bool TypeDetection::impl_validateAndSetTypeOnDescriptor( utl::MediaDescriptor& rDescriptor, const OUString& sType ) { // SAFE -> ::osl::ResettableMutexGuard aLock(m_aLock); if (m_rCache->hasItem(FilterCache::E_TYPE, sType)) { - rDescriptor[::comphelper::MediaDescriptor::PROP_TYPENAME()] <<= sType; + rDescriptor[utl::MediaDescriptor::PROP_TYPENAME()] <<= sType; return sal_True; } aLock.clear(); @@ -1192,7 +1192,7 @@ sal_Bool TypeDetection::impl_validateAndSetTypeOnDescriptor( ::comphelper:: -sal_Bool TypeDetection::impl_validateAndSetFilterOnDescriptor( ::comphelper::MediaDescriptor& rDescriptor, +sal_Bool TypeDetection::impl_validateAndSetFilterOnDescriptor( utl::MediaDescriptor& rDescriptor, const OUString& sFilter ) { try @@ -1209,8 +1209,8 @@ sal_Bool TypeDetection::impl_validateAndSetFilterOnDescriptor( ::comphelper // <- SAFE // found valid type and filter => set it on the given descriptor - rDescriptor[::comphelper::MediaDescriptor::PROP_TYPENAME() ] <<= sType ; - rDescriptor[::comphelper::MediaDescriptor::PROP_FILTERNAME()] <<= sFilter; + rDescriptor[utl::MediaDescriptor::PROP_TYPENAME() ] <<= sType ; + rDescriptor[utl::MediaDescriptor::PROP_FILTERNAME()] <<= sFilter; return sal_True; } catch(const css::container::NoSuchElementException&){} diff --git a/filter/source/config/cache/typedetection.hxx b/filter/source/config/cache/typedetection.hxx index f7f75dbfd38a..e9f8113c111e 100644 --- a/filter/source/config/cache/typedetection.hxx +++ b/filter/source/config/cache/typedetection.hxx @@ -22,7 +22,7 @@ #include "basecontainer.hxx" #include <com/sun/star/document/XTypeDetection.hpp> #include <com/sun/star/lang/XSingleServiceFactory.hpp> -#include <comphelper/mediadescriptor.hxx> +#include <unotools/mediadescriptor.hxx> #include <cppuhelper/implbase1.hxx> @@ -77,7 +77,7 @@ private: * Get all format types that we handle. */ void impl_getAllFormatTypes( - const com::sun::star::util::URL& aParsedURL, comphelper::MediaDescriptor& rDescriptor, + const com::sun::star::util::URL& aParsedURL, utl::MediaDescriptor& rDescriptor, FlatDetection& rFlatTypes); //--------------------------------------- @@ -126,7 +126,7 @@ private: An empty value if detection failed. .... but see rLastChance for additional returns! */ - OUString impl_detectTypeFlatAndDeep( ::comphelper::MediaDescriptor& rDescriptor , + OUString impl_detectTypeFlatAndDeep( utl::MediaDescriptor& rDescriptor , const FlatDetection& lFlatTypes , sal_Bool bAllowDeep , OUStringList& rUsedDetectors, @@ -144,7 +144,7 @@ private: @param rDescriptor a stl representation of the MediaDescriptor as in/out parameter. */ - void impl_seekStreamToZero(comphelper::MediaDescriptor& rDescriptor); + void impl_seekStreamToZero(utl::MediaDescriptor& rDescriptor); //--------------------------------------- @@ -166,7 +166,7 @@ private: a stl representation of the MediaDescriptor as in/out parameter. */ OUString impl_askDetectService(const OUString& sDetectService, - ::comphelper::MediaDescriptor& rDescriptor ); + utl::MediaDescriptor& rDescriptor ); //--------------------------------------- @@ -183,7 +183,7 @@ private: @return [string] a valid type name or an empty string if user canceled interaction. */ - OUString impl_askUserForTypeAndFilterIfAllowed(::comphelper::MediaDescriptor& rDescriptor); + OUString impl_askUserForTypeAndFilterIfAllowed(utl::MediaDescriptor& rDescriptor); //--------------------------------------- @@ -220,7 +220,7 @@ private: Note: If an interactionHandler is part of the given descriptor too, it was already used. Means: let the exception pass trough the top most interface method! */ - void impl_openStream(::comphelper::MediaDescriptor& rDescriptor) + void impl_openStream(utl::MediaDescriptor& rDescriptor) throw (css::uno::Exception); //--------------------------------------- @@ -243,7 +243,7 @@ private: @return TRUE the specified type and its registrations was valid(!) and could be set on the descriptor. */ - sal_Bool impl_validateAndSetTypeOnDescriptor( ::comphelper::MediaDescriptor& rDescriptor, + sal_Bool impl_validateAndSetTypeOnDescriptor( utl::MediaDescriptor& rDescriptor, const OUString& sType ); //--------------------------------------- @@ -265,7 +265,7 @@ private: @return TRUE the specified type and its registrations was valid(!) and could be set on the descriptor. */ - sal_Bool impl_validateAndSetFilterOnDescriptor( ::comphelper::MediaDescriptor& rDescriptor, + sal_Bool impl_validateAndSetFilterOnDescriptor( utl::MediaDescriptor& rDescriptor, const OUString& sFilter ); //--------------------------------------- @@ -281,7 +281,7 @@ private: reference to the MediaDescriptor (represented by an easy-to-use stl interface!), which should be patched. */ - void impl_removeTypeFilterFromDescriptor(::comphelper::MediaDescriptor& rDescriptor); + void impl_removeTypeFilterFromDescriptor(utl::MediaDescriptor& rDescriptor); //--------------------------------------- @@ -315,7 +315,7 @@ private: rDescriptor will be changed by selecting another filter. (see code) */ - void impl_checkResultsAndAddBestFilter(::comphelper::MediaDescriptor& rDescriptor, + void impl_checkResultsAndAddBestFilter(utl::MediaDescriptor& rDescriptor, OUString& sType ); //------------------------------------------- diff --git a/filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx b/filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx index 200dc04cdf58..492407ad334f 100644 --- a/filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx +++ b/filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx @@ -45,7 +45,7 @@ #include <com/sun/star/container/XNameAccess.hpp> #include <comphelper/processfactory.hxx> #include <comphelper/sequenceashashmap.hxx> -#include <comphelper/mediadescriptor.hxx> +#include <unotools/mediadescriptor.hxx> #include <com/sun/star/beans/PropertyAttribute.hpp> #include <comphelper/genericpropertyset.hxx> #include <comphelper/propertysetinfo.hxx> @@ -77,9 +77,9 @@ sal_Bool SAL_CALL XmlFilterAdaptor::importImpl( const Sequence< ::com::sun::star sal_Int32 nSteps= 0; sal_Int32 nProgressRange = 4; - comphelper::MediaDescriptor aMediaMap(aDescriptor); + utl::MediaDescriptor aMediaMap(aDescriptor); Reference< XStatusIndicator > xStatusIndicator(aMediaMap.getUnpackedValueOrDefault( - comphelper::MediaDescriptor::PROP_STATUSINDICATOR(), Reference< XStatusIndicator >())); + utl::MediaDescriptor::PROP_STATUSINDICATOR(), Reference< XStatusIndicator >())); if (xStatusIndicator.is()){ xStatusIndicator->start(OUString( "Loading :" ),nProgressRange); @@ -203,9 +203,9 @@ sal_Bool SAL_CALL XmlFilterAdaptor::exportImpl( const Sequence< ::com::sun::star // Status Bar sal_Int32 nSteps= 1; sal_Int32 nProgressRange(3); - comphelper::MediaDescriptor aMediaMap(aDescriptor); + utl::MediaDescriptor aMediaMap(aDescriptor); Reference< XStatusIndicator > xStatusIndicator(aMediaMap.getUnpackedValueOrDefault( - comphelper::MediaDescriptor::PROP_STATUSINDICATOR(), Reference< XStatusIndicator >())); + utl::MediaDescriptor::PROP_STATUSINDICATOR(), Reference< XStatusIndicator >())); if (xStatusIndicator.is()) xStatusIndicator->start(OUString( "Saving :" ),nProgressRange); |