[Libreoffice-commits] core.git: sw/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Fri Sep 14 07:26:09 UTC 2018
sw/source/core/text/portxt.cxx | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
New commits:
commit 7bf2c7bd69c5ae78f2b3220fc04f7271a8e5e90c
Author: Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Thu Sep 13 11:04:38 2018 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Fri Sep 14 09:25:39 2018 +0200
loplugin:useuniqueptr in SwHolePortion::Paint
Change-Id: I068c83db5a3f5e717c72e4f2459a18eee690bbfd
Reviewed-on: https://gerrit.libreoffice.org/60452
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
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 )
More information about the Libreoffice-commits
mailing list