starmath/source/mathmlexport.cxx | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-)
New commits: commit 56d6e458a3faca2479588359651b7601db578c92 Author: Noel Grandin <[email protected]> AuthorDate: Tue Apr 7 08:47:13 2020 +0200 Commit: Noel Grandin <[email protected]> CommitDate: Tue Apr 7 09:42:20 2020 +0200 loplugin:unusedvariableplus in starmath in this situation, convert std::unique_ptr to allocating on stack, saving us a malloc/free operation, which is particularly nice since these classes don't even need any storage. Change-Id: Ic4fd076f5f86b754cef86207fee4abcce3e769ec Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91791 Tested-by: Jenkins Reviewed-by: Noel Grandin <[email protected]> diff --git a/starmath/source/mathmlexport.cxx b/starmath/source/mathmlexport.cxx index 6a8120c605a1..7fc7243d7e19 100644 --- a/starmath/source/mathmlexport.cxx +++ b/starmath/source/mathmlexport.cxx @@ -570,8 +570,7 @@ void SmXMLExport::ExportBinaryHorizontal(const SmNode *pNode, int nLevel) { TG nGroup = pNode->GetToken().nGroup; - std::unique_ptr<SvXMLElementExport> pRow( new SvXMLElementExport(*this, - XML_NAMESPACE_MATH, XML_MROW, true, true) ); + SvXMLElementExport aRow(*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> @@ -664,8 +663,7 @@ void SmXMLExport::ExportBinaryDiagonal(const SmNode *pNode, int nLevel) { // widebslash // We can not use <mfrac> to a backslash, so just use <mo>\</mo> - std::unique_ptr<SvXMLElementExport> pRow( new SvXMLElementExport(*this, - XML_NAMESPACE_MATH, XML_MROW, true, true) ); + SvXMLElementExport aRow(*this, XML_NAMESPACE_MATH, XML_MROW, true, true); ExportNodes(pNode->GetSubNode(0), nLevel); @@ -833,9 +831,8 @@ void SmXMLExport::ExportBlank(const SmNode *pNode) AddAttribute(XML_NAMESPACE_MATH, XML_WIDTH, sStrBuf.getStr()); } - std::unique_ptr<SvXMLElementExport> pText( - new SvXMLElementExport(*this, XML_NAMESPACE_MATH, XML_MSPACE, - true, false)); + SvXMLElementExport aTextExport(*this, XML_NAMESPACE_MATH, XML_MSPACE, + true, false); GetDocHandler()->characters( OUString() ); } @@ -996,9 +993,8 @@ void SmXMLExport::ExportBrace(const SmNode *pNode, int nLevel) // See #fdo 66282. // <mrow> - std::unique_ptr<SvXMLElementExport> pRow( - new SvXMLElementExport(*this, XML_NAMESPACE_MATH, XML_MROW, - true, true)); + SvXMLElementExport aRow(*this, XML_NAMESPACE_MATH, XML_MROW, + true, true); // <mo fence="true"> opening-fence </mo> if (pLeft && (pLeft->GetToken().eType != TNONE)) @@ -1014,7 +1010,7 @@ void SmXMLExport::ExportBrace(const SmNode *pNode, int nLevel) if (nullptr != (pTemp = pNode->GetSubNode(1))) { // <mrow> - SvXMLElementExport aRow(*this, XML_NAMESPACE_MATH, XML_MROW, + SvXMLElementExport aRowExport(*this, XML_NAMESPACE_MATH, XML_MROW, true, true); ExportNodes(pTemp, nLevel+1); // </mrow> _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
