From 7183d259d0d8bf8020da1aa06c963581d2bf779f Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 16 Feb 2023 15:45:59 +0000 Subject: SfxViewFrame* arg of SfxRequest ctor always dereferenced MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit change it to take a reference Change-Id: Ib9349f4c2660d297d93ee81256e7fa9873728ba3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147163 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- sfx2/source/control/request.cxx | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) (limited to 'sfx2/source/control') diff --git a/sfx2/source/control/request.cxx b/sfx2/source/control/request.cxx index 4cfeb629121c..802fc3b34c9e 100644 --- a/sfx2/source/control/request.cxx +++ b/sfx2/source/control/request.cxx @@ -176,13 +176,6 @@ SfxRequest::SfxRequest } -SfxRequest::SfxRequest -( - SfxViewFrame* pViewFrame, - sal_uInt16 nSlotId - -) - /* [Description] With this constructor events can subsequently be recorded that are not run @@ -192,20 +185,21 @@ SfxRequest::SfxRequest parameter. */ -: nSlot(nSlotId), - pImpl( new SfxRequest_Impl(this) ) +SfxRequest::SfxRequest(SfxViewFrame& rViewFrame, sal_uInt16 nSlotId) + : nSlot(nSlotId) + , pImpl(new SfxRequest_Impl(this)) { pImpl->bDone = false; pImpl->bIgnored = false; - pImpl->SetPool( &pViewFrame->GetPool() ); + pImpl->SetPool( &rViewFrame.GetPool() ); pImpl->pShell = nullptr; pImpl->pSlot = nullptr; pImpl->nCallMode = SfxCallMode::SYNCHRON; - pImpl->pViewFrame = pViewFrame; + pImpl->pViewFrame = &rViewFrame; if( pImpl->pViewFrame->GetDispatcher()->GetShellAndSlot_Impl( nSlotId, &pImpl->pShell, &pImpl->pSlot, true, true ) ) { pImpl->SetPool( &pImpl->pShell->GetPool() ); - pImpl->xRecorder = SfxRequest::GetMacroRecorder(*pViewFrame); + pImpl->xRecorder = SfxRequest::GetMacroRecorder(rViewFrame); if (pImpl->xRecorder) pImpl->xTransform = util::URLTransformer::create(comphelper::getProcessComponentContext()); pImpl->aTarget = pImpl->pShell->GetName(); @@ -636,7 +630,7 @@ void SfxRequest::Done_Impl } // Record a Sub-Request - SfxRequest aReq( pImpl->pViewFrame, nSlotId ); + SfxRequest aReq( *pImpl->pViewFrame, nSlotId ); if ( aReq.pImpl->pSlot ) aReq.AppendItem( *pItem ); aReq.Done(); -- cgit