summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2021-08-30 22:07:48 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-08-31 19:57:30 +0200
commita41cbb1212a92f525dc75e90007c6dbc998f37c5 (patch)
tree40390103c882bed00587cc0818cf2e529e04c31f
parent5fddc93fec46cda828595418105af3838918cb69 (diff)
flatten SfxAppData_Impl
no need to allocate things separately that are always allocated with this object Change-Id: I6acc215fa1f86625f300cd7717ee5d40a6bc986b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121341 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--sfx2/source/appl/app.cxx2
-rw-r--r--sfx2/source/appl/appinit.cxx16
-rw-r--r--sfx2/source/appl/appmisc.cxx2
-rw-r--r--sfx2/source/inc/appdata.hxx15
4 files changed, 17 insertions, 18 deletions
diff --git a/sfx2/source/appl/app.cxx b/sfx2/source/appl/app.cxx
index f4027064494d..83c59e708872 100644
--- a/sfx2/source/appl/app.cxx
+++ b/sfx2/source/appl/app.cxx
@@ -243,7 +243,7 @@ void SfxApplication::ResetLastDir()
SfxDispatcher* SfxApplication::GetDispatcher_Impl()
{
- return pImpl->pViewFrame ? pImpl->pViewFrame->GetDispatcher() : pImpl->pAppDispat.get();
+ return pImpl->pViewFrame ? pImpl->pViewFrame->GetDispatcher() : &*pImpl->pAppDispat;
}
diff --git a/sfx2/source/appl/appinit.cxx b/sfx2/source/appl/appinit.cxx
index e17d9eb88cf6..a20bec463334 100644
--- a/sfx2/source/appl/appinit.cxx
+++ b/sfx2/source/appl/appinit.cxx
@@ -186,14 +186,14 @@ void SfxApplication::Initialize_Impl()
Help::EnableContextHelp();
Help::EnableExtHelp();
- pImpl->m_pToolsErrorHdl.reset(new SfxErrorHandler(
- RID_ERRHDL, ErrCodeArea::Io, ErrCodeArea::Vcl));
+ pImpl->m_pToolsErrorHdl.emplace(
+ RID_ERRHDL, ErrCodeArea::Io, ErrCodeArea::Vcl);
- pImpl->m_pSoErrorHdl.reset(new SfxErrorHandler(
- RID_SO_ERROR_HANDLER, ErrCodeArea::So, ErrCodeArea::So, SvtResLocale()));
+ pImpl->m_pSoErrorHdl.emplace(
+ RID_SO_ERROR_HANDLER, ErrCodeArea::So, ErrCodeArea::So, SvtResLocale());
#if HAVE_FEATURE_SCRIPTING
- pImpl->m_pSbxErrorHdl.reset(new SfxErrorHandler(
- RID_BASIC_START, ErrCodeArea::Sbx, ErrCodeArea::Sbx, BasResLocale()));
+ pImpl->m_pSbxErrorHdl.emplace(
+ RID_BASIC_START, ErrCodeArea::Sbx, ErrCodeArea::Sbx, BasResLocale());
#endif
if (!utl::ConfigManager::IsFuzzing())
@@ -205,8 +205,8 @@ void SfxApplication::Initialize_Impl()
}
DBG_ASSERT( !pImpl->pAppDispat, "AppDispatcher already exists" );
- pImpl->pAppDispat.reset(new SfxDispatcher);
- pImpl->pSlotPool.reset(new SfxSlotPool);
+ pImpl->pAppDispat.emplace();
+ pImpl->pSlotPool.emplace();
Registrations_Impl();
diff --git a/sfx2/source/appl/appmisc.cxx b/sfx2/source/appl/appmisc.cxx
index f7ddfb297d6a..eb5f0ce21062 100644
--- a/sfx2/source/appl/appmisc.cxx
+++ b/sfx2/source/appl/appmisc.cxx
@@ -98,7 +98,7 @@ SfxModule* SfxApplication::GetModule_Impl()
}
bool SfxApplication::IsDowning() const { return pImpl->bDowning; }
-SfxDispatcher* SfxApplication::GetAppDispatcher_Impl() { return pImpl->pAppDispat.get(); }
+SfxDispatcher* SfxApplication::GetAppDispatcher_Impl() { return &*pImpl->pAppDispat; }
SfxSlotPool& SfxApplication::GetAppSlotPool_Impl() const { return *pImpl->pSlotPool; }
static bool FileExists( const INetURLObject& rURL )
diff --git a/sfx2/source/inc/appdata.hxx b/sfx2/source/inc/appdata.hxx
index 8b225d251372..121ba43f5581 100644
--- a/sfx2/source/inc/appdata.hxx
+++ b/sfx2/source/inc/appdata.hxx
@@ -26,8 +26,10 @@
#include <svl/svdde.hxx>
#include <svtools/ehdl.hxx>
#include <sfx2/app.hxx>
+#include <sfx2/dispatch.hxx>
#include <sfx2/doctempl.hxx>
#include <sfx2/fcontnr.hxx>
+#include <sfx2/msgpool.hxx>
#include <o3tl/enumarray.hxx>
#include "sfxpicklist.hxx"
@@ -46,8 +48,6 @@ class SfxStatusDispatcher;
class SfxDdeTriggerTopic_Impl;
class SfxFrame;
class SfxViewFrame;
-class SfxSlotPool;
-class SfxDispatcher;
class SfxInterface;
class BasicManager;
class SfxBasicManagerHolder;
@@ -76,10 +76,10 @@ public:
// application members
std::optional<SfxFilterMatcher> pMatcher;
- std::unique_ptr<SfxErrorHandler> m_pToolsErrorHdl;
- std::unique_ptr<SfxErrorHandler> m_pSoErrorHdl;
+ std::optional<SfxErrorHandler> m_pToolsErrorHdl;
+ std::optional<SfxErrorHandler> m_pSoErrorHdl;
#if HAVE_FEATURE_SCRIPTING
- std::unique_ptr<SfxErrorHandler> m_pSbxErrorHdl;
+ std::optional<SfxErrorHandler> m_pSbxErrorHdl;
#endif
rtl::Reference<SfxStatusDispatcher> mxAppDispatch;
std::optional<SfxPickList> mxAppPickList;
@@ -107,9 +107,8 @@ public:
std::unique_ptr<SfxBasicManagerCreationListener>
pBasMgrListener;
SfxViewFrame* pViewFrame;
- std::unique_ptr<SfxSlotPool>
- pSlotPool;
- std::unique_ptr<SfxDispatcher>
+ std::optional<SfxSlotPool> pSlotPool;
+ std::optional<SfxDispatcher>
pAppDispat; // Dispatcher if no document
::rtl::Reference<sfx2::sidebar::Theme> m_pSidebarTheme;