forms/source/component/clickableimage.cxx | 14 +++++++------- forms/source/component/clickableimage.hxx | 5 ++--- forms/source/helper/formnavigation.cxx | 10 +++++----- forms/source/inc/formnavigation.hxx | 6 +++--- lotuswordpro/inc/lwpfoundry.hxx | 5 ++--- lotuswordpro/source/filter/lwpdoc.cxx | 6 +++--- lotuswordpro/source/filter/lwpdoc.hxx | 3 ++- lotuswordpro/source/filter/lwpfoundry.cxx | 1 - lotuswordpro/source/filter/lwpfribptr.cxx | 2 +- lotuswordpro/source/filter/lwplayout.cxx | 3 +-- lotuswordpro/source/filter/lwplayout.hxx | 2 +- lotuswordpro/source/filter/lwppara.cxx | 2 +- lotuswordpro/source/filter/lwpsilverbullet.cxx | 3 +-- lotuswordpro/source/filter/lwpsilverbullet.hxx | 2 +- 14 files changed, 30 insertions(+), 34 deletions(-)
New commits: commit bb92647934cd4c925e0db13c7ab78fdd8eec69ec Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Mon Mar 6 15:05:52 2023 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Mon Mar 6 19:58:02 2023 +0000 no need to allocate these separately they are all one or two words in size Change-Id: Idc76cb87d1dae7ef245f327dc4afebaf71190f6b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148342 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/forms/source/component/clickableimage.cxx b/forms/source/component/clickableimage.cxx index 03329382f5c0..e1f6f068faf0 100644 --- a/forms/source/component/clickableimage.cxx +++ b/forms/source/component/clickableimage.cxx @@ -85,10 +85,10 @@ namespace frm OClickableImageBaseControl::OClickableImageBaseControl(const Reference<XComponentContext>& _rxFactory, const OUString& _aService) :OControl(_rxFactory, _aService) ,m_aSubmissionVetoListeners( m_aMutex ) + ,m_aFeatureInterception( _rxFactory ) ,m_aApproveActionListeners( m_aMutex ) ,m_aActionListeners( m_aMutex ) { - m_pFeatureInterception.reset( new ControlFeatureInterception( _rxFactory ) ); } @@ -129,13 +129,13 @@ namespace frm void SAL_CALL OClickableImageBaseControl::registerDispatchProviderInterceptor( const Reference< XDispatchProviderInterceptor >& _rxInterceptor ) { - m_pFeatureInterception->registerDispatchProviderInterceptor( _rxInterceptor ); + m_aFeatureInterception.registerDispatchProviderInterceptor( _rxInterceptor ); } void SAL_CALL OClickableImageBaseControl::releaseDispatchProviderInterceptor( const Reference< XDispatchProviderInterceptor >& _rxInterceptor ) { - m_pFeatureInterception->releaseDispatchProviderInterceptor( _rxInterceptor ); + m_aFeatureInterception.releaseDispatchProviderInterceptor( _rxInterceptor ); } // OComponentHelper @@ -146,7 +146,7 @@ namespace frm m_aApproveActionListeners.disposeAndClear( aEvent ); m_aActionListeners.disposeAndClear( aEvent ); m_aSubmissionVetoListeners.disposeAndClear( aEvent ); - m_pFeatureInterception->dispose(); + m_aFeatureInterception.dispose(); { ::osl::MutexGuard aGuard( m_aMutex ); @@ -234,7 +234,7 @@ namespace frm case FormButtonType_SUBMIT: { // if some outer component can provide an interaction handler, use it - Reference< XInteractionHandler > xHandler( m_pFeatureInterception->queryDispatch( "private:/InteractionHandler" ), UNO_QUERY ); + Reference< XInteractionHandler > xHandler( m_aFeatureInterception.queryDispatch( "private:/InteractionHandler" ), UNO_QUERY ); try { implSubmit( rEvt, xHandler ); @@ -292,7 +292,7 @@ namespace frm xSet->getPropertyValue(PROPERTY_DISPATCHURLINTERNAL) >>= bDispatchUrlInternal; if ( bDispatchUrlInternal ) { - m_pFeatureInterception->getTransformer().parseSmartWithProtocol( aURL, INET_FILE_SCHEME ); + m_aFeatureInterception.getTransformer().parseSmartWithProtocol( aURL, INET_FILE_SCHEME ); OUString aTargetFrame; xSet->getPropertyValue(PROPERTY_TARGET_FRAME) >>= aTargetFrame; @@ -308,7 +308,7 @@ namespace frm } else { - URL aHyperLink = m_pFeatureInterception->getTransformer().getStrictURL( ".uno:OpenHyperlink" ); + URL aHyperLink = m_aFeatureInterception.getTransformer().getStrictURL( ".uno:OpenHyperlink" ); Reference< XDispatch > xDisp = Reference< XDispatchProvider > (xFrame,UNO_QUERY_THROW)->queryDispatch(aHyperLink, OUString() , 0); diff --git a/forms/source/component/clickableimage.hxx b/forms/source/component/clickableimage.hxx index 48b511c86a5f..2ec7b921224b 100644 --- a/forms/source/component/clickableimage.hxx +++ b/forms/source/component/clickableimage.hxx @@ -23,6 +23,7 @@ #include <FormComponent.hxx> #include "EventThread.hxx" #include "imgprod.hxx" +#include <controlfeatureinterception.hxx> #include <tools/link.hxx> #include <comphelper/interfacecontainer3.hxx> #include <comphelper/propmultiplex.hxx> @@ -45,7 +46,6 @@ namespace frm class OImageProducerThread_Impl; - class ControlFeatureInterception; // OClickableImageBaseModel @@ -190,8 +190,7 @@ namespace frm rtl::Reference<OImageProducerThread_Impl> m_pThread; ::comphelper::OInterfaceContainerHelper3<css::form::submission::XSubmissionVetoListener> m_aSubmissionVetoListeners; - ::std::unique_ptr< ControlFeatureInterception > - m_pFeatureInterception; + ControlFeatureInterception m_aFeatureInterception; protected: ::comphelper::OInterfaceContainerHelper3<css::form::XApproveActionListener> m_aApproveActionListeners; diff --git a/forms/source/helper/formnavigation.cxx b/forms/source/helper/formnavigation.cxx index a99f29b24f50..be87c063e303 100644 --- a/forms/source/helper/formnavigation.cxx +++ b/forms/source/helper/formnavigation.cxx @@ -43,9 +43,9 @@ namespace frm OFormNavigationHelper::OFormNavigationHelper( const Reference< XComponentContext >& _rxORB ) :m_xORB( _rxORB ) + ,m_aFeatureInterception( m_xORB ) ,m_nConnectedFeatures( 0 ) { - m_pFeatureInterception.reset( new ControlFeatureInterception( m_xORB ) ); } @@ -56,7 +56,7 @@ namespace frm void OFormNavigationHelper::dispose( ) { - m_pFeatureInterception->dispose(); + m_aFeatureInterception.dispose(); disconnectDispatchers(); } @@ -81,14 +81,14 @@ namespace frm void SAL_CALL OFormNavigationHelper::registerDispatchProviderInterceptor( const Reference< XDispatchProviderInterceptor >& _rxInterceptor ) { - m_pFeatureInterception->registerDispatchProviderInterceptor( _rxInterceptor ); + m_aFeatureInterception.registerDispatchProviderInterceptor( _rxInterceptor ); interceptorsChanged(); } void SAL_CALL OFormNavigationHelper::releaseDispatchProviderInterceptor( const Reference< XDispatchProviderInterceptor >& _rxInterceptor ) { - m_pFeatureInterception->releaseDispatchProviderInterceptor( _rxInterceptor ); + m_aFeatureInterception.releaseDispatchProviderInterceptor( _rxInterceptor ); interceptorsChanged(); } @@ -262,7 +262,7 @@ namespace frm Reference< XDispatch > OFormNavigationHelper::queryDispatch( const URL& _rURL ) { - return m_pFeatureInterception->queryDispatch( _rURL ); + return m_aFeatureInterception.queryDispatch( _rURL ); } diff --git a/forms/source/inc/formnavigation.hxx b/forms/source/inc/formnavigation.hxx index e18b99a1bc77..03715d28aba8 100644 --- a/forms/source/inc/formnavigation.hxx +++ b/forms/source/inc/formnavigation.hxx @@ -24,6 +24,7 @@ #include <com/sun/star/uno/XComponentContext.hpp> #include <cppuhelper/implbase2.hxx> #include "featuredispatcher.hxx" +#include "controlfeatureinterception.hxx" #include <vector> #include <map> #include <memory> @@ -34,7 +35,6 @@ namespace frm class UrlTransformer; - class ControlFeatureInterception; //= OFormNavigationHelper @@ -62,8 +62,8 @@ namespace frm private: css::uno::Reference< css::uno::XComponentContext > m_xORB; - ::std::unique_ptr< ControlFeatureInterception > - m_pFeatureInterception; + ControlFeatureInterception + m_aFeatureInterception; // all supported features FeatureMap m_aSupportedFeatures; commit 7f101a514827d0bc57c6626eeed99ecf26658aa9 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Mon Mar 6 15:05:29 2023 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Mon Mar 6 19:57:50 2023 +0000 no need to allocate these separately they are all one or two words in size Change-Id: I09a0392f8d0b067a3a8e4105568b578ef4795c58 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148341 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/lotuswordpro/inc/lwpfoundry.hxx b/lotuswordpro/inc/lwpfoundry.hxx index ebecc4b0d825..df2a71a19c90 100644 --- a/lotuswordpro/inc/lwpfoundry.hxx +++ b/lotuswordpro/inc/lwpfoundry.hxx @@ -70,7 +70,6 @@ #include <unordered_map> #include <memory> - class LwpDocument; class LwpBookMark; @@ -257,12 +256,12 @@ public: LwpObjectID * GetDefaultTextStyle() ; private: std::unique_ptr<LwpStyleManager> m_xStyleMgr; - std::unique_ptr<LwpDropcapMgr> m_xDropcapMgr; + LwpDropcapMgr m_aDropcapMgr; std::unique_ptr<LwpBulletStyleMgr> m_xBulletStyleMgr; public: LwpStyleManager* GetStyleManager() { return m_xStyleMgr.get(); } LwpBookMark* GetBookMark(LwpObjectID objMarker); - LwpDropcapMgr* GetDropcapMgr() { return m_xDropcapMgr.get(); } + LwpDropcapMgr& GetDropcapMgr() { return m_aDropcapMgr; } LwpContent* EnumContents(LwpContent* pContent); LwpSection* EnumSections(LwpSection* pSection); LwpBulletStyleMgr* GetBulletStyleMgr() { return m_xBulletStyleMgr.get(); } diff --git a/lotuswordpro/source/filter/lwpdoc.cxx b/lotuswordpro/source/filter/lwpdoc.cxx index b6955b48978a..a00f29e0c9ce 100644 --- a/lotuswordpro/source/filter/lwpdoc.cxx +++ b/lotuswordpro/source/filter/lwpdoc.cxx @@ -101,7 +101,7 @@ void LwpDocument::Read() LwpUIDocument aUIDoc(m_pObjStrm.get()); } - m_xLnOpts.reset(new LwpLineNumberOptions(m_pObjStrm.get())); + m_oLnOpts.emplace(m_pObjStrm.get()); //Skip LwpUserDictFiles { @@ -350,9 +350,9 @@ void LwpDocument::RegisterGraphicsStyles() */ void LwpDocument::RegisterLinenumberStyles() { - if (!m_xLnOpts) + if (!m_oLnOpts) return; - m_xLnOpts->RegisterStyle(); + m_oLnOpts->RegisterStyle(); } /** diff --git a/lotuswordpro/source/filter/lwpdoc.hxx b/lotuswordpro/source/filter/lwpdoc.hxx index 155e5f85570b..24492dee76e9 100644 --- a/lotuswordpro/source/filter/lwpdoc.hxx +++ b/lotuswordpro/source/filter/lwpdoc.hxx @@ -65,6 +65,7 @@ #include "lwplnopts.hxx" #include "lwpdlvlist.hxx" #include <lwpfoundry.hxx> +#include <optional> class IXFStream; class LwpVirtualLayout; @@ -93,7 +94,7 @@ private: DOC_CHILDDOC = 0x00000800UL }; - std::unique_ptr<LwpLineNumberOptions> m_xLnOpts; + std::optional<LwpLineNumberOptions> m_oLnOpts; LwpObjectID m_DivOpts; LwpObjectID m_FootnoteOpts; diff --git a/lotuswordpro/source/filter/lwpfoundry.cxx b/lotuswordpro/source/filter/lwpfoundry.cxx index 07a5c872a45d..7c6894b7c7c3 100644 --- a/lotuswordpro/source/filter/lwpfoundry.cxx +++ b/lotuswordpro/source/filter/lwpfoundry.cxx @@ -79,7 +79,6 @@ LwpFoundry::LwpFoundry(LwpObjectStream *pStrm, LwpDocument* pDoc) , m_bRegisteredAll(false) { Read(pStrm); - m_xDropcapMgr.reset(new LwpDropcapMgr); m_xBulletStyleMgr.reset(new LwpBulletStyleMgr); m_xBulletStyleMgr->SetFoundry(this); } diff --git a/lotuswordpro/source/filter/lwpfribptr.cxx b/lotuswordpro/source/filter/lwpfribptr.cxx index 01089461d576..746aac854cb7 100644 --- a/lotuswordpro/source/filter/lwpfribptr.cxx +++ b/lotuswordpro/source/filter/lwpfribptr.cxx @@ -270,7 +270,7 @@ void LwpFribPtr::XFConvert() if (pLayout.is() && pLayout->GetTag() == VO_DROPCAPLAYOUT) { LwpFoundry* pFoundry = m_pPara->GetFoundry(); - LwpDropcapMgr* pMgr = pFoundry ? pFoundry->GetDropcapMgr() : nullptr; + LwpDropcapMgr* pMgr = pFoundry ? &pFoundry->GetDropcapMgr() : nullptr; if (pMgr) pMgr->SetXFPara(m_pXFPara.get()); } diff --git a/lotuswordpro/source/filter/lwplayout.cxx b/lotuswordpro/source/filter/lwplayout.cxx index 6405e2277e79..4de86299e369 100644 --- a/lotuswordpro/source/filter/lwplayout.cxx +++ b/lotuswordpro/source/filter/lwplayout.cxx @@ -530,7 +530,6 @@ rtl::Reference<LwpVirtualLayout> LwpHeadLayout::FindEnSuperTableLayout() LwpLayoutStyle::LwpLayoutStyle() : m_nStyleDefinition(0) - , m_pDescription(new LwpAtomHolder) , m_nKey(0) { } @@ -540,7 +539,7 @@ LwpLayoutStyle::~LwpLayoutStyle() {} void LwpLayoutStyle::Read(LwpObjectStream* pStrm) { m_nStyleDefinition = pStrm->QuickReaduInt32(); - m_pDescription->Read(pStrm); + m_aDescription.Read(pStrm); if (pStrm->CheckExtra()) { m_nKey = pStrm->QuickReaduInt16(); diff --git a/lotuswordpro/source/filter/lwplayout.hxx b/lotuswordpro/source/filter/lwplayout.hxx index 3c86921da631..99cd1b922eb4 100644 --- a/lotuswordpro/source/filter/lwplayout.hxx +++ b/lotuswordpro/source/filter/lwplayout.hxx @@ -323,7 +323,7 @@ public: void Read(LwpObjectStream* pStrm); private: sal_uInt32 m_nStyleDefinition; - std::unique_ptr<LwpAtomHolder> m_pDescription; + LwpAtomHolder m_aDescription; sal_uInt16 m_nKey; }; diff --git a/lotuswordpro/source/filter/lwppara.cxx b/lotuswordpro/source/filter/lwppara.cxx index 50a1cd96eab1..f6c9cd5e6bb3 100644 --- a/lotuswordpro/source/filter/lwppara.cxx +++ b/lotuswordpro/source/filter/lwppara.cxx @@ -744,7 +744,7 @@ void LwpPara::ParseDropcapContent() { if (!GetFoundry()) return; - XFParagraph* pDropcap = GetFoundry()->GetDropcapMgr()->GetXFPara(); + XFParagraph* pDropcap = GetFoundry()->GetDropcapMgr().GetXFPara(); if (pDropcap) { m_Fribs.SetXFPara(pDropcap); diff --git a/lotuswordpro/source/filter/lwpsilverbullet.cxx b/lotuswordpro/source/filter/lwpsilverbullet.cxx index 629b5affcfb5..da19ca474e60 100644 --- a/lotuswordpro/source/filter/lwpsilverbullet.cxx +++ b/lotuswordpro/source/filter/lwpsilverbullet.cxx @@ -74,7 +74,6 @@ LwpSilverBullet::LwpSilverBullet(LwpObjectHeader const & objHdr, LwpSvStream* pS : LwpDLNFVList(objHdr, pStrm) , m_nFlags(0) , m_nUseCount(0) - , m_pAtomHolder(new LwpAtomHolder) { memset(m_pHideLevels, 0, sizeof(m_pHideLevels)); } @@ -103,7 +102,7 @@ void LwpSilverBullet::Read() m_nUseCount = m_pObjStrm->QuickReaduInt32(); - m_pAtomHolder->Read(m_pObjStrm.get()); + m_aAtomHolder.Read(m_pObjStrm.get()); } /** diff --git a/lotuswordpro/source/filter/lwpsilverbullet.hxx b/lotuswordpro/source/filter/lwpsilverbullet.hxx index 8c68a960eedc..9482bb6ca010 100644 --- a/lotuswordpro/source/filter/lwpsilverbullet.hxx +++ b/lotuswordpro/source/filter/lwpsilverbullet.hxx @@ -130,7 +130,7 @@ private: LwpObjectID m_aStory; sal_uInt8 m_pResetPositionFlags[MAXNUMBERPOSITIONS]; sal_uInt32 m_nUseCount; - std::unique_ptr<LwpAtomHolder> m_pAtomHolder; + LwpAtomHolder m_aAtomHolder; rtl::Reference<LwpPara> m_xBulletPara; OUString m_strStyleName;