summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/source/filter/ascii/parasc.cxx12
1 files changed, 6 insertions, 6 deletions
diff --git a/sw/source/filter/ascii/parasc.cxx b/sw/source/filter/ascii/parasc.cxx
index a23bdfc77b41..f4962f61692d 100644
--- a/sw/source/filter/ascii/parasc.cxx
+++ b/sw/source/filter/ascii/parasc.cxx
@@ -83,11 +83,11 @@ ErrCode AsciiReader::Read( SwDoc &rDoc, const OUString&, SwPaM &rPam, const OUSt
return ERR_SWG_READ_ERROR;
}
- SwASCIIParser* pParser = new SwASCIIParser( &rDoc, rPam, *m_pStream,
- !m_bInsertMode, m_aOption.GetASCIIOpts() );
+ std::unique_ptr<SwASCIIParser> pParser(new SwASCIIParser( &rDoc, rPam, *m_pStream,
+ !m_bInsertMode, m_aOption.GetASCIIOpts() ));
ErrCode nRet = pParser->CallParser();
- delete pParser;
+ pParser.reset();
// after Read reset the options
m_aOption.ResetASCIIOpts();
return nRet;
@@ -143,12 +143,12 @@ ErrCode SwASCIIParser::CallParser()
::StartProgress( STR_STATSTR_W4WREAD, 0, nFileSize, pDoc->GetDocShell() );
- SwPaM* pInsPam = nullptr;
+ std::unique_ptr<SwPaM> pInsPam;
sal_Int32 nSttContent = 0;
if (!bNewDoc)
{
const SwNodeIndex& rTmp = pPam->GetPoint()->nNode;
- pInsPam = new SwPaM( rTmp, rTmp, 0, -1 );
+ pInsPam.reset(new SwPaM( rTmp, rTmp, 0, -1 ));
nSttContent = pPam->GetPoint()->nContent.GetIndex();
}
@@ -237,7 +237,7 @@ ErrCode SwASCIIParser::CallParser()
pItemSet.reset();
}
- delete pInsPam;
+ pInsPam.reset();
::EndProgress( pDoc->GetDocShell() );
return nError;