diff options
Diffstat (limited to 'starmath')
-rw-r--r-- | starmath/source/mathmlexport.cxx | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/starmath/source/mathmlexport.cxx b/starmath/source/mathmlexport.cxx index c9a6ca8637da..41cc8a120a74 100644 --- a/starmath/source/mathmlexport.cxx +++ b/starmath/source/mathmlexport.cxx @@ -612,8 +612,8 @@ void SmXMLExport::ExportBinaryHorizontal(const SmNode *pNode, int nLevel) { TG nGroup = pNode->GetToken().nGroup; - SvXMLElementExport* pRow = new SvXMLElementExport(*this, - XML_NAMESPACE_MATH, XML_MROW, true, true); + std::unique_ptr<SvXMLElementExport> pRow( new SvXMLElementExport(*this, + XML_NAMESPACE_MATH, XML_MROW, true, true) ); // Unfold the binary tree structure as long as the nodes are SmBinHorNode // with the same nGroup. This will reduce the number of nested <mrow> @@ -639,8 +639,6 @@ void SmXMLExport::ExportBinaryHorizontal(const SmNode *pNode, int nLevel) s.push(binNode->Symbol()); s.push(binNode->LeftOperand()); } - - delete pRow; } void SmXMLExport::ExportUnaryHorizontal(const SmNode *pNode, int nLevel) @@ -708,8 +706,8 @@ void SmXMLExport::ExportBinaryDiagonal(const SmNode *pNode, int nLevel) { // widebslash // We can not use <mfrac> to a backslash, so just use <mo>\</mo> - SvXMLElementExport *pRow = new SvXMLElementExport(*this, - XML_NAMESPACE_MATH, XML_MROW, true, true); + std::unique_ptr<SvXMLElementExport> pRow( new SvXMLElementExport(*this, + XML_NAMESPACE_MATH, XML_MROW, true, true) ); ExportNodes(pNode->GetSubNode(0), nLevel); @@ -721,8 +719,6 @@ void SmXMLExport::ExportBinaryDiagonal(const SmNode *pNode, int nLevel) } ExportNodes(pNode->GetSubNode(1), nLevel); - - delete pRow; } } |