diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-10-31 11:23:06 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-11-01 07:27:27 +0100 |
commit | cf14352cd8eeb202f0b3a57a14909435818931bb (patch) | |
tree | c166d503839d8c1b41c1b4363cc9c7b1ad8420c5 /sw | |
parent | 6bd9f1f93301756bdc6fa57911d163e9fa5ad313 (diff) |
no need to heap allocate these
Change-Id: I28127f5943a80aca1689d5982cd1f6e6e11eb2c5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175863
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/crsr/viscrs.cxx | 10 | ||||
-rw-r--r-- | sw/source/uibase/dbui/dbmgr.cxx | 4 |
2 files changed, 7 insertions, 7 deletions
diff --git a/sw/source/core/crsr/viscrs.cxx b/sw/source/core/crsr/viscrs.cxx index 25de24892a8d..33894da0440f 100644 --- a/sw/source/core/crsr/viscrs.cxx +++ b/sw/source/core/crsr/viscrs.cxx @@ -659,14 +659,14 @@ void SwSelPaintRects::HighlightContentControl() } if (pCurContentControlAtCursor) { - auto pCursorForContentControl = std::make_unique<SwShellCursor>( + SwShellCursor aCursorForContentControl( *GetShell(), SwPosition(*pTextNode, pCurContentControlAtCursor->GetStart())); - pCursorForContentControl->SetMark(); - pCursorForContentControl->GetMark()->Assign( + aCursorForContentControl.SetMark(); + aCursorForContentControl.GetMark()->Assign( *pTextNode, *(pCurContentControlAtCursor->End())); - pCursorForContentControl->FillRects(); - SwRects* pRects = pCursorForContentControl.get(); + aCursorForContentControl.FillRects(); + SwRects* pRects = &aCursorForContentControl; for (const auto& rRect : *pRects) { tools::Rectangle aRect(rRect.SVRect()); diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx index fd1b7bd1f6db..a651b20b8520 100644 --- a/sw/source/uibase/dbui/dbmgr.cxx +++ b/sw/source/uibase/dbui/dbmgr.cxx @@ -793,10 +793,10 @@ static void lcl_SaveDebugDoc( SfxObjectShell *xTargetDocShell, // aTempFile is not deleted, but that seems to be intentional utl::TempFileNamed aTempFile( basename, true, u".odt", &sTempDirURL ); INetURLObject aTempFileURL( aTempFile.GetURL() ); - auto pDstMed = std::make_unique<SfxMedium>( + SfxMedium aDstMed( aTempFileURL.GetMainURL( INetURLObject::DecodeMechanism::NONE ), StreamMode::STD_READWRITE ); - bool bAnyError = !xTargetDocShell->DoSaveAs( *pDstMed ); + bool bAnyError = !xTargetDocShell->DoSaveAs( aDstMed ); // xObjectShell->DoSaveCompleted crashes the mail merge unit tests, so skip it bAnyError |= (ERRCODE_NONE != xTargetDocShell->GetErrorIgnoreWarning()); if( bAnyError ) |