diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2021-04-08 13:27:34 +0900 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2021-04-27 15:59:11 +0200 |
commit | 1e70359ac7f2e10f7cefe006557b3df8e5a46ae0 (patch) | |
tree | 3643b18d34959f1e498cc004140975883d341689 /vcl/quartz | |
parent | 3260edbeb59d87f3f3e5c700cda4b0fd6222df0c (diff) |
vcl: store XorEmulation in a unique_ptr not raw pointer
Change-Id: I123c4048d333cdc761582763d6ccb9c254e32bbb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114700
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'vcl/quartz')
-rw-r--r-- | vcl/quartz/salgdi.cxx | 6 | ||||
-rw-r--r-- | vcl/quartz/salgdicommon.cxx | 12 |
2 files changed, 8 insertions, 10 deletions
diff --git a/vcl/quartz/salgdi.cxx b/vcl/quartz/salgdi.cxx index ae6a40cfd4e2..375fea64a5cb 100644 --- a/vcl/quartz/salgdi.cxx +++ b/vcl/quartz/salgdi.cxx @@ -186,8 +186,7 @@ bool CoreTextFontFace::GetFontCapabilities(vcl::FontCapabilities &rFontCapabilit } AquaSalGraphics::AquaSalGraphics() - : mpXorEmulation( nullptr ) - , mnXorMode( 0 ) + : mnXorMode( 0 ) , mnWidth( 0 ) , mnHeight( 0 ) , mnBitmapDepth( 0 ) @@ -229,8 +228,7 @@ AquaSalGraphics::~AquaSalGraphics() ReleaseFonts(); - if( mpXorEmulation ) - delete mpXorEmulation; + mpXorEmulation.reset(); #ifdef IOS if (mbForeignContext) diff --git a/vcl/quartz/salgdicommon.cxx b/vcl/quartz/salgdicommon.cxx index 51e35e79905a..db6715ce01e2 100644 --- a/vcl/quartz/salgdicommon.cxx +++ b/vcl/quartz/salgdicommon.cxx @@ -242,11 +242,11 @@ static Color ImplGetROPColor( SalROPColor nROPColor ) // apply the XOR mask to the target context if active and dirty void AquaSalGraphics::ApplyXorContext() { - if( !mpXorEmulation ) + if (!mpXorEmulation) { return; } - if( mpXorEmulation->UpdateTarget() ) + if (mpXorEmulation->UpdateTarget()) { RefreshRect( 0, 0, mnWidth, mnHeight ); // TODO: refresh minimal changerect } @@ -1486,11 +1486,11 @@ void AquaSalGraphics::SetXORMode( bool bSet, bool bInvertOnly ) return; } - if( (mpXorEmulation == nullptr) && !bSet ) + if (!mpXorEmulation && !bSet) { return; } - if( (mpXorEmulation != nullptr) && (bSet == mpXorEmulation->IsEnabled()) ) + if (mpXorEmulation && bSet == mpXorEmulation->IsEnabled()) { return; } @@ -1499,9 +1499,9 @@ void AquaSalGraphics::SetXORMode( bool bSet, bool bInvertOnly ) return; } // prepare XOR emulation - if( !mpXorEmulation ) + if (!mpXorEmulation) { - mpXorEmulation = new XorEmulation(); + mpXorEmulation = std::make_unique<XorEmulation>(); mpXorEmulation->SetTarget(mnWidth, mnHeight, mnBitmapDepth, maContextHolder.get(), maLayer.get()); } |