diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-03-27 10:11:51 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-03-27 13:30:40 +0200 |
commit | edfa0562617c1330cc00923a5cf6e5916bacfed0 (patch) | |
tree | f397da4f7dbf2e137a73e7df931348867339c104 /sc/qa | |
parent | 3acc5a2383f5b0458e3caf1505fe6b8ad7dc3fb0 (diff) |
ofz#7121 NamedDBs::insert takes ownership of its argument
at one point this was based on std::auto_ptr and didn't
free its arg on failure
Change-Id: I8aeed6876d80b7ebe4ebb5e2cfd12e00420bd207
Reviewed-on: https://gerrit.libreoffice.org/51932
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc/qa')
-rw-r--r-- | sc/qa/unit/ucalc_sharedformula.cxx | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/sc/qa/unit/ucalc_sharedformula.cxx b/sc/qa/unit/ucalc_sharedformula.cxx index 0f2c50f9d204..a21f778d6411 100644 --- a/sc/qa/unit/ucalc_sharedformula.cxx +++ b/sc/qa/unit/ucalc_sharedformula.cxx @@ -1581,8 +1581,6 @@ void Test::testSharedFormulaUpdateOnDBChange() // Define database range 'MyRange' for A1:A2. ScDBData* pData = new ScDBData("MyRange", 0, 0, 0, 0, 1); bool bInserted = pDBs->getNamedDBs().insert(pData); - if (!bInserted) - delete pData; CPPUNIT_ASSERT_MESSAGE("Failed to insert a new database range.", bInserted); // Insert in C2:C4 a group of formula cells that reference MyRange. @@ -1606,8 +1604,6 @@ void Test::testSharedFormulaUpdateOnDBChange() ScDBCollection aNewDBs(m_pDoc); ScDBData* pNewData = new ScDBData("MyRange", 0, 0, 0, 0, 3); bInserted = aNewDBs.getNamedDBs().insert(pNewData); - if (!bInserted) - delete pNewData; CPPUNIT_ASSERT_MESSAGE("Failed to insert a new database range.", bInserted); std::vector<ScRange> aDeleted; |