diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2021-08-30 21:55:50 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-08-31 19:56:42 +0200 |
commit | 1969673c42880419be95425eef792893692878a9 (patch) | |
tree | cd7120d75face62fc3e9c4f0a13522c23cbf3b96 /sfx2 | |
parent | b3aaa0057beb098e16976f7ec3361b5f484b28b1 (diff) |
no need to allocate SfxDocumentTemplates separately
it only contains a single pointer
Change-Id: If6fc4924b7980317500a5c02e62c671f8f97aafd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121338
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/appl/appdata.cxx | 4 | ||||
-rw-r--r-- | sfx2/source/inc/appdata.hxx | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/sfx2/source/appl/appdata.cxx b/sfx2/source/appl/appdata.cxx index 2dbe419c5911..9f6e09267858 100644 --- a/sfx2/source/appl/appdata.cxx +++ b/sfx2/source/appl/appdata.cxx @@ -108,10 +108,10 @@ SfxAppData_Impl::~SfxAppData_Impl() SfxDocumentTemplates* SfxAppData_Impl::GetDocumentTemplates() { if ( !pTemplates ) - pTemplates.reset(new SfxDocumentTemplates); + pTemplates.emplace(); else pTemplates->ReInitFromComponent(); - return pTemplates.get(); + return &*pTemplates; } void SfxAppData_Impl::OnApplicationBasicManagerCreated( BasicManager& _rBasicManager ) diff --git a/sfx2/source/inc/appdata.hxx b/sfx2/source/inc/appdata.hxx index 89ccc6b0b982..9966981241aa 100644 --- a/sfx2/source/inc/appdata.hxx +++ b/sfx2/source/inc/appdata.hxx @@ -26,6 +26,7 @@ #include <svl/svdde.hxx> #include <svtools/ehdl.hxx> #include <sfx2/app.hxx> +#include <sfx2/doctempl.hxx> #include <o3tl/enumarray.hxx> #include <bitset.hxx> @@ -43,7 +44,6 @@ class ISfxTemplateCommon; class SfxFilterMatcher; class SfxStatusDispatcher; class SfxDdeTriggerTopic_Impl; -class SfxDocumentTemplates; class SfxFrame; class SfxViewFrame; class SfxSlotPool; @@ -83,7 +83,7 @@ public: #endif rtl::Reference<SfxStatusDispatcher> mxAppDispatch; std::unique_ptr<SfxPickList> mxAppPickList; - std::unique_ptr<SfxDocumentTemplates> pTemplates; + std::optional<SfxDocumentTemplates> pTemplates; // global pointers SfxItemPool* pPool; |