summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-07-12 16:33:23 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-07-13 11:00:56 +0200
commita5c04cbf2309ddb1d3ee80f2f2674df38b52df80 (patch)
tree2706bd3cdb38d358aa4556ca64d48dd8602b7512
parentfdef3ecc1ddef7adcf51df465048613b7b3e4ae6 (diff)
loplugin:useuniqueptr in ScImportAsciiDlg
Change-Id: Ie73f89401a9e99f0cb11949cae3ebdde793b14bb Reviewed-on: https://gerrit.libreoffice.org/57359 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--sc/source/ui/dbgui/scuiasciiopt.cxx6
-rw-r--r--sc/source/ui/inc/scuiasciiopt.hxx2
2 files changed, 4 insertions, 4 deletions
diff --git a/sc/source/ui/dbgui/scuiasciiopt.cxx b/sc/source/ui/dbgui/scuiasciiopt.cxx
index aeb718be4d08..db98865ca7f0 100644
--- a/sc/source/ui/dbgui/scuiasciiopt.cxx
+++ b/sc/source/ui/dbgui/scuiasciiopt.cxx
@@ -531,7 +531,7 @@ ScImportAsciiDlg::~ScImportAsciiDlg()
void ScImportAsciiDlg::dispose()
{
- delete[] mpRowPosArray;
+ mpRowPosArray.reset();
pFtCharSet.clear();
pLbCharSet.clear();
pFtCustomLang.clear();
@@ -568,11 +568,11 @@ bool ScImportAsciiDlg::GetLine( sal_uLong nLine, OUString &rText, sal_Unicode& r
bool bFixed = pRbFixed->IsChecked();
if (!mpRowPosArray)
- mpRowPosArray = new sal_uLong[ASCIIDLG_MAXROWS + 2];
+ mpRowPosArray.reset( new sal_uLong[ASCIIDLG_MAXROWS + 2] );
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);
mpDatStream->StartReadingUnicodeText( mpDatStream->GetStreamCharSet() );
diff --git a/sc/source/ui/inc/scuiasciiopt.hxx b/sc/source/ui/inc/scuiasciiopt.hxx
index c65fb81c3cec..49fa4b1b69b3 100644
--- a/sc/source/ui/inc/scuiasciiopt.hxx
+++ b/sc/source/ui/inc/scuiasciiopt.hxx
@@ -41,7 +41,7 @@ class ScImportAsciiDlg : public ModalDialog
{
SvStream* mpDatStream;
sal_uLong mnStreamPos;
- sal_uLong* mpRowPosArray;
+ std::unique_ptr<sal_uLong[]> mpRowPosArray;
sal_uLong mnRowPosCount;
OUString maPreviewLine[ CSV_PREVIEW_LINES ];