sw/source/core/text/portxt.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
New commits: commit b7b9cfce63879ae9408ef43a34af25617c97904d Author: Noel Grandin <[email protected]> AuthorDate: Mon Mar 10 22:21:30 2025 +0200 Commit: Noel Grandin <[email protected]> CommitDate: Tue Mar 11 09:22:04 2025 +0100 no need to heap allocate here Change-Id: Ib22b861a55c082ec5dcde915e4c6f87135c799cb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182753 Tested-by: Jenkins Reviewed-by: Noel Grandin <[email protected]> diff --git a/sw/source/core/text/portxt.cxx b/sw/source/core/text/portxt.cxx index 72c6012db76d..1d90ab335352 100644 --- a/sw/source/core/text/portxt.cxx +++ b/sw/source/core/text/portxt.cxx @@ -358,7 +358,7 @@ bool SwTextPortion::Format_( SwTextFormatInfo &rInf ) } ExtraShrunkWidth( 0 ); - std::unique_ptr<SwTextGuess> pGuess(new SwTextGuess); + std::optional<SwTextGuess> pGuess(std::in_place); bool bFull = !pGuess->Guess( *this, rInf, Height() ); // tdf#158776 for the last full text portion, call Guess() again to allow more text in the @@ -399,7 +399,7 @@ bool SwTextPortion::Format_( SwTextFormatInfo &rInf ) if ( nSpacesInLine > 0 ) { SwTwips nOldWidth = pGuess->BreakWidth(); - pGuess.reset(new SwTextGuess); + pGuess.emplace(); bFull = !pGuess->Guess( *this, rInf, Height(), nSpacesInLine ); if ( pGuess->BreakWidth() > nOldWidth )
