diff options
author | Noel <noel.grandin@collabora.co.uk> | 2021-03-23 09:00:01 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-03-23 11:17:00 +0100 |
commit | 32a16bae415f64adcbad447162824611200407a1 (patch) | |
tree | dd2300965567cbd0c56d450ec804c70d5fd53d00 | |
parent | e29f53b71058b9468cb6c29f82dbf6de53d4cdd0 (diff) |
TransformControlValue can return unique_ptr
Change-Id: I902ba385d72a15e52b692da373f2fee5be6fc621
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112947
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | vcl/source/outdev/nativecontrols.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/vcl/source/outdev/nativecontrols.cxx b/vcl/source/outdev/nativecontrols.cxx index 8e0d54708391..48ea73db4bf9 100644 --- a/vcl/source/outdev/nativecontrols.cxx +++ b/vcl/source/outdev/nativecontrols.cxx @@ -163,9 +163,9 @@ bool OutputDevice::HitTestNativeScrollbar( rIsInside, *this ); } -static std::shared_ptr< ImplControlValue > TransformControlValue( const ImplControlValue& rVal, const OutputDevice& rDev ) +static std::unique_ptr< ImplControlValue > TransformControlValue( const ImplControlValue& rVal, const OutputDevice& rDev ) { - std::shared_ptr< ImplControlValue > aResult; + std::unique_ptr< ImplControlValue > aResult; switch( rVal.getType() ) { case ControlType::Slider: @@ -235,7 +235,7 @@ static std::shared_ptr< ImplControlValue > TransformControlValue( const ImplCont } break; case ControlType::Generic: - aResult = std::make_shared<ImplControlValue>( rVal ); + aResult = std::make_unique<ImplControlValue>( rVal ); break; case ControlType::MenuPopup: { @@ -281,7 +281,7 @@ bool OutputDevice::DrawNativeControl( ControlType nType, // Convert the coordinates from relative to Window-absolute, so we draw // in the correct place in platform code - std::shared_ptr< ImplControlValue > aScreenCtrlValue( TransformControlValue( aValue, *this ) ); + std::unique_ptr< ImplControlValue > aScreenCtrlValue( TransformControlValue( aValue, *this ) ); tools::Rectangle screenRegion( ImplLogicToDevicePixel( rControlRegion ) ); bool bRet = mpGraphics->DrawNativeControl(nType, nPart, screenRegion, nState, *aScreenCtrlValue, aCaption, *this, rBackgroundColor); @@ -306,7 +306,7 @@ bool OutputDevice::GetNativeControlRegion( ControlType nType, // Convert the coordinates from relative to Window-absolute, so we draw // in the correct place in platform code - std::shared_ptr< ImplControlValue > aScreenCtrlValue( TransformControlValue( aValue, *this ) ); + std::unique_ptr< ImplControlValue > aScreenCtrlValue( TransformControlValue( aValue, *this ) ); tools::Rectangle screenRegion( ImplLogicToDevicePixel( rControlRegion ) ); bool bRet = mpGraphics->GetNativeControlRegion(nType, nPart, screenRegion, nState, *aScreenCtrlValue, |