diff options
author | Caolán McNamara <caolan.mcnamara@collabora.com> | 2024-10-06 15:43:11 +0100 |
---|---|---|
committer | Caolán McNamara <caolan.mcnamara@collabora.com> | 2024-10-08 13:29:04 +0200 |
commit | ad6dd34fd1acef50ee90c582976d1e0702748ca6 (patch) | |
tree | 14707243208b59940887f70a66ab7faffcdec859 /sc/source/ui/docshell | |
parent | 393fec98820534613a351c17f7eb410045eaeb4f (diff) |
cid#1603632 Big parameter passed by value
Change-Id: I570c5357b2d14f1bfcf88fe1f95021f18c6151cc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174682
Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'sc/source/ui/docshell')
-rw-r--r-- | sc/source/ui/docshell/docsh4.cxx | 11 |
1 files changed, 6 insertions, 5 deletions
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 ); |