diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-04-07 08:47:13 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-04-07 09:42:20 +0200 |
commit | 56d6e458a3faca2479588359651b7601db578c92 (patch) | |
tree | 89280783588a2614c324c67be6065f38619ae481 /starmath | |
parent | a8d26a0bb40c101394ded8061d1b58048153631b (diff) |
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 <noel.grandin@collabora.co.uk>
Diffstat (limited to 'starmath')
-rw-r--r-- | starmath/source/mathmlexport.cxx | 18 |
1 files changed, 7 insertions, 11 deletions
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> |