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

loplugin:useuniqueptr in ScImportAsciiDlg

Change-Id: Ie73f89401a9e99f0cb11949cae3ebdde793b14bb
Reviewed-on: https://gerrit.libreoffice.org/57359
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst fdef3ecc
...@@ -531,7 +531,7 @@ ScImportAsciiDlg::~ScImportAsciiDlg() ...@@ -531,7 +531,7 @@ ScImportAsciiDlg::~ScImportAsciiDlg()
void ScImportAsciiDlg::dispose() void ScImportAsciiDlg::dispose()
{ {
delete[] mpRowPosArray; mpRowPosArray.reset();
pFtCharSet.clear(); pFtCharSet.clear();
pLbCharSet.clear(); pLbCharSet.clear();
pFtCustomLang.clear(); pFtCustomLang.clear();
...@@ -568,11 +568,11 @@ bool ScImportAsciiDlg::GetLine( sal_uLong nLine, OUString &rText, sal_Unicode& r ...@@ -568,11 +568,11 @@ bool ScImportAsciiDlg::GetLine( sal_uLong nLine, OUString &rText, sal_Unicode& r
bool bFixed = pRbFixed->IsChecked(); bool bFixed = pRbFixed->IsChecked();
if (!mpRowPosArray) if (!mpRowPosArray)
mpRowPosArray = new sal_uLong[ASCIIDLG_MAXROWS + 2]; mpRowPosArray.reset( new sal_uLong[ASCIIDLG_MAXROWS + 2] );
if (!mnRowPosCount) // complete re-fresh if (!mnRowPosCount) // complete re-fresh
{ {
memset( mpRowPosArray, 0, sizeof(mpRowPosArray[0]) * (ASCIIDLG_MAXROWS+2)); memset( mpRowPosArray.get(), 0, sizeof(mpRowPosArray[0]) * (ASCIIDLG_MAXROWS+2));
Seek(0); Seek(0);
mpDatStream->StartReadingUnicodeText( mpDatStream->GetStreamCharSet() ); mpDatStream->StartReadingUnicodeText( mpDatStream->GetStreamCharSet() );
......
...@@ -41,7 +41,7 @@ class ScImportAsciiDlg : public ModalDialog ...@@ -41,7 +41,7 @@ class ScImportAsciiDlg : public ModalDialog
{ {
SvStream* mpDatStream; SvStream* mpDatStream;
sal_uLong mnStreamPos; sal_uLong mnStreamPos;
sal_uLong* mpRowPosArray; std::unique_ptr<sal_uLong[]> mpRowPosArray;
sal_uLong mnRowPosCount; sal_uLong mnRowPosCount;
OUString maPreviewLine[ CSV_PREVIEW_LINES ]; OUString maPreviewLine[ CSV_PREVIEW_LINES ];
......
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