summaryrefslogtreecommitdiff
path: root/drawinglayer
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-07-15 12:05:08 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-07-16 08:39:20 +0200
commit03a651d48e7cb3b19c98bdf3ed0a1080b60974ae (patch)
treea9222819679787b1ace882e0d4968228dbd6e92b /drawinglayer
parent99876774fbcd5409ca6a6a15c44ecd39a117236f (diff)
return BaseProcessor2D by std::unique_ptr
Change-Id: Ibad6e989d2d7ba779e7557e41552d06c076f657b Reviewed-on: https://gerrit.libreoffice.org/57448 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'drawinglayer')
-rw-r--r--drawinglayer/source/processor2d/processor2dtools.cxx9
-rw-r--r--drawinglayer/source/processor2d/processorfromoutputdevice.cxx7
-rw-r--r--drawinglayer/source/tools/converters.cxx4
3 files changed, 11 insertions, 9 deletions
diff --git a/drawinglayer/source/processor2d/processor2dtools.cxx b/drawinglayer/source/processor2d/processor2dtools.cxx
index 49863873ddba..9d7e1aed245c 100644
--- a/drawinglayer/source/processor2d/processor2dtools.cxx
+++ b/drawinglayer/source/processor2d/processor2dtools.cxx
@@ -17,6 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <drawinglayer/processor2d/processor2dtools.hxx>
+#include <o3tl/make_unique.hxx>
#include "vclpixelprocessor2d.hxx"
#include "vclmetafileprocessor2d.hxx"
@@ -28,15 +29,15 @@ namespace drawinglayer
{
namespace processor2d
{
- BaseProcessor2D* createPixelProcessor2DFromOutputDevice(
+ std::unique_ptr<BaseProcessor2D> createPixelProcessor2DFromOutputDevice(
OutputDevice& rTargetOutDev,
const drawinglayer::geometry::ViewInformation2D& rViewInformation2D)
{
// create Pixel Vcl-Processor
- return new VclPixelProcessor2D(rViewInformation2D, rTargetOutDev);
+ return o3tl::make_unique<VclPixelProcessor2D>(rViewInformation2D, rTargetOutDev);
}
- BaseProcessor2D* createProcessor2DFromOutputDevice(
+ std::unique_ptr<BaseProcessor2D> createProcessor2DFromOutputDevice(
OutputDevice& rTargetOutDev,
const drawinglayer::geometry::ViewInformation2D& rViewInformation2D)
{
@@ -46,7 +47,7 @@ namespace drawinglayer
if(bOutputToRecordingMetaFile)
{
// create MetaFile Vcl-Processor and process
- return new VclMetafileProcessor2D(rViewInformation2D, rTargetOutDev);
+ return o3tl::make_unique<VclMetafileProcessor2D>(rViewInformation2D, rTargetOutDev);
}
else
{
diff --git a/drawinglayer/source/processor2d/processorfromoutputdevice.cxx b/drawinglayer/source/processor2d/processorfromoutputdevice.cxx
index 16bd3b6404f4..ce81ce4b8f88 100644
--- a/drawinglayer/source/processor2d/processorfromoutputdevice.cxx
+++ b/drawinglayer/source/processor2d/processorfromoutputdevice.cxx
@@ -26,6 +26,7 @@
#include "vclmetafileprocessor2d.hxx"
#include "vclpixelprocessor2d.hxx"
#include <vcl/window.hxx>
+#include <o3tl/make_unique.hxx>
using namespace com::sun::star;
@@ -33,7 +34,7 @@ namespace drawinglayer
{
namespace processor2d
{
- drawinglayer::processor2d::BaseProcessor2D* createBaseProcessor2DFromOutputDevice(
+ std::unique_ptr<drawinglayer::processor2d::BaseProcessor2D> createBaseProcessor2DFromOutputDevice(
OutputDevice& rTargetOutDev,
const drawinglayer::geometry::ViewInformation2D& rViewInformation2D)
{
@@ -43,12 +44,12 @@ namespace drawinglayer
if(bOutputToRecordingMetaFile)
{
// create MetaFile Vcl-Processor and process
- return new drawinglayer::processor2d::VclMetafileProcessor2D(rViewInformation2D, rTargetOutDev);
+ return o3tl::make_unique<drawinglayer::processor2d::VclMetafileProcessor2D>(rViewInformation2D, rTargetOutDev);
}
else
{
// create Pixel Vcl-Processor
- return new drawinglayer::processor2d::VclPixelProcessor2D(rViewInformation2D, rTargetOutDev);
+ return o3tl::make_unique<drawinglayer::processor2d::VclPixelProcessor2D>(rViewInformation2D, rTargetOutDev);
}
}
} // end of namespace processor2d
diff --git a/drawinglayer/source/tools/converters.cxx b/drawinglayer/source/tools/converters.cxx
index 968b67bef4c0..c34dc03e9039 100644
--- a/drawinglayer/source/tools/converters.cxx
+++ b/drawinglayer/source/tools/converters.cxx
@@ -80,7 +80,7 @@ namespace drawinglayer
// create pixel processor, also already takes care of AAing and
// checking the getOptionsDrawinglayer().IsAntiAliasing() switch. If
// not wanted, change after this call as needed
- processor2d::BaseProcessor2D* pContentProcessor = processor2d::createPixelProcessor2DFromOutputDevice(
+ std::unique_ptr<processor2d::BaseProcessor2D> pContentProcessor = processor2d::createPixelProcessor2DFromOutputDevice(
*pContent.get(),
rViewInformation2D);
@@ -122,7 +122,7 @@ namespace drawinglayer
// render
pContentProcessor->process(xSeq);
- delete pContentProcessor;
+ pContentProcessor.reset();
// get alpha channel from vdev
pContent->EnableMapMode(false);