diff Framework/Radiography/RadiographyDicomLayer.cpp @ 1308:adf234ecaa00 broker

Merge
author Benjamin Golinvaux <bgo@osimis.io>
date Wed, 04 Mar 2020 10:21:54 +0100
parents 257f2c9a02ac
children 379c00958553
line wrap: on
line diff
--- a/Framework/Radiography/RadiographyDicomLayer.cpp	Wed Mar 04 10:07:37 2020 +0100
+++ b/Framework/Radiography/RadiographyDicomLayer.cpp	Wed Mar 04 10:21:54 2020 +0100
@@ -98,7 +98,7 @@
 
   void RadiographyDicomLayer::SetSourceImage(Orthanc::ImageAccessor* image)   // Takes ownership
   {
-    std::auto_ptr<Orthanc::ImageAccessor> raii(image);
+    std::unique_ptr<Orthanc::ImageAccessor> raii(image);
 
     if (image == NULL)
     {
@@ -107,7 +107,12 @@
 
     SetSize(image->GetWidth(), image->GetHeight());
 
-    source_ = raii;
+#if __cplusplus < 201103L
+    source_.reset(raii.release());
+#else
+    source_ = std::move(raii);
+#endif
+
     ApplyConverter();
 
     BroadcastMessage(RadiographyLayer::LayerEditedMessage(*this));
@@ -115,7 +120,7 @@
 
   void RadiographyDicomLayer::SetSourceImage(Orthanc::ImageAccessor* image, double newPixelSpacingX, double newPixelSpacingY, bool emitLayerEditedEvent)   // Takes ownership
   {
-    std::auto_ptr<Orthanc::ImageAccessor> raii(image);
+    std::unique_ptr<Orthanc::ImageAccessor> raii(image);
 
     if (image == NULL)
     {
@@ -124,7 +129,12 @@
 
     SetSize(image->GetWidth(), image->GetHeight(), false);
 
-    source_ = raii;
+#if __cplusplus < 201103L
+    source_.reset(raii.release());
+#else
+    source_ = std::move(raii);
+#endif
+
     ApplyConverter();
 
     SetPixelSpacing(newPixelSpacingX, newPixelSpacingY, false);