Kaydet (Commit) 96ef1973 authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:useuniqueptr in SwTextPortion::CreateHyphen

Change-Id: I9ab88f5d15a2d98285ac4c1ffce8750c16830d56
Reviewed-on: https://gerrit.libreoffice.org/60453
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 9e568efa
......@@ -264,7 +264,7 @@ bool SwTextPortion::CreateHyphen( SwTextFormatInfo &rInf, SwTextGuess const &rGu
( rInf.IsInterHyph() && InFieldGrp() ) )
return false;
SwHyphPortion *pHyphPor;
std::unique_ptr<SwHyphPortion> pHyphPor;
TextFrameIndex nPorEnd;
SwTextSizeInfo aInf( rInf );
......@@ -282,11 +282,11 @@ bool SwTextPortion::CreateHyphen( SwTextFormatInfo &rInf, SwTextGuess const &rGu
// soft hyphen at alternative spelling position?
if( rInf.GetText()[sal_Int32(rInf.GetSoftHyphPos())] == CHAR_SOFTHYPHEN )
{
pHyphPor = new SwSoftHyphStrPortion( aAltText );
pHyphPor.reset(new SwSoftHyphStrPortion( aAltText ));
nTmpLen = 1;
}
else {
pHyphPor = new SwHyphStrPortion( aAltText );
pHyphPor.reset(new SwHyphStrPortion( aAltText ));
}
// length of pHyphPor is adjusted
......@@ -297,7 +297,7 @@ bool SwTextPortion::CreateHyphen( SwTextFormatInfo &rInf, SwTextGuess const &rGu
else
{
// second case: no alternative spelling
pHyphPor = new SwHyphPortion;
pHyphPor.reset(new SwHyphPortion);
pHyphPor->SetLen(TextFrameIndex(1));
static const void* nLastFontCacheId = nullptr;
......@@ -331,7 +331,7 @@ bool SwTextPortion::CreateHyphen( SwTextFormatInfo &rInf, SwTextGuess const &rGu
SetLen( aInf.GetLen() );
CalcTextSize( aInf );
Insert( pHyphPor );
Insert( pHyphPor.get() );
short nKern = rInf.GetFont()->CheckKerning();
if( nKern )
......@@ -341,7 +341,7 @@ bool SwTextPortion::CreateHyphen( SwTextFormatInfo &rInf, SwTextGuess const &rGu
}
// last exit for the lost
delete pHyphPor;
pHyphPor.reset();
BreakCut( rInf, rGuess );
return false;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment