reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx | 1 reportdesign/source/filter/xml/xmlExportDocumentHandler.hxx | 1 reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx | 1 reportdesign/source/filter/xml/xmlImportDocumentHandler.hxx | 1 scripting/source/stringresource/stringresource.cxx | 35 +++++------- 5 files changed, 16 insertions(+), 23 deletions(-)
New commits: commit e9d1abc0b059a4b6174d3a855757b2f745515907 Author: Noel Grandin <noelgran...@gmail.com> AuthorDate: Mon Sep 30 19:22:01 2024 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Tue Oct 1 11:15:44 2024 +0200 cid#1608000 Data race condition just remove the mutex, this class is only ever accessed from one thread Change-Id: I7c088c0cb33d21513a5566ae65f663877d829072 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174291 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx b/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx index c203af228670..81140bd7e161 100644 --- a/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx +++ b/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx @@ -273,7 +273,6 @@ void SAL_CALL ExportDocumentHandler::setDocumentLocator(const uno::Reference< xm } void SAL_CALL ExportDocumentHandler::initialize( const uno::Sequence< uno::Any >& _aArguments ) { - std::unique_lock aGuard(m_aMutex); comphelper::SequenceAsHashMap aArgs(_aArguments); m_xDelegatee = aArgs.getUnpackedValueOrDefault(u"DocumentHandler"_ustr,m_xDelegatee); m_xModel = aArgs.getUnpackedValueOrDefault(u"Model"_ustr,m_xModel); diff --git a/reportdesign/source/filter/xml/xmlExportDocumentHandler.hxx b/reportdesign/source/filter/xml/xmlExportDocumentHandler.hxx index 93465e674242..8dacca06955f 100644 --- a/reportdesign/source/filter/xml/xmlExportDocumentHandler.hxx +++ b/reportdesign/source/filter/xml/xmlExportDocumentHandler.hxx @@ -75,7 +75,6 @@ private: virtual ~ExportDocumentHandler() override; - std::mutex m_aMutex; css::uno::Reference< css::uno::XComponentContext > m_xContext; css::uno::Reference< css::xml::sax::XDocumentHandler > m_xDelegatee; css::uno::Reference< css::uno::XAggregation > m_xProxy; commit 21e2158fa11757e43ccd904bba48553b8caba2ca Author: Noel Grandin <noelgran...@gmail.com> AuthorDate: Mon Sep 30 19:16:38 2024 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Tue Oct 1 11:15:37 2024 +0200 remove unnecessary null checks Change-Id: I73805881eef49fc6886f7f4fbc212da3aac1fd6f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174290 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/scripting/source/stringresource/stringresource.cxx b/scripting/source/stringresource/stringresource.cxx index a081601b42b2..f144fd3bcb32 100644 --- a/scripting/source/stringresource/stringresource.cxx +++ b/scripting/source/stringresource/stringresource.cxx @@ -930,7 +930,7 @@ void StringResourcePersistenceImpl::storeToURL( const OUString& URL, std::unique_lock aGuard( m_aMutex ); Reference< ucb::XSimpleFileAccess3 > xFileAccess = ucb::SimpleFileAccess::create(m_xContext); - if( xFileAccess.is() && Handler.is() ) + if( Handler.is() ) xFileAccess->setInteractionHandler( Handler ); implStoreAtLocation( URL, NameBase, Comment, xFileAccess, false/*bUsedForStore*/, true/*bStoreAll*/ ); @@ -2531,7 +2531,7 @@ void StringResourceWithLocationImpl::setURL( const OUString& URL ) void StringResourceWithLocationImpl::implScanLocales() { const Reference< ucb::XSimpleFileAccess3 > xFileAccess = getFileAccessImpl(); - if( xFileAccess.is() && xFileAccess->isFolder( m_aLocation ) ) + if( xFileAccess->isFolder( m_aLocation ) ) { Sequence< OUString > aContentSeq = xFileAccess->getFolderContents( m_aLocation, false ); implScanLocaleNames( aContentSeq ); @@ -2544,23 +2544,20 @@ bool StringResourceWithLocationImpl::implLoadLocale( LocaleItem* pLocaleItem ) bool bSuccess = false; const Reference< ucb::XSimpleFileAccess3 > xFileAccess = getFileAccessImpl(); - if( xFileAccess.is() ) - { - OUString aCompleteFileName = - implGetPathForLocaleItem( pLocaleItem, m_aNameBase, m_aLocation ); + OUString aCompleteFileName = + implGetPathForLocaleItem( pLocaleItem, m_aNameBase, m_aLocation ); - Reference< io::XInputStream > xInputStream; - try - { - xInputStream = xFileAccess->openFileRead( aCompleteFileName ); - } - catch( Exception& ) - {} - if( xInputStream.is() ) - { - bSuccess = StringResourcePersistenceImpl::implReadPropertiesFile( pLocaleItem, xInputStream ); - xInputStream->closeInput(); - } + Reference< io::XInputStream > xInputStream; + try + { + xInputStream = xFileAccess->openFileRead( aCompleteFileName ); + } + catch( Exception& ) + {} + if( xInputStream.is() ) + { + bSuccess = StringResourcePersistenceImpl::implReadPropertiesFile( pLocaleItem, xInputStream ); + xInputStream->closeInput(); } return bSuccess; @@ -2572,7 +2569,7 @@ const Reference< ucb::XSimpleFileAccess3 > & StringResourceWithLocationImpl::get { m_xSFI = ucb::SimpleFileAccess::create(m_xContext); - if( m_xSFI.is() && m_xInteractionHandler.is() ) + if( m_xInteractionHandler.is() ) m_xSFI->setInteractionHandler( m_xInteractionHandler ); } return m_xSFI; commit 5c7b565fa842b1d48e5b7f102e9594985fd17df5 Author: Noel Grandin <noelgran...@gmail.com> AuthorDate: Mon Sep 30 19:11:03 2024 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Tue Oct 1 11:15:29 2024 +0200 cid#1608069 Data race condition just remove the mutex, this class is only ever accessed from one thread Change-Id: Ie2b42a6a141676ee4cb14549d44f15fd55194aaf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174289 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx b/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx index 6ca44355f382..9f40b7ae52df 100644 --- a/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx +++ b/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx @@ -330,7 +330,6 @@ void SAL_CALL ImportDocumentHandler::setDocumentLocator(const uno::Reference< xm } void SAL_CALL ImportDocumentHandler::initialize( const uno::Sequence< uno::Any >& _aArguments ) { - std::unique_lock aGuard(m_aMutex); comphelper::SequenceAsHashMap aArgs(_aArguments); m_xDocumentHandler = aArgs.getUnpackedValueOrDefault(u"DocumentHandler"_ustr,m_xDocumentHandler); m_xModel = aArgs.getUnpackedValueOrDefault(u"Model"_ustr,m_xModel); diff --git a/reportdesign/source/filter/xml/xmlImportDocumentHandler.hxx b/reportdesign/source/filter/xml/xmlImportDocumentHandler.hxx index d0b6d4db36ef..1f13b442199a 100644 --- a/reportdesign/source/filter/xml/xmlImportDocumentHandler.hxx +++ b/reportdesign/source/filter/xml/xmlImportDocumentHandler.hxx @@ -74,7 +74,6 @@ private: virtual ~ImportDocumentHandler() override; - std::mutex m_aMutex; bool m_bImportedChart; ::std::vector< OUString> m_aMasterFields; ::std::vector< OUString> m_aDetailFields;