diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-12-23 16:03:53 +0200 |
---|---|---|
committer | Jochen Nitschke <j.nitschke+logerrit@ok.de> | 2016-12-26 18:35:59 +0000 |
commit | 833e6ca9d284bca536d09f6a30b1a8cfbb1c86d8 (patch) | |
tree | bd620398e39c9b2b84bb6127fa58575440193a80 /extensions | |
parent | d6a7f7fe98af19b43d8e82555a10bf1e835d0533 (diff) |
use std::vector instead of naked array in SfxItemPool
Change-Id: I2d4ac010ff5818e673567cee05700872588918e4
Reviewed-on: https://gerrit.libreoffice.org/32384
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
Diffstat (limited to 'extensions')
-rw-r--r-- | extensions/source/propctrlr/controlfontdialog.hxx | 3 | ||||
-rw-r--r-- | extensions/source/propctrlr/fontdialog.cxx | 14 | ||||
-rw-r--r-- | extensions/source/propctrlr/fontdialog.hxx | 4 | ||||
-rw-r--r-- | extensions/source/propctrlr/formcomponenthandler.cxx | 2 |
4 files changed, 12 insertions, 11 deletions
diff --git a/extensions/source/propctrlr/controlfontdialog.hxx b/extensions/source/propctrlr/controlfontdialog.hxx index a7727a776d13..b2ee83a4c85c 100644 --- a/extensions/source/propctrlr/controlfontdialog.hxx +++ b/extensions/source/propctrlr/controlfontdialog.hxx @@ -47,7 +47,8 @@ namespace pcr SfxItemSet* m_pFontItems; // item set for the dialog SfxItemPool* m_pItemPool; // item pool for the item set for the dialog - SfxPoolItem** m_pItemPoolDefaults; // pool defaults + std::vector<SfxPoolItem*>* + m_pItemPoolDefaults; // pool defaults public: explicit OControlFontDialog(const css::uno::Reference< css::uno::XComponentContext >& _rxContext); diff --git a/extensions/source/propctrlr/fontdialog.cxx b/extensions/source/propctrlr/fontdialog.cxx index a268635985c2..e452cbba7343 100644 --- a/extensions/source/propctrlr/fontdialog.cxx +++ b/extensions/source/propctrlr/fontdialog.cxx @@ -474,19 +474,19 @@ namespace pcr } - SfxItemSet* ControlCharacterDialog::createItemSet(SfxItemSet*& _rpSet, SfxItemPool*& _rpPool, SfxPoolItem**& _rppDefaults) + SfxItemSet* ControlCharacterDialog::createItemSet(SfxItemSet*& _rpSet, SfxItemPool*& _rpPool, std::vector<SfxPoolItem*>*& _rpDefaults) { // just to be sure .... _rpSet = nullptr; _rpPool = nullptr; - _rppDefaults = nullptr; + _rpDefaults = nullptr; // create and initialize the defaults - _rppDefaults = new SfxPoolItem*[CFID_LAST_ITEM_ID - CFID_FIRST_ITEM_ID + 1]; + _rpDefaults = new std::vector<SfxPoolItem*>(CFID_LAST_ITEM_ID - CFID_FIRST_ITEM_ID + 1); vcl::Font aDefaultVCLFont = Application::GetDefaultDevice()->GetSettings().GetStyleSettings().GetAppFont(); - SfxPoolItem** pCounter = _rppDefaults; // want to modify this without affecting the out param _rppDefaults + SfxPoolItem** pCounter = _rpDefaults->data(); // want to modify this without affecting the out param _rppDefaults *pCounter++ = new SvxFontItem(aDefaultVCLFont.GetFamilyType(), aDefaultVCLFont.GetFamilyName(), aDefaultVCLFont.GetStyleName(), aDefaultVCLFont.GetPitch(), aDefaultVCLFont.GetCharSet(), CFID_FONT); *pCounter++ = new SvxFontHeightItem(aDefaultVCLFont.GetFontHeight(), 100, CFID_HEIGHT); *pCounter++ = new SvxWeightItem(aDefaultVCLFont.GetWeight(), CFID_WEIGHT); @@ -537,7 +537,7 @@ namespace pcr }; _rpPool = new SfxItemPool(OUString("PCRControlFontItemPool"), CFID_FIRST_ITEM_ID, CFID_LAST_ITEM_ID, - aItemInfos, _rppDefaults); + aItemInfos, _rpDefaults); _rpPool->FreezeIdRanges(); // and, finally, the set @@ -547,7 +547,7 @@ namespace pcr } - void ControlCharacterDialog::destroyItemSet(SfxItemSet*& _rpSet, SfxItemPool*& _rpPool, SfxPoolItem**& _rppDefaults) + void ControlCharacterDialog::destroyItemSet(SfxItemSet*& _rpSet, 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)); @@ -567,7 +567,7 @@ namespace pcr _rpPool = nullptr; // reset the defaults ptr - _rppDefaults = nullptr; + _rpDefaults = nullptr; // no need to explicitly delete the defaults, this has been done by the ReleaseDefaults delete pFontList; diff --git a/extensions/source/propctrlr/fontdialog.hxx b/extensions/source/propctrlr/fontdialog.hxx index ca0b4380dce5..d014e376c074 100644 --- a/extensions/source/propctrlr/fontdialog.hxx +++ b/extensions/source/propctrlr/fontdialog.hxx @@ -38,10 +38,10 @@ namespace pcr virtual ~ControlCharacterDialog() override; /// creates an item set to be used with this dialog - static SfxItemSet* createItemSet(SfxItemSet*& _rpSet, SfxItemPool*& _rpPool, SfxPoolItem**& _rppDefaults); + static SfxItemSet* createItemSet(SfxItemSet*& _rpSet, SfxItemPool*& _rpPool, std::vector<SfxPoolItem*>*& _rpDefaults); /// destroys an item previously created with <method>createItemSet</method> - static void destroyItemSet(SfxItemSet*& _rpSet, SfxItemPool*& _rpPool, SfxPoolItem**& _rppDefaults); + static void destroyItemSet(SfxItemSet*& _rpSet, 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 18420096a470..91781c8d5c3d 100644 --- a/extensions/source/propctrlr/formcomponenthandler.cxx +++ b/extensions/source/propctrlr/formcomponenthandler.cxx @@ -2839,7 +2839,7 @@ namespace pcr // create an item set for use with the dialog SfxItemSet* pSet = nullptr; SfxItemPool* pPool = nullptr; - SfxPoolItem** pDefaults = nullptr; + std::vector<SfxPoolItem*>* pDefaults = nullptr; ControlCharacterDialog::createItemSet(pSet, pPool, pDefaults); ControlCharacterDialog::translatePropertiesToItems(m_xComponent, pSet); |