summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-09-13 11:05:14 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-09-14 10:59:26 +0200
commitafb0dfc41ebb0a6a96ae31c122c7f97743dc7486 (patch)
tree8f2715ca59fde9fcee015ec69a4e77fe97eaac58
parent96ef1973d0309cc8a6aa9482f2fe35804f49c414 (diff)
loplugin:useuniqueptr in SwSubFont::DoOnCapitals
Change-Id: Ib5a02c71fa66f46a8e1072c5c0a263e1eb977692 Reviewed-on: https://gerrit.libreoffice.org/60454 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--sw/source/core/txtnode/fntcap.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/sw/source/core/txtnode/fntcap.cxx b/sw/source/core/txtnode/fntcap.cxx
index 14a38f7846e7..12be40860253 100644
--- a/sw/source/core/txtnode/fntcap.cxx
+++ b/sw/source/core/txtnode/fntcap.cxx
@@ -537,8 +537,8 @@ void SwSubFont::DoOnCapitals( SwDoCapitals &rDo )
aFont.SetProportion( (aFont.GetPropr() * smallCapsPercentage ) / 100 );
nFontCacheId2 = nullptr;
nIndex2 = 0;
- SwFntAccess *pSmallFontAccess = new SwFntAccess( nFontCacheId2, nIndex2, &aFont,
- rDo.GetInf().GetShell() );
+ std::unique_ptr<SwFntAccess> pSmallFontAccess( new SwFntAccess( nFontCacheId2, nIndex2, &aFont,
+ rDo.GetInf().GetShell() ));
SwFntObj *pSmallFont = pSmallFontAccess->Get();
rDo.Init( pBigFont, pSmallFont );
@@ -749,7 +749,7 @@ void SwSubFont::DoOnCapitals( SwDoCapitals &rDo )
pLastFont = pOldLast;
pLastFont->SetDevFont( rDo.GetInf().GetShell(), rDo.GetOut() );
- delete pSmallFontAccess;
+ pSmallFontAccess.reset();
rDo.GetInf().SetText(oldText);
rDo.GetInf().SetKanaDiff( nKana );
}