summaryrefslogtreecommitdiff
path: root/svl/qa
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-05-07 22:06:14 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-05-08 17:36:54 +0200
commit1545949690c750d7b512000723b564e69cf3c3a6 (patch)
tree1463c8b2912a9e269fe8b7ef3f7326dc85173830 /svl/qa
parentc10ce2698a3b001d22db3d33f2f43513cc49ebda (diff)
ref-count SfxItemPool
so we can remove SfxItemPoolUser, which is a right performance hog when we have large calc spreadsheets Change-Id: I344002f536f6eead5cf98c6647dd1667fd9c8874 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115247 Tested-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svl/qa')
-rw-r--r--svl/qa/unit/items/stylepool.cxx3
-rw-r--r--svl/qa/unit/items/test_itempool.cxx5
2 files changed, 3 insertions, 5 deletions
diff --git a/svl/qa/unit/items/stylepool.cxx b/svl/qa/unit/items/stylepool.cxx
index c334360f5e3f..5fb94f29f9cd 100644
--- a/svl/qa/unit/items/stylepool.cxx
+++ b/svl/qa/unit/items/stylepool.cxx
@@ -28,7 +28,7 @@ CPPUNIT_TEST_FIXTURE(StylePoolTest, testIterationOrder)
std::vector<SfxPoolItem*> aDefaults{ &aDefault1 };
SfxItemInfo const aItems[] = { { 1, false } };
- SfxItemPool* pPool = new SfxItemPool("test", 1, 1, aItems);
+ rtl::Reference<SfxItemPool> pPool = new SfxItemPool("test", 1, 1, aItems);
pPool->SetDefaults(&aDefaults);
{
// Set up parents in mixed order to make sure we do not sort by pointer address.
@@ -76,7 +76,6 @@ CPPUNIT_TEST_FIXTURE(StylePoolTest, testIterationOrder)
CPPUNIT_ASSERT_EQUAL(OUString("Item3"), pItem3->GetValue());
CPPUNIT_ASSERT(!pIter->getNext());
}
- SfxItemPool::Free(pPool);
}
}
diff --git a/svl/qa/unit/items/test_itempool.cxx b/svl/qa/unit/items/test_itempool.cxx
index fc19eec64752..4d15edaffd86 100644
--- a/svl/qa/unit/items/test_itempool.cxx
+++ b/svl/qa/unit/items/test_itempool.cxx
@@ -40,8 +40,8 @@ void PoolItemTest::testPool()
{ 4, false /* not poolable */}
};
- SfxItemPool *pPool = new SfxItemPool("testpool", 1, 4, aItems);
- SfxItemPool_Impl *pImpl = SfxItemPool_Impl::GetImpl(pPool);
+ rtl::Reference<SfxItemPool> pPool = new SfxItemPool("testpool", 1, 4, aItems);
+ SfxItemPool_Impl *pImpl = SfxItemPool_Impl::GetImpl(pPool.get());
CPPUNIT_ASSERT(pImpl != nullptr);
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(4), pImpl->maPoolItemArrays.size());
@@ -91,7 +91,6 @@ void PoolItemTest::testPool()
pPool->Put(aNotherFour);
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(2), pImpl->maPoolItemArrays[3].size());
- SfxItemPool::Free(pPool);
}