diff options
author | László Németh <nemeth@numbertext.org> | 2020-11-10 17:16:59 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2020-11-11 08:34:48 +0100 |
commit | b0b5812bc6b74369c7909313fcb7fd86c535aea3 (patch) | |
tree | 91bd896f07e39a97611b0f710e7c24e9a5bd99fe | |
parent | 97e9df169c183ce1fb6530e8f3e806036a25bf68 (diff) |
DOCX: fix memory leak of cell formula export
clean-up of commit cf596c43315bb96b5e7256a82256f1ccb8c9c4d0
(tdf#133163 DOCX: export formula cell).
The problem was reported by Miklós Vajna.
Change-Id: Ia636a6ffe8386e58e31e37c0d8afc283e6f2fc4d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105558
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
-rw-r--r-- | sw/source/filter/ww8/wrtw8nds.cxx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx index 5b29f8d07a55..0171c28b27d6 100644 --- a/sw/source/filter/ww8/wrtw8nds.cxx +++ b/sw/source/filter/ww8/wrtw8nds.cxx @@ -2233,7 +2233,7 @@ void MSWordExportBase::OutputTextNode( SwTextNode& rNode ) if ( pBox->IsFormulaOrValueBox() == RES_BOXATR_FORMULA && GetExportFormat() == MSWordExportBase::ExportFormat::DOCX ) { - SwTableBoxFormula* pFormula = pBox->GetFrameFormat()->GetTableBoxFormula().Clone(); + std::unique_ptr<SwTableBoxFormula> pFormula(pBox->GetFrameFormat()->GetTableBoxFormula().Clone()); pFormula->PtrToBoxNm( &pTableNode->GetTable() ); OutputField( nullptr, ww::eEquals, " =" + pFormula->GetFormula(), FieldFlags::Start | FieldFlags::CmdStart | FieldFlags::CmdEnd | FieldFlags::Close ); |