summaryrefslogtreecommitdiff
path: root/sc/source/ui/docshell/dbdocfun.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-01-15 09:09:22 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-01-16 11:05:47 +0100
commitd08425c14b29bbac9f33c234f89b451388cd1d7c (patch)
treefa441dcaa912692c2e10f6189337446147400bfd /sc/source/ui/docshell/dbdocfun.cxx
parent4c9caae6c8ab608688a68be2c81bde2dd40315b7 (diff)
use unique_ptr in sc
Change-Id: If64b50919002f1f7376602f6e9cfb24e2184263b Reviewed-on: https://gerrit.libreoffice.org/66417 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source/ui/docshell/dbdocfun.cxx')
-rw-r--r--sc/source/ui/docshell/dbdocfun.cxx6
1 files changed, 2 insertions, 4 deletions
diff --git a/sc/source/ui/docshell/dbdocfun.cxx b/sc/source/ui/docshell/dbdocfun.cxx
index 8a7896a71024..a3c1474766bf 100644
--- a/sc/source/ui/docshell/dbdocfun.cxx
+++ b/sc/source/ui/docshell/dbdocfun.cxx
@@ -782,7 +782,7 @@ bool ScDBDocFunc::Query( SCTAB nTab, const ScQueryParam& rQueryParam,
rDoc.BeginDrawUndo();
}
- ScDocument* pAttribDoc = nullptr;
+ std::unique_ptr<ScDocument> pAttribDoc;
ScRange aAttribRange;
if (pDestData) // delete destination range
{
@@ -798,7 +798,7 @@ bool ScDBDocFunc::Query( SCTAB nTab, const ScQueryParam& rQueryParam,
// also for filled-in formulas
aAttribRange.aEnd.SetCol( aAttribRange.aEnd.Col() + nFormulaCols );
- pAttribDoc = new ScDocument( SCDOCMODE_UNDO );
+ pAttribDoc.reset(new ScDocument( SCDOCMODE_UNDO ));
pAttribDoc->InitUndo( &rDoc, nDestTab, nDestTab, false, true );
rDoc.CopyToDocument(aAttribRange, InsertDeleteFlags::ATTRIB, false, *pAttribDoc);
}
@@ -882,8 +882,6 @@ bool ScDBDocFunc::Query( SCTAB nTab, const ScQueryParam& rQueryParam,
nDestTab, *pStyle );
}
}
-
- delete pAttribDoc;
}
}