From 5fddc93fec46cda828595418105af3838918cb69 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 30 Aug 2021 22:01:27 +0200 Subject: no need to allocate SfxFilterMatcher separately it only contains a single pointer Change-Id: If988f03d693d4912ce3b7a6fa5fab7cd52ab05cd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121340 Tested-by: Jenkins Reviewed-by: Noel Grandin --- sfx2/source/appl/appmain.cxx | 4 ++-- sfx2/source/inc/appdata.hxx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'sfx2') diff --git a/sfx2/source/appl/appmain.cxx b/sfx2/source/appl/appmain.cxx index 884c4fd4db39..5f24bbc8aae3 100644 --- a/sfx2/source/appl/appmain.cxx +++ b/sfx2/source/appl/appmain.cxx @@ -28,9 +28,9 @@ SfxFilterMatcher& SfxApplication::GetFilterMatcher() { if( !pImpl->pMatcher ) { - pImpl->pMatcher.reset(new SfxFilterMatcher()); + pImpl->pMatcher.emplace(); URIHelper::SetMaybeFileHdl( LINK( - pImpl->pMatcher.get(), SfxFilterMatcher, MaybeFileHdl_Impl ) ); + &*pImpl->pMatcher, SfxFilterMatcher, MaybeFileHdl_Impl ) ); } return *pImpl->pMatcher; } diff --git a/sfx2/source/inc/appdata.hxx b/sfx2/source/inc/appdata.hxx index ac29be15f9b7..8b225d251372 100644 --- a/sfx2/source/inc/appdata.hxx +++ b/sfx2/source/inc/appdata.hxx @@ -27,6 +27,7 @@ #include #include #include +#include #include #include "sfxpicklist.hxx" @@ -41,7 +42,6 @@ class DdeService; class SfxItemPool; class SfxFilterMatcher; class ISfxTemplateCommon; -class SfxFilterMatcher; class SfxStatusDispatcher; class SfxDdeTriggerTopic_Impl; class SfxFrame; @@ -75,7 +75,7 @@ public: std::vector vTopFrames; // application members - std::unique_ptr pMatcher; + std::optional pMatcher; std::unique_ptr m_pToolsErrorHdl; std::unique_ptr m_pSoErrorHdl; #if HAVE_FEATURE_SCRIPTING -- cgit