diff options
Diffstat (limited to 'fpicker/source/office/contentenumeration.cxx')
-rw-r--r-- | fpicker/source/office/contentenumeration.cxx | 52 |
1 files changed, 23 insertions, 29 deletions
diff --git a/fpicker/source/office/contentenumeration.cxx b/fpicker/source/office/contentenumeration.cxx index b167fef3d190..2a5b0156480a 100644 --- a/fpicker/source/office/contentenumeration.cxx +++ b/fpicker/source/office/contentenumeration.cxx @@ -32,7 +32,7 @@ #include <vcl/svapp.hxx> #include <osl/mutex.hxx> #include <osl/diagnose.h> -#include <tools/diagnose_ex.h> +#include <comphelper/diagnose_ex.hxx> #include <tools/urlobj.hxx> namespace svt @@ -63,9 +63,6 @@ namespace svt using ::com::sun::star::ucb::CommandAbortedException; using ::com::sun::star::ucb::XContentAccess; using ::com::sun::star::ucb::XCommandEnvironment; - using ::com::sun::star::beans::PropertyValue; - using ::com::sun::star::document::DocumentProperties; - using ::ucbhelper::ResultSetInclude; using ::ucbhelper::INCLUDE_FOLDERS_AND_DOCUMENTS; @@ -92,7 +89,7 @@ namespace svt void FileViewContentEnumerator::cancel() { - ::osl::MutexGuard aGuard( m_aMutex ); + std::unique_lock aGuard( m_aMutex ); m_bCancelled = true; m_pResultHandler = nullptr; m_aFolder.aContent = ::ucbhelper::Content(); @@ -105,7 +102,7 @@ namespace svt const css::uno::Sequence< OUString >& rDenyList ) { { - ::osl::MutexGuard aGuard( m_aMutex ); + std::unique_lock aGuard( m_aMutex ); m_aFolder = _rFolder; m_pResultHandler = nullptr; m_rDenyList = rDenyList; @@ -117,7 +114,7 @@ namespace svt void FileViewContentEnumerator::enumerateFolderContent( const FolderDescriptor& _rFolder, IEnumerationResultHandler* _pResultHandler ) { - ::osl::MutexGuard aGuard( m_aMutex ); + std::unique_lock aGuard( m_aMutex ); m_aFolder = _rFolder; m_pResultHandler = _pResultHandler; @@ -139,27 +136,25 @@ namespace svt { Reference< XResultSet > xResultSet; - Sequence< OUString > aProps(12); - - aProps[0] = "Title"; - aProps[1] = "Size"; - aProps[2] = "DateModified"; - aProps[3] = "DateCreated"; - aProps[4] = "IsFolder"; - aProps[5] = "TargetURL"; - aProps[6] = "IsHidden"; - aProps[7] = "IsVolume"; - aProps[8] = "IsRemote"; - aProps[9] = "IsRemoveable"; - aProps[10] = "IsFloppy"; - aProps[11] = "IsCompactDisc"; + Sequence< OUString > aProps{ "Title", + "Size", + "DateModified", + "DateCreated", + "IsFolder", + "TargetURL", + "IsHidden", + "IsVolume", + "IsRemote", + "IsRemoveable", + "IsFloppy", + "IsCompactDisc" }; Reference< XCommandEnvironment > xEnvironment; try { FolderDescriptor aFolder; { - ::osl::MutexGuard aGuard( m_aMutex ); + std::unique_lock aGuard( m_aMutex ); aFolder = m_aFolder; xEnvironment = m_xCommandEnv; } @@ -167,7 +162,7 @@ namespace svt { aFolder.aContent = ::ucbhelper::Content( aFolder.sURL, xEnvironment, comphelper::getProcessComponentContext() ); { - ::osl::MutexGuard aGuard( m_aMutex ); + std::unique_lock aGuard( m_aMutex ); m_aFolder.aContent = aFolder.aContent; } } @@ -217,7 +212,7 @@ namespace svt // check for restrictions { - ::osl::MutexGuard aGuard( m_aMutex ); + std::unique_lock aGuard( m_aMutex ); if ( /* m_rDenyList.hasElements() && */ URLOnDenyList ( sRealURL ) ) continue; } @@ -253,7 +248,6 @@ namespace svt if ( pData->mbIsFolder ) { - SolarMutexGuard aGuard; ::svtools::VolumeInfo aVolInfo( pData->mbIsVolume, pData->mbIsRemote, pData->mbIsRemoveable, pData->mbIsFloppy, pData->mbIsCompactDisc ); @@ -270,7 +264,7 @@ namespace svt } { - ::osl::MutexGuard aGuard( m_aMutex ); + std::unique_lock aGuard( m_aMutex ); bCancelled = m_bCancelled; } } @@ -289,7 +283,7 @@ namespace svt IEnumerationResultHandler* pHandler = nullptr; { - ::osl::MutexGuard aGuard( m_aMutex ); + std::unique_lock aGuard( m_aMutex ); pHandler = m_pResultHandler; if ( m_bCancelled ) return EnumerationResult::ERROR; @@ -308,9 +302,9 @@ namespace svt } - bool FileViewContentEnumerator::URLOnDenyList ( const OUString& sRealURL ) + bool FileViewContentEnumerator::URLOnDenyList ( std::u16string_view sRealURL ) { - OUString entryName = sRealURL.copy( sRealURL.lastIndexOf( '/' ) + 1 ); + std::u16string_view entryName = sRealURL.substr( sRealURL.rfind( '/' ) + 1 ); return comphelper::findValue(m_rDenyList, entryName) != -1; } |