diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-11-22 08:56:15 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-11-22 12:46:56 +0100 |
commit | 06ad764cfb36ece7f054ecb786cc0395346a6a68 (patch) | |
tree | f67c2045e736fbbdb67d18255380b2d9288d75e4 /sd/source/ui/framework/factories/BasicViewFactory.cxx | |
parent | a73494cf130866d4e678a1f421df56cdba7441d8 (diff) |
improve function-local statics in scripting..svtools
Change-Id: Idf3785a1fbc6fc5b8efbdc4cd363047709f3af91
Reviewed-on: https://gerrit.libreoffice.org/63782
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd/source/ui/framework/factories/BasicViewFactory.cxx')
-rw-r--r-- | sd/source/ui/framework/factories/BasicViewFactory.cxx | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/sd/source/ui/framework/factories/BasicViewFactory.cxx b/sd/source/ui/framework/factories/BasicViewFactory.cxx index 864f305e6009..d76eccbde220 100644 --- a/sd/source/ui/framework/factories/BasicViewFactory.cxx +++ b/sd/source/ui/framework/factories/BasicViewFactory.cxx @@ -439,17 +439,18 @@ bool BasicViewFactory::IsCacheable (const std::shared_ptr<ViewDescriptor>& rpDes Reference<XRelocatableResource> xResource (rpDescriptor->mxView, UNO_QUERY); if (xResource.is()) { - static ::std::vector<Reference<XResourceId> > s_aCacheableResources; - if (s_aCacheableResources.empty() ) + static ::std::vector<Reference<XResourceId> > s_aCacheableResources = [&]() { + ::std::vector<Reference<XResourceId> > tmp; std::shared_ptr<FrameworkHelper> pHelper (FrameworkHelper::Instance(*mpBase)); // The slide sorter and the task panel are cacheable and relocatable. - s_aCacheableResources.push_back(FrameworkHelper::CreateResourceId( + tmp.push_back(FrameworkHelper::CreateResourceId( FrameworkHelper::msSlideSorterURL, FrameworkHelper::msLeftDrawPaneURL)); - s_aCacheableResources.push_back(FrameworkHelper::CreateResourceId( + tmp.push_back(FrameworkHelper::CreateResourceId( FrameworkHelper::msSlideSorterURL, FrameworkHelper::msLeftImpressPaneURL)); - } + return tmp; + }(); ::std::vector<Reference<XResourceId> >::const_iterator iId; for (iId=s_aCacheableResources.begin(); iId!=s_aCacheableResources.end(); ++iId) |