summaryrefslogtreecommitdiff
path: root/extensions/source/propctrlr
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 /extensions/source/propctrlr
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 'extensions/source/propctrlr')
-rw-r--r--extensions/source/propctrlr/controlfontdialog.cxx1
-rw-r--r--extensions/source/propctrlr/controlfontdialog.hxx2
-rw-r--r--extensions/source/propctrlr/fontdialog.cxx5
-rw-r--r--extensions/source/propctrlr/fontdialog.hxx4
-rw-r--r--extensions/source/propctrlr/formcomponenthandler.cxx2
5 files changed, 6 insertions, 8 deletions
diff --git a/extensions/source/propctrlr/controlfontdialog.cxx b/extensions/source/propctrlr/controlfontdialog.cxx
index 26afa43a20bf..436770e60316 100644
--- a/extensions/source/propctrlr/controlfontdialog.cxx
+++ b/extensions/source/propctrlr/controlfontdialog.cxx
@@ -36,7 +36,6 @@ namespace pcr
OControlFontDialog::OControlFontDialog(const Reference< XComponentContext >& _rxContext )
:OGenericUnoDialog( _rxContext )
- ,m_pItemPool(nullptr)
,m_pItemPoolDefaults(nullptr)
{
registerProperty(PROPERTY_INTROSPECTEDOBJECT, OWN_PROPERTY_ID_INTROSPECTEDOBJECT,
diff --git a/extensions/source/propctrlr/controlfontdialog.hxx b/extensions/source/propctrlr/controlfontdialog.hxx
index 202adadc73fe..8dc52010273f 100644
--- a/extensions/source/propctrlr/controlfontdialog.hxx
+++ b/extensions/source/propctrlr/controlfontdialog.hxx
@@ -44,7 +44,7 @@ namespace pcr
// </properties>
std::unique_ptr<SfxItemSet> m_pFontItems; // item set for the dialog
- SfxItemPool* m_pItemPool; // item pool for the item set for the dialog
+ rtl::Reference<SfxItemPool> m_pItemPool; // item pool for the item set for the dialog
std::vector<SfxPoolItem*>*
m_pItemPoolDefaults; // pool defaults
diff --git a/extensions/source/propctrlr/fontdialog.cxx b/extensions/source/propctrlr/fontdialog.cxx
index af276592fc41..0e4b11be2896 100644
--- a/extensions/source/propctrlr/fontdialog.cxx
+++ b/extensions/source/propctrlr/fontdialog.cxx
@@ -464,7 +464,7 @@ namespace pcr
}
}
- void ControlCharacterDialog::createItemSet(std::unique_ptr<SfxItemSet>& _rpSet, SfxItemPool*& _rpPool, std::vector<SfxPoolItem*>*& _rpDefaults)
+ void ControlCharacterDialog::createItemSet(std::unique_ptr<SfxItemSet>& _rpSet, rtl::Reference<SfxItemPool>& _rpPool, std::vector<SfxPoolItem*>*& _rpDefaults)
{
// just to be sure...
_rpSet = nullptr;
@@ -534,7 +534,7 @@ namespace pcr
_rpSet.reset(new SfxItemSet(*_rpPool));
}
- void ControlCharacterDialog::destroyItemSet(std::unique_ptr<SfxItemSet>& _rpSet, SfxItemPool*& _rpPool, std::vector<SfxPoolItem*>*& _rpDefaults)
+ void ControlCharacterDialog::destroyItemSet(std::unique_ptr<SfxItemSet>& _rpSet, rtl::Reference<SfxItemPool>& _rpPool, std::vector<SfxPoolItem*>*& _rpDefaults)
{
// from the pool, get and remember the font list (needs to be deleted)
const SvxFontListItem& rFontListItem = static_cast<const SvxFontListItem&>(_rpPool->GetDefaultItem(CFID_FONTLIST));
@@ -546,7 +546,6 @@ namespace pcr
// delete the pool
_rpPool->ReleaseDefaults(true);
// the "true" means delete the items, too
- SfxItemPool::Free(_rpPool);
_rpPool = nullptr;
// reset the defaults ptr
diff --git a/extensions/source/propctrlr/fontdialog.hxx b/extensions/source/propctrlr/fontdialog.hxx
index d2688f5ad200..eaba29db0b9c 100644
--- a/extensions/source/propctrlr/fontdialog.hxx
+++ b/extensions/source/propctrlr/fontdialog.hxx
@@ -36,10 +36,10 @@ namespace pcr
virtual ~ControlCharacterDialog() override;
/// creates an item set to be used with this dialog
- static void createItemSet(std::unique_ptr<SfxItemSet>& _rpSet, SfxItemPool*& _rpPool, std::vector<SfxPoolItem*>*& _rpDefaults);
+ static void createItemSet(std::unique_ptr<SfxItemSet>& _rpSet, rtl::Reference<SfxItemPool>& _rpPool, std::vector<SfxPoolItem*>*& _rpDefaults);
/// destroys an item previously created with <method>createItemSet</method>
- static void destroyItemSet(std::unique_ptr<SfxItemSet>& _rpSet, SfxItemPool*& _rpPool, std::vector<SfxPoolItem*>*& _rpDefaults);
+ static void destroyItemSet(std::unique_ptr<SfxItemSet>& _rpSet, rtl::Reference<SfxItemPool>& _rpPool, std::vector<SfxPoolItem*>*& _rpDefaults);
/// fills the given item set with values obtained from the given property set
static void translatePropertiesToItems(
diff --git a/extensions/source/propctrlr/formcomponenthandler.cxx b/extensions/source/propctrlr/formcomponenthandler.cxx
index ceac37326a0a..5631014ef211 100644
--- a/extensions/source/propctrlr/formcomponenthandler.cxx
+++ b/extensions/source/propctrlr/formcomponenthandler.cxx
@@ -2840,7 +2840,7 @@ namespace pcr
// create an item set for use with the dialog
std::unique_ptr<SfxItemSet> pSet;
- SfxItemPool* pPool = nullptr;
+ rtl::Reference<SfxItemPool> pPool;
std::vector<SfxPoolItem*>* pDefaults = nullptr;
ControlCharacterDialog::createItemSet(pSet, pPool, pDefaults);
ControlCharacterDialog::translatePropertiesToItems(m_xComponent, pSet.get());