summaryrefslogtreecommitdiff
path: root/starmath/source/cursor.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-01-17 16:47:29 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-01-18 07:49:38 +0100
commita7fea048dddab17989eaf1097d400aa5bfadf78f (patch)
tree7e09492e0e150a2e650029359ebe44106c9df8bb /starmath/source/cursor.cxx
parenta7ea04397bf8c6749c84fe8f0d9afc80e4cf6bb2 (diff)
use unique_ptr in starmath
Change-Id: Ib9c555507d5271343424686f2321ae13efcbf41a Reviewed-on: https://gerrit.libreoffice.org/66550 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'starmath/source/cursor.cxx')
-rw-r--r--starmath/source/cursor.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/starmath/source/cursor.cxx b/starmath/source/cursor.cxx
index 6b27956cb83f..3b6a61fe6326 100644
--- a/starmath/source/cursor.cxx
+++ b/starmath/source/cursor.cxx
@@ -740,7 +740,7 @@ bool SmCursor::InsertRow() {
//If we're in the context of a table
if(pTable) {
- SmNodeList *pNewLineList = new SmNodeList;
+ std::unique_ptr<SmNodeList> pNewLineList(new SmNodeList);
//Move elements from pLineList to pNewLineList
pNewLineList->splice(pNewLineList->begin(), *pLineList, it, pLineList->end());
//Make sure it is valid again
@@ -750,8 +750,8 @@ bool SmCursor::InsertRow() {
if(pNewLineList->empty())
pNewLineList->push_front(new SmPlaceNode());
//Parse new line
- std::unique_ptr<SmNode> pNewLine(SmNodeListParser().Parse(pNewLineList));
- delete pNewLineList;
+ std::unique_ptr<SmNode> pNewLine(SmNodeListParser().Parse(pNewLineList.get()));
+ pNewLineList.reset();
//Wrap pNewLine in SmLineNode if needed
if(pLineParent->GetType() == SmNodeType::Line) {
std::unique_ptr<SmLineNode> pNewLineNode(new SmLineNode(SmToken(TNEWLINE, '\0', "newline")));