starmath/source/document.cxx |   40 ++++++++++++++++++++--------------------
 1 file changed, 20 insertions(+), 20 deletions(-)

New commits:
commit 24232da6d44a44678a60a5d260109cff51965d4b
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Wed Aug 20 10:07:44 2025 +0100
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Wed Aug 20 14:41:11 2025 +0200

    cid#1660808 Big parameter passed by value
    
    and
    
    cid#1660812 Big parameter passed by value
    cid#1660820 Big parameter passed by value
    cid#1660823 Big parameter passed by value
    
    Change-Id: I13d0de398089681f3cabd75499f772e75a313541
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189961
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>
    Tested-by: Jenkins

diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx
index 7abf5f4fc97f..7db9176eed19 100644
--- a/starmath/source/document.cxx
+++ b/starmath/source/document.cxx
@@ -887,18 +887,18 @@ void SmDocShell::Execute(SfxRequest& rReq)
             OSL_ENSURE (pDev, "device for font list missing" );
 
             auto pFontTypeDialog = 
std::make_shared<SmFontTypeDialog>(rReq.GetFrameWeld(), pDev);
-            SmFormat aOldFormat  = GetFormat();
-            pFontTypeDialog->ReadFrom( aOldFormat );
-            weld::DialogController::runAsync( pFontTypeDialog, [aOldFormat, 
pFontTypeDialog, this](sal_Int32 nResult) {
+            auto xOldFormat = std::make_shared<SmFormat>(GetFormat());
+            pFontTypeDialog->ReadFrom(*xOldFormat);
+            weld::DialogController::runAsync( pFontTypeDialog, 
[xOldFormat=std::move(xOldFormat), pFontTypeDialog, this](sal_Int32 nResult) {
                 if (nResult == RET_OK)
                 {
-                    SmFormat aNewFormat( aOldFormat );
+                    SmFormat aNewFormat(*xOldFormat);
                     pFontTypeDialog->WriteTo(aNewFormat);
 
                     SfxUndoManager *pTmpUndoMgr = GetUndoManager();
                     if (pTmpUndoMgr)
                         pTmpUndoMgr->AddUndoAction(
-                            std::make_unique<SmFormatAction>(this, aOldFormat, 
aNewFormat));
+                            std::make_unique<SmFormatAction>(this, 
*xOldFormat, aNewFormat));
 
                     SetFormat( aNewFormat );
                     Repaint();
@@ -910,18 +910,18 @@ void SmDocShell::Execute(SfxRequest& rReq)
         case SID_FONTSIZE:
         {
             auto pFontSizeDialog = 
std::make_shared<SmFontSizeDialog>(rReq.GetFrameWeld());
-            SmFormat aOldFormat  = GetFormat();
-            pFontSizeDialog->ReadFrom( aOldFormat );
-            weld::DialogController::runAsync(pFontSizeDialog, [aOldFormat, 
pFontSizeDialog, this](sal_Int32 nResult) {
+            auto xOldFormat = std::make_shared<SmFormat>(GetFormat());
+            pFontSizeDialog->ReadFrom(*xOldFormat);
+            weld::DialogController::runAsync(pFontSizeDialog, 
[xOldFormat=std::move(xOldFormat), pFontSizeDialog, this](sal_Int32 nResult) {
                 if (nResult == RET_OK)
                 {
-                    SmFormat aNewFormat( aOldFormat );
+                    SmFormat aNewFormat(*xOldFormat);
                     pFontSizeDialog->WriteTo(aNewFormat);
 
                     SfxUndoManager *pTmpUndoMgr = GetUndoManager();
                     if (pTmpUndoMgr)
                         pTmpUndoMgr->AddUndoAction(
-                            std::make_unique<SmFormatAction>(this, aOldFormat, 
aNewFormat));
+                            std::make_unique<SmFormatAction>(this, 
*xOldFormat, aNewFormat));
 
                     SetFormat( aNewFormat );
                     Repaint();
@@ -933,18 +933,18 @@ void SmDocShell::Execute(SfxRequest& rReq)
         case SID_DISTANCE:
         {
             auto pDistanceDialog = 
std::make_shared<SmDistanceDialog>(rReq.GetFrameWeld());
-            SmFormat aOldFormat  = GetFormat();
-            pDistanceDialog->ReadFrom( aOldFormat );
-            weld::DialogController::runAsync(pDistanceDialog, [aOldFormat, 
pDistanceDialog, this](sal_Int32 nResult) {
+            auto xOldFormat = std::make_shared<SmFormat>(GetFormat());
+            pDistanceDialog->ReadFrom(*xOldFormat);
+            weld::DialogController::runAsync(pDistanceDialog, 
[xOldFormat=std::move(xOldFormat), pDistanceDialog, this](sal_Int32 nResult) {
                 if (nResult == RET_OK)
                 {
-                    SmFormat aNewFormat( aOldFormat );
+                    SmFormat aNewFormat(*xOldFormat);
                     pDistanceDialog->WriteTo(aNewFormat);
 
                     SfxUndoManager *pTmpUndoMgr = GetUndoManager();
                     if (pTmpUndoMgr)
                         pTmpUndoMgr->AddUndoAction(
-                            std::make_unique<SmFormatAction>(this, aOldFormat, 
aNewFormat));
+                            std::make_unique<SmFormatAction>(this, 
*xOldFormat, aNewFormat));
 
                     SetFormat( aNewFormat );
                     Repaint();
@@ -956,12 +956,12 @@ void SmDocShell::Execute(SfxRequest& rReq)
         case SID_ALIGN:
         {
             auto pAlignDialog = 
std::make_shared<SmAlignDialog>(rReq.GetFrameWeld());
-            SmFormat aOldFormat  = GetFormat();
-            pAlignDialog->ReadFrom( aOldFormat );
-            weld::DialogController::runAsync(pAlignDialog, [aOldFormat, 
pAlignDialog, this](sal_Int32 nResult) {
+            auto xOldFormat = std::make_shared<SmFormat>(GetFormat());
+            pAlignDialog->ReadFrom(*xOldFormat);
+            weld::DialogController::runAsync(pAlignDialog, 
[xOldFormat=std::move(xOldFormat), pAlignDialog, this](sal_Int32 nResult) {
                 if (nResult == RET_OK)
                 {
-                    SmFormat aNewFormat( aOldFormat );
+                    SmFormat aNewFormat(*xOldFormat);
                     pAlignDialog->WriteTo(aNewFormat);
 
                     auto* config = SmModule::get()->GetConfig();
@@ -972,7 +972,7 @@ void SmDocShell::Execute(SfxRequest& rReq)
                     SfxUndoManager *pTmpUndoMgr = GetUndoManager();
                     if (pTmpUndoMgr)
                         pTmpUndoMgr->AddUndoAction(
-                            std::make_unique<SmFormatAction>(this, aOldFormat, 
aNewFormat));
+                            std::make_unique<SmFormatAction>(this, 
*xOldFormat, aNewFormat));
 
                     SetFormat( aNewFormat );
                     Repaint();

Reply via email to