diff options
author | Arkadiy Illarionov <qarkai@gmail.com> | 2018-05-30 10:36:27 +0300 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-06-01 12:30:35 +0200 |
commit | bea47ebdb4bb634ad647e3b653fa7e31d7c4b6ab (patch) | |
tree | d6fbea611d3a7405d9fa05bb92081001d6a4b8e3 /filter | |
parent | tdf#42949 Fix IWYU warnings in chart2/source/view/inc/ (diff) | |
download | core-bea47ebdb4bb634ad647e3b653fa7e31d7c4b6ab.tar.gz core-bea47ebdb4bb634ad647e3b653fa7e31d7c4b6ab.zip |
tdf#96099 Remove some trivial typedef std::vector
Change-Id: Iaba48932dde059c88401ee60f7aac0048a79e9eb
Reviewed-on: https://gerrit.libreoffice.org/55045
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'filter')
-rw-r--r-- | filter/source/config/cache/basecontainer.cxx | 4 | ||||
-rw-r--r-- | filter/source/config/cache/cacheitem.cxx | 4 | ||||
-rw-r--r-- | filter/source/config/cache/cacheitem.hxx | 5 | ||||
-rw-r--r-- | filter/source/config/cache/cacheupdatelistener.cxx | 6 | ||||
-rw-r--r-- | filter/source/config/cache/filtercache.cxx | 46 | ||||
-rw-r--r-- | filter/source/config/cache/filtercache.hxx | 20 | ||||
-rw-r--r-- | filter/source/config/cache/filterfactory.cxx | 52 | ||||
-rw-r--r-- | filter/source/config/cache/filterfactory.hxx | 10 | ||||
-rw-r--r-- | filter/source/config/cache/typedetection.cxx | 16 | ||||
-rw-r--r-- | filter/source/config/cache/typedetection.hxx | 2 |
10 files changed, 80 insertions, 85 deletions
diff --git a/filter/source/config/cache/basecontainer.cxx b/filter/source/config/cache/basecontainer.cxx index ebf046128039..53e04e68ecf5 100644 --- a/filter/source/config/cache/basecontainer.cxx +++ b/filter/source/config/cache/basecontainer.cxx @@ -282,7 +282,7 @@ css::uno::Sequence< OUString > SAL_CALL BaseContainer::getElementNames() try { FilterCache* pCache = impl_getWorkingCache(); - OUStringList lKeys = pCache->getItemNames(m_eType); + std::vector<OUString> lKeys = pCache->getItemNames(m_eType); lNames = comphelper::containerToSequence(lKeys); } catch(const css::uno::Exception&) @@ -368,7 +368,7 @@ css::uno::Reference< css::container::XEnumeration > SAL_CALL BaseContainer::crea css::uno::Reference< css::container::XEnumeration > SAL_CALL BaseContainer::createSubSetEnumerationByProperties(const css::uno::Sequence< css::beans::NamedValue >& lProperties) { - OUStringList lKeys; + std::vector<OUString> lKeys; impl_loadOnDemand(); diff --git a/filter/source/config/cache/cacheitem.cxx b/filter/source/config/cache/cacheitem.cxx index 4caca1823b58..1e3b9a42fc6a 100644 --- a/filter/source/config/cache/cacheitem.cxx +++ b/filter/source/config/cache/cacheitem.cxx @@ -199,8 +199,8 @@ bool isSubSet(const css::uno::Any& aSubSet, (aSet >>= uno_s2) ) { - OUStringList stl_s1(comphelper::sequenceToContainer<OUStringList>(uno_s1)); - OUStringList stl_s2(comphelper::sequenceToContainer<OUStringList>(uno_s2)); + std::vector<OUString> stl_s1(comphelper::sequenceToContainer< std::vector<OUString> >(uno_s1)); + std::vector<OUString> stl_s2(comphelper::sequenceToContainer< std::vector<OUString> >(uno_s2)); for (auto const& elem : stl_s1) { diff --git a/filter/source/config/cache/cacheitem.hxx b/filter/source/config/cache/cacheitem.hxx index 3bcda69dfc7f..2b205b7f1b24 100644 --- a/filter/source/config/cache/cacheitem.hxx +++ b/filter/source/config/cache/cacheitem.hxx @@ -47,9 +47,6 @@ struct BaseLock }; -typedef ::std::vector< OUString > OUStringList; - - /** @short represent an item of a FilterCache instance. @@ -163,7 +160,7 @@ typedef std::unordered_map< OUString, by a pure vector! */ typedef std::unordered_map< OUString, - OUStringList > CacheItemRegistration; + std::vector<OUString> > CacheItemRegistration; /** @short is used to collect all matching types of an URL diff --git a/filter/source/config/cache/cacheupdatelistener.cxx b/filter/source/config/cache/cacheupdatelistener.cxx index 851f1fced49b..e380407eda3a 100644 --- a/filter/source/config/cache/cacheupdatelistener.cxx +++ b/filter/source/config/cache/cacheupdatelistener.cxx @@ -93,7 +93,7 @@ void SAL_CALL CacheUpdateListener::changesOccurred(const css::util::ChangesEven aLock.clear(); // <- SAFE - OUStringList lChangedItems; + std::vector<OUString> lChangedItems; sal_Int32 c = aEvent.Changes.getLength(); sal_Int32 i = 0; @@ -140,8 +140,8 @@ void SAL_CALL CacheUpdateListener::changesOccurred(const css::util::ChangesEven if ( sNode.isEmpty() ) continue; - OUStringList::const_iterator pIt = ::std::find(lChangedItems.begin(), lChangedItems.end(), sNode); - if (pIt == lChangedItems.end()) + auto pIt = ::std::find(lChangedItems.cbegin(), lChangedItems.cend(), sNode); + if (pIt == lChangedItems.cend()) lChangedItems.push_back(sNode); } diff --git a/filter/source/config/cache/filtercache.cxx b/filter/source/config/cache/filtercache.cxx index bb3bfdc7b9d1..c173b2941741 100644 --- a/filter/source/config/cache/filtercache.cxx +++ b/filter/source/config/cache/filtercache.cxx @@ -247,7 +247,7 @@ bool FilterCache::isFillState(FilterCache::EFillState eState) const } -OUStringList FilterCache::getMatchingItemsByProps( EItemType eType , +std::vector<OUString> FilterCache::getMatchingItemsByProps( EItemType eType , const CacheItem& lIProps, const CacheItem& lEProps) const { @@ -259,7 +259,7 @@ OUStringList FilterCache::getMatchingItemsByProps( EItemType eType , // => rList will be valid everytimes next line is reached. const CacheItemList& rList = impl_getItemList(eType); - OUStringList lKeys; + std::vector<OUString> lKeys; // search items, which provides all needed properties of set "lIProps" // but not of set "lEProps"! @@ -294,7 +294,7 @@ bool FilterCache::hasItems(EItemType eType) const } -OUStringList FilterCache::getItemNames(EItemType eType) const +std::vector<OUString> FilterCache::getItemNames(EItemType eType) const { // SAFE -> ::osl::ResettableMutexGuard aLock(m_aLock); @@ -304,7 +304,7 @@ OUStringList FilterCache::getItemNames(EItemType eType) const // => rList will be valid everytimes next line is reached. const CacheItemList& rList = impl_getItemList(eType); - OUStringList lKeys; + std::vector<OUString> lKeys; for (auto const& elem : rList) { lKeys.push_back(elem.first); @@ -599,7 +599,7 @@ void FilterCache::flush() void FilterCache::impl_flushByList(const css::uno::Reference< css::container::XNameAccess >& xSet , EItemType eType , const CacheItemList& rCache, - const OUStringList& lItems) + const std::vector<OUString>& lItems) { css::uno::Reference< css::container::XNameContainer > xAddRemoveSet(xSet, css::uno::UNO_QUERY); css::uno::Reference< css::lang::XSingleServiceFactory > xFactory(xSet, css::uno::UNO_QUERY); @@ -678,7 +678,7 @@ void FilterCache::detectFlatForURL(const css::util::URL& aURL , WildCard aPatternCheck(pattern.first); if (aPatternCheck.Matches(aURL.Main)) { - const OUStringList& rTypesForPattern = pattern.second; + const std::vector<OUString>& rTypesForPattern = pattern.second; FlatDetectionInfo aInfo; aInfo.sType = *(rTypesForPattern.begin()); @@ -697,7 +697,7 @@ void FilterCache::detectFlatForURL(const css::util::URL& aURL , CacheItemRegistration::const_iterator pExtReg = m_lExtensions2Types.find(sExtension); if (pExtReg != m_lExtensions2Types.end()) { - const OUStringList& rTypesForExtension = pExtReg->second; + const std::vector<OUString>& rTypesForExtension = pExtReg->second; for (auto const& elem : rTypesForExtension) { FlatDetectionInfo aInfo; @@ -1029,7 +1029,7 @@ void FilterCache::impl_validateAndOptimize() // does not depend from any upper/lower case problems ... OUString sNormalizedExtension = pExtensions[e].toAsciiLowerCase(); - OUStringList& lTypesForExtension = m_lExtensions2Types[sNormalizedExtension]; + std::vector<OUString>& lTypesForExtension = m_lExtensions2Types[sNormalizedExtension]; if (::std::find(lTypesForExtension.begin(), lTypesForExtension.end(), sType) != lTypesForExtension.end()) continue; @@ -1042,7 +1042,7 @@ void FilterCache::impl_validateAndOptimize() const OUString* pURLPattern = lURLPattern.getConstArray(); for (sal_Int32 u=0; u<cu; ++u) { - OUStringList& lTypesForURLPattern = m_lURLPattern2Types[pURLPattern[u]]; + std::vector<OUString>& lTypesForURLPattern = m_lURLPattern2Types[pURLPattern[u]]; if (::std::find(lTypesForURLPattern.begin(), lTypesForURLPattern.end(), sType) != lTypesForURLPattern.end()) continue; @@ -1159,7 +1159,7 @@ void FilterCache::impl_validateAndOptimize() // b) step over all well known frame loader services // and remove all types from list a), which already // referenced by a loader b) - OUStringList lTypes = getItemNames(E_TYPE); + std::vector<OUString> lTypes = getItemNames(E_TYPE); for (auto & frameLoader : m_lFrameLoaders) { // Note: of course the default loader must be ignored here. @@ -1172,11 +1172,11 @@ void FilterCache::impl_validateAndOptimize() CacheItem& rLoader = frameLoader.second; css::uno::Any& rTypesReg = rLoader[PROPNAME_TYPES]; - OUStringList lTypesReg (comphelper::sequenceToContainer<OUStringList>(rTypesReg.get<css::uno::Sequence<OUString> >())); + std::vector<OUString> lTypesReg (comphelper::sequenceToContainer< std::vector<OUString> >(rTypesReg.get<css::uno::Sequence<OUString> >())); for (auto const& typeReg : lTypesReg) { - OUStringList::iterator pTypeCheck = ::std::find(lTypes.begin(), lTypes.end(), typeReg); + auto pTypeCheck = ::std::find(lTypes.begin(), lTypes.end(), typeReg); if (pTypeCheck != lTypes.end()) lTypes.erase(pTypeCheck); } @@ -1203,7 +1203,7 @@ void FilterCache::impl_validateAndOptimize() void FilterCache::impl_addItem2FlushList( EItemType eType, const OUString& sItem) { - OUStringList* pList = nullptr; + std::vector<OUString>* pList = nullptr; switch(eType) { case E_TYPE : @@ -1225,8 +1225,8 @@ void FilterCache::impl_addItem2FlushList( EItemType eType, default : throw css::uno::RuntimeException("unsupported item type", nullptr); } - OUStringList::const_iterator pItem = ::std::find(pList->begin(), pList->end(), sItem); - if (pItem == pList->end()) + auto pItem = ::std::find(pList->cbegin(), pList->cend(), sItem); + if (pItem == pList->cend()) pList->push_back(sItem); } @@ -1819,7 +1819,7 @@ void FilterCache::impl_saveItem(const css::uno::Reference< css::container::XName -----------------------------------------------*/ css::uno::Sequence< OUString > FilterCache::impl_convertFlagField2FlagNames(SfxFilterFlags nFlags) { - OUStringList lFlagNames; + std::vector<OUString> lFlagNames; if (nFlags & SfxFilterFlags::STARONEFILTER ) lFlagNames.emplace_back(FLAGNAME_3RDPARTYFILTER ); if (nFlags & SfxFilterFlags::ALIEN ) lFlagNames.emplace_back(FLAGNAME_ALIEN ); @@ -2116,7 +2116,7 @@ CacheItem FilterCache::impl_readOldItem(const css::uno::Reference< css::containe // Data OUString sData; - OUStringList lData; + std::vector<OUString> lData; xItem->getByName( "Data" ) >>= sData; lData = impl_tokenizeString(sData, ','); if ( @@ -2148,10 +2148,10 @@ CacheItem FilterCache::impl_readOldItem(const css::uno::Reference< css::containe } -OUStringList FilterCache::impl_tokenizeString(const OUString& sData , +std::vector<OUString> FilterCache::impl_tokenizeString(const OUString& sData , sal_Unicode cSeparator) { - OUStringList lData ; + std::vector<OUString> lData ; sal_Int32 nToken = 0; do { @@ -2171,8 +2171,8 @@ OUString FilterCache::impl_searchFrameLoaderForType(const OUString& sType) const { const OUString& sItem = frameLoader.first; ::comphelper::SequenceAsHashMap lProps(frameLoader.second); - OUStringList lTypes( - comphelper::sequenceToContainer<OUStringList>(lProps[PROPNAME_TYPES].get<css::uno::Sequence<OUString> >())); + std::vector<OUString> lTypes( + comphelper::sequenceToContainer< std::vector<OUString> >(lProps[PROPNAME_TYPES].get<css::uno::Sequence<OUString> >())); if (::std::find(lTypes.begin(), lTypes.end(), sType) != lTypes.end()) return sItem; @@ -2188,8 +2188,8 @@ OUString FilterCache::impl_searchContentHandlerForType(const OUString& sType) co { const OUString& sItem = contentHandler.first; ::comphelper::SequenceAsHashMap lProps(contentHandler.second); - OUStringList lTypes( - comphelper::sequenceToContainer<OUStringList>( lProps[PROPNAME_TYPES].get<css::uno::Sequence<OUString> >() )); + std::vector<OUString> lTypes( + comphelper::sequenceToContainer< std::vector<OUString> >( lProps[PROPNAME_TYPES].get<css::uno::Sequence<OUString> >() )); if (::std::find(lTypes.begin(), lTypes.end(), sType) != lTypes.end()) return sItem; } diff --git a/filter/source/config/cache/filtercache.hxx b/filter/source/config/cache/filtercache.hxx index 033e12a05093..c9a51fb8657e 100644 --- a/filter/source/config/cache/filtercache.hxx +++ b/filter/source/config/cache/filtercache.hxx @@ -228,10 +228,10 @@ class FilterCache : public BaseLock /** TODO document me ... */ - OUStringList m_lChangedTypes; - OUStringList m_lChangedFilters; - OUStringList m_lChangedFrameLoaders; - OUStringList m_lChangedContentHandlers; + std::vector<OUString> m_lChangedTypes; + std::vector<OUString> m_lChangedFilters; + std::vector<OUString> m_lChangedFrameLoaders; + std::vector<OUString> m_lChangedContentHandlers; /// standard property names for filter config keyed by EReadOption css::uno::Sequence< OUString > m_aStandardProps[4]; @@ -358,7 +358,7 @@ class FilterCache : public BaseLock specify the property set, which must not(!) exist at the searched items as minimum. - @return [OUStringList] + @return [std::vector<OUString>] a list of key names, which identify items of the queried sub container. May be an empty list. @@ -366,7 +366,7 @@ class FilterCache : public BaseLock if some input parameter are wrong or the cache itself is not valid any longer, because any operation before damage it. */ - OUStringList getMatchingItemsByProps( EItemType eType , + std::vector<OUString> getMatchingItemsByProps( EItemType eType , const CacheItem& lIProps , const CacheItem& lEProps = CacheItem()) const; @@ -407,7 +407,7 @@ class FilterCache : public BaseLock specify the sub container of this cache, which should be used for searching. see also EItemType. - @return [OUStringList] + @return [std::vector<OUString>] a list of key names, which can be used to access the item properties using some other methods of this cache. @@ -415,7 +415,7 @@ class FilterCache : public BaseLock if some input parameter are wrong or the cache itself is not valid any longer, because any operation before damage it. */ - OUStringList getItemNames(EItemType eType) const; + std::vector<OUString> getItemNames(EItemType eType) const; /** @short check if the required item exist inside this container. @@ -821,7 +821,7 @@ class FilterCache : public BaseLock static void impl_flushByList(const css::uno::Reference< css::container::XNameAccess >& xSet , EItemType eType , const CacheItemList& rCache, - const OUStringList& lItems); + const std::vector<OUString>& lItems); /** @short specify, which save operation is necessary for the specified item. @@ -896,7 +896,7 @@ class FilterCache : public BaseLock /** TODO */ - static OUStringList impl_tokenizeString(const OUString& sData , + static std::vector<OUString> impl_tokenizeString(const OUString& sData , sal_Unicode cSeparator); diff --git a/filter/source/config/cache/filterfactory.cxx b/filter/source/config/cache/filterfactory.cxx index bd22e9e78b87..50e8dc736440 100644 --- a/filter/source/config/cache/filterfactory.cxx +++ b/filter/source/config/cache/filterfactory.cxx @@ -122,7 +122,7 @@ css::uno::Sequence< OUString > SAL_CALL FilterFactory::getAvailableServiceNames( CacheItem lEProps; lEProps[PROPNAME_FILTERSERVICE] <<= OUString(); - OUStringList lUNOFilters; + std::vector<OUString> lUNOFilters; try { lUNOFilters = TheFilterCache::get().getMatchingItemsByProps(FilterCache::E_FILTER, lIProps, lEProps); @@ -157,7 +157,7 @@ css::uno::Reference< css::container::XEnumeration > SAL_CALL FilterFactory::crea // analyze query and split it into its tokens QueryTokenizer lTokens(sNewQuery); QueryTokenizer::const_iterator pIt; - OUStringList lEnumSet; + std::vector<OUString> lEnumSet; // start query // (see attention comment below!) @@ -190,7 +190,7 @@ css::uno::Reference< css::container::XEnumeration > SAL_CALL FilterFactory::crea } -OUStringList FilterFactory::impl_queryMatchByDocumentService(const QueryTokenizer& lTokens) const +std::vector<OUString> FilterFactory::impl_queryMatchByDocumentService(const QueryTokenizer& lTokens) const { // analyze query QueryTokenizer::const_iterator pIt; @@ -255,8 +255,8 @@ OUStringList FilterFactory::impl_queryMatchByDocumentService(const QueryTokenize // search suitable filters FilterCache* pCache = impl_getWorkingCache(); - OUStringList lFilterNames = pCache->getItemNames(FilterCache::E_FILTER); - OUStringList lResult ; + std::vector<OUString> lFilterNames = pCache->getItemNames(FilterCache::E_FILTER); + std::vector<OUString> lResult ; for (auto const& filterName : lFilterNames) { @@ -361,7 +361,7 @@ class stlcomp_removeIfMatchFlags }; -OUStringList FilterFactory::impl_getSortedFilterList(const QueryTokenizer& lTokens) const +std::vector<OUString> FilterFactory::impl_getSortedFilterList(const QueryTokenizer& lTokens) const { // analyze the given query parameter QueryTokenizer::const_iterator pIt1; @@ -381,17 +381,17 @@ OUStringList FilterFactory::impl_getSortedFilterList(const QueryTokenizer& lToke nEFlags = pIt1->second.toInt32(); // simple search for filters of one specific module. - OUStringList lFilterList; + std::vector<OUString> lFilterList; if (!sModule.isEmpty()) lFilterList = impl_getSortedFilterListForModule(sModule, nIFlags, nEFlags); else { // more complex search for all filters // We check first, which office modules are installed ... - OUStringList lModules = impl_getListOfInstalledModules(); + std::vector<OUString> lModules = impl_getListOfInstalledModules(); for (auto const& module : lModules) { - OUStringList lFilters4Module = impl_getSortedFilterListForModule(module, nIFlags, nEFlags); + std::vector<OUString> lFilters4Module = impl_getSortedFilterListForModule(module, nIFlags, nEFlags); for (auto const& filter4Module : lFilters4Module) { lFilterList.push_back(filter4Module); @@ -403,7 +403,7 @@ OUStringList FilterFactory::impl_getSortedFilterList(const QueryTokenizer& lToke } -OUStringList FilterFactory::impl_getListOfInstalledModules() const +std::vector<OUString> FilterFactory::impl_getListOfInstalledModules() const { // SAFE -> ---------------------- ::osl::ResettableMutexGuard aLock(m_aLock); @@ -412,16 +412,16 @@ OUStringList FilterFactory::impl_getListOfInstalledModules() const // <- SAFE ---------------------- css::uno::Reference< css::container::XNameAccess > xModuleConfig = officecfg::Setup::Office::Factories::get(xContext); - OUStringList lModules(comphelper::sequenceToContainer<OUStringList>(xModuleConfig->getElementNames())); + std::vector<OUString> lModules(comphelper::sequenceToContainer< std::vector<OUString> >(xModuleConfig->getElementNames())); return lModules; } -OUStringList FilterFactory::impl_getSortedFilterListForModule(const OUString& sModule, +std::vector<OUString> FilterFactory::impl_getSortedFilterListForModule(const OUString& sModule, sal_Int32 nIFlags, sal_Int32 nEFlags) const { - OUStringList lSortedFilters = impl_readSortedFilterListFromConfig(sModule); + std::vector<OUString> lSortedFilters = impl_readSortedFilterListFromConfig(sModule); // get all filters for the requested module CacheItem lIProps; @@ -430,7 +430,7 @@ OUStringList FilterFactory::impl_getSortedFilterListForModule(const OUString& sM // SAFE -> ---------------------- ::osl::ResettableMutexGuard aLock(m_aLock); FilterCache* pCache = impl_getWorkingCache(); - OUStringList lOtherFilters = pCache->getMatchingItemsByProps(FilterCache::E_FILTER, lIProps); + std::vector<OUString> lOtherFilters = pCache->getMatchingItemsByProps(FilterCache::E_FILTER, lIProps); aLock.clear(); // <- SAFE ---------------------- @@ -439,25 +439,23 @@ OUStringList FilterFactory::impl_getSortedFilterListForModule(const OUString& sM ::std::sort(lOtherFilters.begin(), lOtherFilters.end()); // merge both lists together - OUStringList lMergedFilters = lSortedFilters; - const OUStringList::const_iterator itlSortedFiltersEnd = lSortedFilters.end(); + std::vector<OUString> lMergedFilters = lSortedFilters; + const auto itlSortedFiltersEnd = lSortedFilters.cend(); for (auto const& otherFilter : lOtherFilters) { - if (::std::find(lSortedFilters.begin(), lSortedFilters.end(), otherFilter) == itlSortedFiltersEnd) + if (::std::find(lSortedFilters.cbegin(), lSortedFilters.cend(), otherFilter) == itlSortedFiltersEnd) lMergedFilters.push_back(otherFilter); } - OUStringList::iterator pItToErase; - // remove all filters from this merged list, which does not fit the flag specification if (nIFlags != -1) { - pItToErase = ::std::remove_if(lMergedFilters.begin(), lMergedFilters.end(), stlcomp_removeIfMatchFlags(pCache, nIFlags, true)); + auto pItToErase = ::std::remove_if(lMergedFilters.begin(), lMergedFilters.end(), stlcomp_removeIfMatchFlags(pCache, nIFlags, true)); lMergedFilters.erase(pItToErase, lMergedFilters.end()); } if (nEFlags != -1) { - pItToErase = ::std::remove_if(lMergedFilters.begin(), lMergedFilters.end(), stlcomp_removeIfMatchFlags(pCache, nEFlags, false)); + auto pItToErase = ::std::remove_if(lMergedFilters.begin(), lMergedFilters.end(), stlcomp_removeIfMatchFlags(pCache, nEFlags, false)); lMergedFilters.erase(pItToErase, lMergedFilters.end()); } @@ -468,7 +466,7 @@ OUStringList FilterFactory::impl_getSortedFilterListForModule(const OUString& sM } -OUStringList FilterFactory::impl_readSortedFilterListFromConfig(const OUString& sModule) const +std::vector<OUString> FilterFactory::impl_readSortedFilterListFromConfig(const OUString& sModule) const { // SAFE -> ---------------------- ::osl::ResettableMutexGuard aLock(m_aLock); @@ -485,11 +483,11 @@ OUStringList FilterFactory::impl_readSortedFilterListFromConfig(const OUString& xUISortConfig->getByName(sModule) >>= xModule; if (xModule.is()) // only to be on the safe side of life if the exception was not thrown .-) { - // Note: conversion of the returned Any to OUStringList throws + // Note: conversion of the returned Any to std::vector<OUString> throws // an IllegalArgumentException if the type does not match ... - // but it resets the OUStringList to a length of 0 if the Any is empty! - OUStringList lSortedFilters( - comphelper::sequenceToContainer<OUStringList>(xModule->getByName(PROPNAME_SORTEDFILTERLIST).get<css::uno::Sequence<OUString> >())); + // but it resets the std::vector<OUString> to a length of 0 if the Any is empty! + std::vector<OUString> lSortedFilters( + comphelper::sequenceToContainer< std::vector<OUString> >(xModule->getByName(PROPNAME_SORTEDFILTERLIST).get<css::uno::Sequence<OUString> >())); return lSortedFilters; } } @@ -498,7 +496,7 @@ OUStringList FilterFactory::impl_readSortedFilterListFromConfig(const OUString& catch(const css::uno::Exception&) {} - return OUStringList(); + return std::vector<OUString>(); } diff --git a/filter/source/config/cache/filterfactory.hxx b/filter/source/config/cache/filterfactory.hxx index c0e9a34d5aa3..8548a14a7b0e 100644 --- a/filter/source/config/cache/filterfactory.hxx +++ b/filter/source/config/cache/filterfactory.hxx @@ -93,12 +93,12 @@ class FilterFactory : public ::cppu::ImplInheritanceHelper< BaseContainer @return A string list of internal filter names, including all filters, which match this query. */ - OUStringList impl_queryMatchByDocumentService(const QueryTokenizer& lTokens) const; + std::vector<OUString> impl_queryMatchByDocumentService(const QueryTokenizer& lTokens) const; /** TODO document me */ - OUStringList impl_getListOfInstalledModules() const; + std::vector<OUString> impl_getListOfInstalledModules() const; /** @short implement the container string query: @@ -110,12 +110,12 @@ class FilterFactory : public ::cppu::ImplInheritanceHelper< BaseContainer @return A string list of internal filter names, including all filters, which match this query. */ - OUStringList impl_getSortedFilterList(const QueryTokenizer& lTokens) const; + std::vector<OUString> impl_getSortedFilterList(const QueryTokenizer& lTokens) const; /** TODO document me */ - OUStringList impl_getSortedFilterListForModule(const OUString& sModule, + std::vector<OUString> impl_getSortedFilterListForModule(const OUString& sModule, sal_Int32 nIFlags, sal_Int32 nEFlags) const; @@ -129,7 +129,7 @@ class FilterFactory : public ::cppu::ImplInheritanceHelper< BaseContainer @return A string list of internal filter names. Can be empty. */ - OUStringList impl_readSortedFilterListFromConfig(const OUString& sModule) const; + std::vector<OUString> impl_readSortedFilterListFromConfig(const OUString& sModule) const; // static uno helper! diff --git a/filter/source/config/cache/typedetection.cxx b/filter/source/config/cache/typedetection.cxx index 6b7753665d78..5810a34b392a 100644 --- a/filter/source/config/cache/typedetection.cxx +++ b/filter/source/config/cache/typedetection.cxx @@ -424,7 +424,7 @@ 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 ... - OUStringList lUsedDetectors; + std::vector<OUString> lUsedDetectors; if (lFlatTypes.size()>0) sType = impl_detectTypeFlatAndDeep(stlDescriptor, lFlatTypes, bAllowDeep, lUsedDetectors, sLastChance); @@ -501,7 +501,7 @@ void TypeDetection::impl_checkResultsAndAddBestFilter(utl::MediaDescriptor& rDes CacheItem lIProps; lIProps[PROPNAME_DOCUMENTSERVICE] <<= sDocumentService; lIProps[PROPNAME_TYPE ] <<= sRealType; - OUStringList lFilters = cache.getMatchingItemsByProps(FilterCache::E_FILTER, lIProps); + std::vector<OUString> lFilters = cache.getMatchingItemsByProps(FilterCache::E_FILTER, lIProps); aLock.clear(); // <- SAFE @@ -581,7 +581,7 @@ void TypeDetection::impl_checkResultsAndAddBestFilter(utl::MediaDescriptor& rDes CacheItem lIProps; lIProps[PROPNAME_TYPE] <<= sType; - OUStringList lFilters = cache.getMatchingItemsByProps(FilterCache::E_FILTER, lIProps); + std::vector<OUString> lFilters = cache.getMatchingItemsByProps(FilterCache::E_FILTER, lIProps); aLock.clear(); // <- SAFE @@ -674,8 +674,8 @@ bool TypeDetection::impl_getPreselectionForType( // otherwise we must know, if it matches to the given URL really. // especially if it matches by its extension or pattern registration. - OUStringList lExtensions(comphelper::sequenceToContainer<OUStringList>(aType[PROPNAME_EXTENSIONS].get<css::uno::Sequence<OUString> >() )); - OUStringList lURLPattern(comphelper::sequenceToContainer<OUStringList>(aType[PROPNAME_URLPATTERN].get<css::uno::Sequence<OUString> >() )); + std::vector<OUString> lExtensions(comphelper::sequenceToContainer< std::vector<OUString> >(aType[PROPNAME_EXTENSIONS].get<css::uno::Sequence<OUString> >() )); + std::vector<OUString> lURLPattern(comphelper::sequenceToContainer< std::vector<OUString> >(aType[PROPNAME_URLPATTERN].get<css::uno::Sequence<OUString> >() )); for (auto const& extension : lExtensions) { @@ -727,7 +727,7 @@ bool TypeDetection::impl_getPreselectionForDocumentService( const OUString& sPreSelDocumentService, const util::URL& aParsedURL, FlatDetection& rFlatTypes) { // get all filters, which match to this doc service - OUStringList lFilters; + std::vector<OUString> lFilters; try { // SAFE -> -------------------------- @@ -792,7 +792,7 @@ void TypeDetection::impl_getAllFormatTypes( rFlatTypes.clear(); // Get all filters that we have. - OUStringList aFilterNames; + std::vector<OUString> aFilterNames; try { osl::MutexGuard aLock(m_aLock); @@ -863,7 +863,7 @@ void TypeDetection::impl_getAllFormatTypes( OUString TypeDetection::impl_detectTypeFlatAndDeep( utl::MediaDescriptor& rDescriptor , const FlatDetection& lFlatTypes , bool bAllowDeep , - OUStringList& rUsedDetectors, + std::vector<OUString>& rUsedDetectors, OUString& rLastChance ) { // reset it everytimes, so the outside code can distinguish between diff --git a/filter/source/config/cache/typedetection.hxx b/filter/source/config/cache/typedetection.hxx index 830badc54f63..17d5c1a1f47a 100644 --- a/filter/source/config/cache/typedetection.hxx +++ b/filter/source/config/cache/typedetection.hxx @@ -135,7 +135,7 @@ private: OUString impl_detectTypeFlatAndDeep( utl::MediaDescriptor& rDescriptor , const FlatDetection& lFlatTypes , bool bAllowDeep , - OUStringList& rUsedDetectors, + std::vector<OUString>& rUsedDetectors, OUString& rLastChance ); |