chart2/source/controller/main/CommandDispatch.cxx | 8 +++----- chart2/source/controller/main/CommandDispatch.hxx | 4 ++-- include/toolkit/awt/vclxfont.hxx | 5 ++--- toolkit/source/awt/vclxfont.cxx | 14 +++++++------- 4 files changed, 14 insertions(+), 17 deletions(-)
New commits: commit 9564433292aa6a5a79c6c619a05434973bd4b7b3 Author: Noel Grandin <noelgran...@gmail.com> AuthorDate: Thu Dec 16 19:14:14 2021 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Fri Dec 17 07:27:02 2021 +0100 osl::Mutex->std::mutex in VCLXFont Change-Id: I01fbf0c94996412129101a47171aa9f3a6a78ffc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126988 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/include/toolkit/awt/vclxfont.hxx b/include/toolkit/awt/vclxfont.hxx index ea7c3556c47a..efad4b590da7 100644 --- a/include/toolkit/awt/vclxfont.hxx +++ b/include/toolkit/awt/vclxfont.hxx @@ -26,7 +26,7 @@ #include <com/sun/star/lang/XUnoTunnel.hpp> #include <comphelper/servicehelper.hxx> #include <cppuhelper/implbase.hxx> -#include <osl/mutex.hxx> +#include <mutex> #include <vcl/font.hxx> namespace com::sun::star::awt { class XDevice; } @@ -41,14 +41,13 @@ class TOOLKIT_DLLPUBLIC VCLXFont final : css::awt::XFont2, css::lang::XUnoTunnel> { - ::osl::Mutex maMutex; + std::mutex maMutex; css::uno::Reference< css::awt::XDevice> mxDevice; vcl::Font maFont; std::unique_ptr<FontMetric> mpFontMetric; bool ImplAssertValidFontMetric(); - ::osl::Mutex& GetMutex() { return maMutex; } public: VCLXFont(); diff --git a/toolkit/source/awt/vclxfont.cxx b/toolkit/source/awt/vclxfont.cxx index 66e5ba2bdc40..b524de4d1a5d 100644 --- a/toolkit/source/awt/vclxfont.cxx +++ b/toolkit/source/awt/vclxfont.cxx @@ -72,7 +72,7 @@ UNO3_GETIMPLEMENTATION_IMPL( VCLXFont ); css::awt::FontDescriptor VCLXFont::getFontDescriptor( ) { - ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() ); + std::unique_lock aGuard( maMutex ); return VCLUnoHelper::CreateFontDescriptor( maFont ); @@ -80,7 +80,7 @@ css::awt::FontDescriptor VCLXFont::getFontDescriptor( ) css::awt::SimpleFontMetric VCLXFont::getFontMetric( ) { - ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() ); + std::unique_lock aGuard( maMutex ); css::awt::SimpleFontMetric aFM; if ( ImplAssertValidFontMetric() ) @@ -90,7 +90,7 @@ css::awt::SimpleFontMetric VCLXFont::getFontMetric( ) sal_Int16 VCLXFont::getCharWidth( sal_Unicode c ) { - ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() ); + std::unique_lock aGuard( maMutex ); sal_Int16 nRet = -1; OutputDevice* pOutDev = VCLUnoHelper::GetOutputDevice( mxDevice ); @@ -109,7 +109,7 @@ sal_Int16 VCLXFont::getCharWidth( sal_Unicode c ) css::uno::Sequence< sal_Int16 > VCLXFont::getCharWidths( sal_Unicode nFirst, sal_Unicode nLast ) { - ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() ); + std::unique_lock aGuard( maMutex ); css::uno::Sequence<sal_Int16> aSeq; OutputDevice* pOutDev = VCLUnoHelper::GetOutputDevice( mxDevice ); @@ -134,7 +134,7 @@ css::uno::Sequence< sal_Int16 > VCLXFont::getCharWidths( sal_Unicode nFirst, sal sal_Int32 VCLXFont::getStringWidth( const OUString& str ) { - ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() ); + std::unique_lock aGuard( maMutex ); sal_Int32 nRet = -1; OutputDevice* pOutDev = VCLUnoHelper::GetOutputDevice( mxDevice ); @@ -150,7 +150,7 @@ sal_Int32 VCLXFont::getStringWidth( const OUString& str ) sal_Int32 VCLXFont::getStringWidthArray( const OUString& str, css::uno::Sequence< sal_Int32 >& rDXArray ) { - ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() ); + std::unique_lock aGuard( maMutex ); sal_Int32 nRet = -1; OutputDevice* pOutDev = VCLUnoHelper::GetOutputDevice( mxDevice ); @@ -175,7 +175,7 @@ void VCLXFont::getKernPairs( css::uno::Sequence< sal_Unicode >& /*rnChars1*/, cs // css::awt::XFont2 sal_Bool VCLXFont::hasGlyphs( const OUString& aText ) { - ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() ); + std::unique_lock aGuard( maMutex ); SolarMutexGuard aSolarGuard; OutputDevice* pOutDev = VCLUnoHelper::GetOutputDevice( mxDevice ); commit bcab8f876746434979e5b4538c268ae700aba278 Author: Noel Grandin <noelgran...@gmail.com> AuthorDate: Thu Dec 16 17:55:31 2021 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Fri Dec 17 07:26:43 2021 +0100 use OInterfaceContainerHelper3 in CommandDispatch Change-Id: Ib193947279c4fe1862559d681278a3a73c8e8249 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126987 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/chart2/source/controller/main/CommandDispatch.cxx b/chart2/source/controller/main/CommandDispatch.cxx index ed6370a5228b..9a16fbb73b8b 100644 --- a/chart2/source/controller/main/CommandDispatch.cxx +++ b/chart2/source/controller/main/CommandDispatch.cxx @@ -69,7 +69,7 @@ void SAL_CALL CommandDispatch::addStatusListener( const Reference< frame::XStatu { aIt = m_aListeners.insert( m_aListeners.begin(), - tListenerMap::value_type( URL.Complete, new ::comphelper::OInterfaceContainerHelper2( m_aMutex ))); + tListenerMap::value_type( URL.Complete, new ::comphelper::OInterfaceContainerHelper3<css::frame::XStatusListener>( m_aMutex ))); } OSL_ASSERT( aIt != m_aListeners.end()); @@ -134,15 +134,13 @@ void CommandDispatch::fireStatusEventForURL( { if( aIt->second ) { - ::comphelper::OInterfaceIteratorHelper2 aIntfIt( *((*aIt).second) ); + ::comphelper::OInterfaceIteratorHelper3 aIntfIt( *((*aIt).second) ); while( aIntfIt.hasMoreElements()) { - Reference< frame::XStatusListener > xListener( aIntfIt.next(), uno::UNO_QUERY ); try { - if( xListener.is()) - xListener->statusChanged( aEventToSend ); + aIntfIt.next()->statusChanged( aEventToSend ); } catch( const uno::Exception & ) { diff --git a/chart2/source/controller/main/CommandDispatch.hxx b/chart2/source/controller/main/CommandDispatch.hxx index 37de7c59c119..81b70d0726f7 100644 --- a/chart2/source/controller/main/CommandDispatch.hxx +++ b/chart2/source/controller/main/CommandDispatch.hxx @@ -20,7 +20,7 @@ #include <MutexContainer.hxx> #include <cppuhelper/compbase.hxx> -#include <comphelper/interfacecontainer2.hxx> +#include <comphelper/interfacecontainer3.hxx> #include <com/sun/star/frame/XDispatch.hpp> #include <com/sun/star/util/XModifyListener.hpp> @@ -121,7 +121,7 @@ private: css::uno::Reference< css::uno::XComponentContext > m_xContext; css::uno::Reference< css::util::XURLTransformer > m_xURLTransformer; - typedef std::map< OUString, std::unique_ptr<::comphelper::OInterfaceContainerHelper2> > + typedef std::map< OUString, std::unique_ptr<::comphelper::OInterfaceContainerHelper3<css::frame::XStatusListener>> > tListenerMap; tListenerMap m_aListeners;