diff options
Diffstat (limited to 'basic/source/basmgr/vbahelper.cxx')
-rw-r--r-- | basic/source/basmgr/vbahelper.cxx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/basic/source/basmgr/vbahelper.cxx b/basic/source/basmgr/vbahelper.cxx index 83165374a8f1..caccb9bfc16e 100644 --- a/basic/source/basmgr/vbahelper.cxx +++ b/basic/source/basmgr/vbahelper.cxx @@ -21,13 +21,13 @@ #include <basic/vbahelper.hxx> #include <map> +#include <mutex> #include <vector> #include <com/sun/star/container/XEnumeration.hpp> #include <com/sun/star/frame/Desktop.hpp> #include <com/sun/star/frame/XModel2.hpp> #include <com/sun/star/frame/ModuleManager.hpp> #include <comphelper/processfactory.hxx> -#include <rtl/instance.hxx> namespace basic::vba { @@ -141,12 +141,10 @@ void lclIterateDocuments( ModifyDocumentFunc pModifyDocumentFunc, const uno::Ref struct CurrDirPool { - ::osl::Mutex maMutex; + std::mutex maMutex; std::map< OUString, OUString > maCurrDirs; }; -struct StaticCurrDirPool : public ::rtl::Static< CurrDirPool, StaticCurrDirPool > {}; - } // namespace @@ -167,8 +165,10 @@ void registerCurrentDirectory( const uno::Reference< frame::XModel >& rxModel, c if( rPath.isEmpty() ) return; - CurrDirPool& rPool = StaticCurrDirPool::get(); - ::osl::MutexGuard aGuard( rPool.maMutex ); + static CurrDirPool StaticCurrDirPool; + + CurrDirPool& rPool = StaticCurrDirPool; + std::unique_lock aGuard( rPool.maMutex ); try { uno::Reference< frame::XModuleManager2 > xModuleManager( lclCreateModuleManager() ); |