summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2021-12-16 19:14:14 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-12-17 07:27:02 +0100
commit9564433292aa6a5a79c6c619a05434973bd4b7b3 (patch)
tree9c448a74e766d212a74d67c97161d6931f887f31
parentbcab8f876746434979e5b4538c268ae700aba278 (diff)
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.grandin@collabora.co.uk>
-rw-r--r--include/toolkit/awt/vclxfont.hxx5
-rw-r--r--toolkit/source/awt/vclxfont.cxx14
2 files changed, 9 insertions, 10 deletions
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 );