summaryrefslogtreecommitdiff
path: root/sw/source/core/text/pormulti.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-05-26 09:33:13 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-05-26 11:19:29 +0200
commit294eaac1113aa24ac65c254058007a9a489b28e6 (patch)
treea91902f706e31183be1dbe89b8e2cce7bbdaefee /sw/source/core/text/pormulti.cxx
parent284eb63624d2822f12e9216171da3c479e95f2d9 (diff)
fix leak in BuildMultiPortion
Change-Id: I267d59bdc8ac2f17d223d0345c4bcb4ea40a8704 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116149 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/core/text/pormulti.cxx')
-rw-r--r--sw/source/core/text/pormulti.cxx7
1 files changed, 4 insertions, 3 deletions
diff --git a/sw/source/core/text/pormulti.cxx b/sw/source/core/text/pormulti.cxx
index 0c3297e57207..dc83cbde6556 100644
--- a/sw/source/core/text/pormulti.cxx
+++ b/sw/source/core/text/pormulti.cxx
@@ -1899,15 +1899,16 @@ bool SwTextFormatter::BuildMultiPortion( SwTextFormatInfo &rInf,
SeekAndChg( rInf );
std::unique_ptr<SwFontSave> xFontSave;
+ std::unique_ptr<SwFont> xTmpFont;
if( rMulti.IsDouble() )
{
- SwFont* pTmpFnt = new SwFont( *rInf.GetFont() );
+ xTmpFont.reset(new SwFont( *rInf.GetFont() ));
if( rMulti.IsDouble() )
{
SetPropFont( 50 );
- pTmpFnt->SetProportion( GetPropFont() );
+ xTmpFont->SetProportion( GetPropFont() );
}
- xFontSave.reset(new SwFontSave(rInf, pTmpFnt, this));
+ xFontSave.reset(new SwFontSave(rInf, xTmpFont.get(), this));
}
SwLayoutModeModifier aLayoutModeModifier( *GetInfo().GetOut() );