summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2021-08-11 20:42:31 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-08-12 10:51:01 +0200
commit4cd64dcd4857eafbe3146df287b517d8e5e455c0 (patch)
tree25265d8838e05b7356b91216c38a3bdbd8680828 /sfx2
parent498d2b82187ec3ff58f076e0d15741e64c0505ba (diff)
flatten SfxFoundCacheArr_Impl
Change-Id: Ie2b29b041bb0f678494126b21df651371a40dbda Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120344 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/control/bindings.cxx18
1 files changed, 8 insertions, 10 deletions
diff --git a/sfx2/source/control/bindings.cxx b/sfx2/source/control/bindings.cxx
index b217534376d2..26d6926016e7 100644
--- a/sfx2/source/control/bindings.cxx
+++ b/sfx2/source/control/bindings.cxx
@@ -77,14 +77,13 @@ struct SfxFoundCache_Impl
class SfxFoundCacheArr_Impl
{
- typedef std::vector<std::unique_ptr<SfxFoundCache_Impl> > DataType;
- DataType maData;
+ std::vector<SfxFoundCache_Impl> maData;
public:
SfxFoundCache_Impl& operator[] ( size_t i )
{
- return *maData[i];
+ return maData[i];
}
size_t size() const
@@ -92,9 +91,9 @@ public:
return maData.size();
}
- void push_back( SfxFoundCache_Impl* p )
+ void push_back( SfxFoundCache_Impl p )
{
- maData.push_back(std::unique_ptr<SfxFoundCache_Impl>(p));
+ maData.push_back(p);
}
};
@@ -1122,9 +1121,8 @@ std::optional<SfxItemSet> SfxBindings::CreateSet_Impl
pFnc = pRealSlot->GetStateFnc();
// the RealSlot is always on
- SfxFoundCache_Impl *pFound = new SfxFoundCache_Impl(
- pRealSlot->GetWhich(rPool), pRealSlot, rCache);
- rFound.push_back( pFound );
+ SfxFoundCache_Impl aFound(pRealSlot->GetWhich(rPool), pRealSlot, rCache);
+ rFound.push_back( aFound );
// Search through the bindings for slots served by the same function. This , // will only affect slots which are present in the found interface.
@@ -1155,11 +1153,11 @@ std::optional<SfxItemSet> SfxBindings::CreateSet_Impl
if ( bInsert && bSameMethod )
{
- SfxFoundCache_Impl *pFoundCache = new SfxFoundCache_Impl(
+ SfxFoundCache_Impl aFoundCache(
pSibling->GetWhich(rPool),
pSibling, *pSiblingCache);
- rFound.push_back( pFoundCache );
+ rFound.push_back( aFoundCache );
}
pSibling = pSibling->GetNextSlot();