diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-01-09 15:38:12 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-01-11 10:20:11 +0100 |
commit | 152e2e6943adf46f12c04cf76dc435e48c1f1c74 (patch) | |
tree | 152eb4397fd1b8ab4c9f60fdb3f70392ebd25e42 /sw/source/core/txtnode/fntcache.cxx | |
parent | 3d14462e233571ac8a77ab0484069e6cc944f320 (diff) |
use unique_ptr in sw
Change-Id: I471875142391e537a4301dfe42beb8f8803ff46b
Reviewed-on: https://gerrit.libreoffice.org/66036
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/core/txtnode/fntcache.cxx')
-rw-r--r-- | sw/source/core/txtnode/fntcache.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx index c2eb371af994..ee6735ec3244 100644 --- a/sw/source/core/txtnode/fntcache.cxx +++ b/sw/source/core/txtnode/fntcache.cxx @@ -1968,16 +1968,16 @@ Size SwFntObj::GetTextSize( SwDrawTextInfo& rInf ) aTextSize.setWidth( m_pPrinter->GetTextWidth( rInf.GetText(), sal_Int32(rInf.GetIdx()), sal_Int32(nLn))); aTextSize.setHeight( m_pPrinter->GetTextHeight() ); - long* pKernArray = new long[sal_Int32(nLn)]; + std::unique_ptr<long[]> pKernArray(new long[sal_Int32(nLn)]); CreateScrFont( *rInf.GetShell(), rInf.GetOut() ); if( !GetScrFont()->IsSameInstance( rInf.GetOut().GetFont() ) ) rInf.GetOut().SetFont( *m_pScrFont ); long nScrPos; - m_pPrinter->GetTextArray(rInf.GetText(), pKernArray, + m_pPrinter->GetTextArray(rInf.GetText(), pKernArray.get(), sal_Int32(rInf.GetIdx()), sal_Int32(nLn)); if( bCompress ) - rInf.SetKanaDiff( rInf.GetScriptInfo()->Compress( pKernArray, + rInf.SetKanaDiff( rInf.GetScriptInfo()->Compress( pKernArray.get(), rInf.GetIdx(), nLn, rInf.GetKanaComp(), static_cast<sal_uInt16>(m_aFont.GetFontSize().Height()) ,lcl_IsFullstopCentered( rInf.GetOut() ) ) ); else @@ -2027,7 +2027,7 @@ Size SwFntObj::GetTextSize( SwDrawTextInfo& rInf ) } } - delete[] pKernArray; + pKernArray.reset(); aTextSize.setWidth( nScrPos ); } else |