sc/source/ui/docshell/docsh4.cxx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
New commits: commit ad6dd34fd1acef50ee90c582976d1e0702748ca6 Author: Caolán McNamara <[email protected]> AuthorDate: Sun Oct 6 15:43:11 2024 +0100 Commit: Caolán McNamara <[email protected]> CommitDate: Tue Oct 8 13:29:04 2024 +0200 cid#1603632 Big parameter passed by value Change-Id: I570c5357b2d14f1bfcf88fe1f95021f18c6151cc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174682 Tested-by: Caolán McNamara <[email protected]> Reviewed-by: Caolán McNamara <[email protected]> diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx index 7750988bb3e6..9b8a00a3ea4d 100644 --- a/sc/source/ui/docshell/docsh4.cxx +++ b/sc/source/ui/docshell/docsh4.cxx @@ -1963,10 +1963,10 @@ void ScDocShell::ExecutePageStyle( const SfxViewShell& rCaller, if ( pStyleSheet ) { - ScStyleSaveData aOldData; + auto xOldData = std::make_shared<ScStyleSaveData>(); const bool bUndo(m_pDocument->IsUndoEnabled()); if (bUndo) - aOldData.InitFromStyle( pStyleSheet ); + xOldData->InitFromStyle(pStyleSheet); SfxItemSet& rStyleSet = pStyleSheet->GetItemSet(); rStyleSet.MergeRange( XATTR_FILL_FIRST, XATTR_FILL_LAST ); @@ -1977,8 +1977,9 @@ void ScDocShell::ExecutePageStyle( const SfxViewShell& rCaller, auto xRequest = std::make_shared<SfxRequest>(rReq); rReq.Ignore(); // the 'old' request is not relevant any more - pDlg->StartExecuteAsync([this, pDlg, xRequest=std::move(xRequest), pStyleSheet, aOldData, - aOldName, &rStyleSet, nCurTab, &rCaller, bUndo](sal_Int32 nResult) { + pDlg->StartExecuteAsync([this, pDlg, xRequest=std::move(xRequest), pStyleSheet, + xOldData=std::move(xOldData), aOldName, &rStyleSet, + nCurTab, &rCaller, bUndo](sal_Int32 nResult) { if ( nResult == RET_OK ) { const SfxItemSet* pOutSet = pDlg->GetOutputItemSet(); @@ -2010,7 +2011,7 @@ void ScDocShell::ExecutePageStyle( const SfxViewShell& rCaller, { GetUndoManager()->AddUndoAction( std::make_unique<ScUndoModifyStyle>( this, SfxStyleFamily::Page, - aOldData, aNewData ) ); + *xOldData, aNewData ) ); } PageStyleModified( aNewName, false );
