summaryrefslogtreecommitdiff
path: root/sw
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 /sw
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 'sw')
-rw-r--r--sw/source/core/doc/notxtfrm.cxx6
-rw-r--r--sw/source/core/inc/frame.hxx2
-rw-r--r--sw/source/core/layout/paintfrm.cxx14
3 files changed, 7 insertions, 15 deletions
diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx
index de13c4d8b7b2..9490c08d880b 100644
--- a/sw/source/core/doc/notxtfrm.cxx
+++ b/sw/source/core/doc/notxtfrm.cxx
@@ -911,15 +911,13 @@ bool paintUsingPrimitivesHelper(
uno::Sequence< beans::PropertyValue >());
// get a primitive processor for rendering
- drawinglayer::processor2d::BaseProcessor2D* pProcessor2D =
+ std::unique_ptr<drawinglayer::processor2d::BaseProcessor2D> pProcessor2D(
drawinglayer::processor2d::createProcessor2DFromOutputDevice(
- rOutputDevice, aViewInformation2D);
-
+ rOutputDevice, aViewInformation2D) );
if(pProcessor2D)
{
// render and cleanup
pProcessor2D->process(rSequence);
- delete pProcessor2D;
return true;
}
}
diff --git a/sw/source/core/inc/frame.hxx b/sw/source/core/inc/frame.hxx
index 4f6375d664a9..5756edf07e43 100644
--- a/sw/source/core/inc/frame.hxx
+++ b/sw/source/core/inc/frame.hxx
@@ -555,7 +555,7 @@ public:
const Color *pColor,
const SvxBorderLineStyle = SvxBorderLineStyle::SOLID ) const;
- drawinglayer::processor2d::BaseProcessor2D * CreateProcessor2D( ) const;
+ std::unique_ptr<drawinglayer::processor2d::BaseProcessor2D> CreateProcessor2D( ) const;
void ProcessPrimitives( const drawinglayer::primitive2d::Primitive2DContainer& rSequence ) const;
// retouch, not in the area of the given Rect!
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index 782587b964f2..2c55d516f5c9 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -1763,16 +1763,12 @@ bool DrawFillAttributes(
nullptr,
0.0,
uno::Sequence< beans::PropertyValue >());
- drawinglayer::processor2d::BaseProcessor2D* pProcessor = drawinglayer::processor2d::createProcessor2DFromOutputDevice(
+ std::unique_ptr<drawinglayer::processor2d::BaseProcessor2D> pProcessor(drawinglayer::processor2d::createProcessor2DFromOutputDevice(
rOut,
- aViewInformation2D);
-
+ aViewInformation2D) );
if(pProcessor)
{
pProcessor->process(*pPrimitives);
-
- delete pProcessor;
-
return true;
}
}
@@ -4959,7 +4955,7 @@ static const SwFrame* lcl_GetCellFrameForBorderAttrs( const SwFrame* _pC
return pRet;
}
-drawinglayer::processor2d::BaseProcessor2D * SwFrame::CreateProcessor2D( ) const
+std::unique_ptr<drawinglayer::processor2d::BaseProcessor2D> SwFrame::CreateProcessor2D( ) const
{
basegfx::B2DRange aViewRange;
@@ -4979,12 +4975,10 @@ drawinglayer::processor2d::BaseProcessor2D * SwFrame::CreateProcessor2D( ) const
void SwFrame::ProcessPrimitives( const drawinglayer::primitive2d::Primitive2DContainer& rSequence ) const
{
- drawinglayer::processor2d::BaseProcessor2D * pProcessor2D = CreateProcessor2D();
-
+ std::unique_ptr<drawinglayer::processor2d::BaseProcessor2D> pProcessor2D = CreateProcessor2D();
if ( pProcessor2D )
{
pProcessor2D->process( rSequence );
- delete pProcessor2D;
}
}