[Libreoffice-commits] core.git: vcl/source

Noel (via logerrit) logerrit at kemper.freedesktop.org
Tue Mar 23 10:17:36 UTC 2021


 vcl/source/outdev/nativecontrols.cxx |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

New commits:
commit 32a16bae415f64adcbad447162824611200407a1
Author:     Noel <noel.grandin at collabora.co.uk>
AuthorDate: Tue Mar 23 09:00:01 2021 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Tue Mar 23 11:17:00 2021 +0100

    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 at collabora.co.uk>

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,


More information about the Libreoffice-commits mailing list