sc/source/ui/view/formatsh.cxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
New commits: commit 8072f1d1f5bb9d6f275c4458e20848bca1890833 Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Sun Aug 17 11:30:45 2025 +0100 Commit: Miklos Vajna <vmik...@collabora.com> CommitDate: Mon Aug 18 11:04:06 2025 +0200 cid#1664821 Resource leak Change-Id: Id9b071d63a3245501bc3c5501279d290a44ea936 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189819 Reviewed-by: Miklos Vajna <vmik...@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx index 8207a9e2b0e7..3dc87a41ff8a 100644 --- a/sc/source/ui/view/formatsh.cxx +++ b/sc/source/ui/view/formatsh.cxx @@ -1065,7 +1065,8 @@ void ScFormatShell::ExecuteAttr( SfxRequest& rReq ) case SID_FRAME_LINESTYLE: { // Update default line - const ::editeng::SvxBorderLine* pLine = new ::editeng::SvxBorderLine(); + ::editeng::SvxBorderLine aLine; + const ::editeng::SvxBorderLine* pLine = nullptr; const SfxInt16Item* lineStyleItem = rReq.GetArg<SfxInt16Item>(FN_PARAM_1); if (lineStyleItem) @@ -1084,8 +1085,10 @@ void ScFormatShell::ExecuteAttr( SfxRequest& rReq ) OuterLineWidth = OuterLineWidthItem ? OuterLineWidthItem->GetValue() : 0; LineDistance = LineDistanceItem ? LineDistanceItem->GetValue() : 0; - const_cast<::editeng::SvxBorderLine*>(pLine)->GuessLinesWidths( + aLine.GuessLinesWidths( lineStyle, InnerLineWidth, OuterLineWidth, LineDistance); + + pLine = &aLine; } else {