summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-09-13 11:04:38 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-09-14 09:25:39 +0200
commit7bf2c7bd69c5ae78f2b3220fc04f7271a8e5e90c (patch)
tree4c83bd3182c6534431c6b9fe65fbb45345b9b02a /sw
parent9e0ee17d5059b9a7cf80c8839bb139e1626d0ebb (diff)
loplugin:useuniqueptr in SwHolePortion::Paint
Change-Id: I068c83db5a3f5e717c72e4f2459a18eee690bbfd Reviewed-on: https://gerrit.libreoffice.org/60452 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/text/portxt.cxx12
1 files changed, 6 insertions, 6 deletions
diff --git a/sw/source/core/text/portxt.cxx b/sw/source/core/text/portxt.cxx
index 69593f8d157c..9fb3df006267 100644
--- a/sw/source/core/text/portxt.cxx
+++ b/sw/source/core/text/portxt.cxx
@@ -745,24 +745,24 @@ void SwHolePortion::Paint( const SwTextPaintInfo &rInf ) const
// #i68503# the hole must have no decoration for a consistent visual appearance
const SwFont* pOrigFont = rInf.GetFont();
- SwFont* pHoleFont = nullptr;
- SwFontSave* pFontSave = nullptr;
+ std::unique_ptr<SwFont> pHoleFont;
+ std::unique_ptr<SwFontSave> pFontSave;
if( pOrigFont->GetUnderline() != LINESTYLE_NONE
|| pOrigFont->GetOverline() != LINESTYLE_NONE
|| pOrigFont->GetStrikeout() != STRIKEOUT_NONE )
{
- pHoleFont = new SwFont( *pOrigFont );
+ pHoleFont.reset(new SwFont( *pOrigFont ));
pHoleFont->SetUnderline( LINESTYLE_NONE );
pHoleFont->SetOverline( LINESTYLE_NONE );
pHoleFont->SetStrikeout( STRIKEOUT_NONE );
- pFontSave = new SwFontSave( rInf, pHoleFont );
+ pFontSave.reset(new SwFontSave( rInf, pHoleFont.get() ));
}
const OUString aText( ' ' );
rInf.DrawText(aText, *this, TextFrameIndex(0), TextFrameIndex(1));
- delete pFontSave;
- delete pHoleFont;
+ pFontSave.reset();
+ pHoleFont.reset();
}
bool SwHolePortion::Format( SwTextFormatInfo &rInf )