diff options
author | Takeshi Abe <tabe@fixedpoint.jp> | 2016-06-13 16:14:42 +0900 |
---|---|---|
committer | Takeshi Abe <tabe@fixedpoint.jp> | 2016-06-14 00:39:26 +0000 |
commit | 5338ee66e8b5b368f1536121bda621076d83a72b (patch) | |
tree | 9b72ce5eac05d63d6b059ae9f1031b874258985c /starmath | |
parent | a8bd44573b75d1399257d6f5d052611439607189 (diff) |
starmath: SmTableNode has type NTABLE
Change-Id: I406b38f41c694d7b4df4d2bc78e7731eb2ef02e4
Reviewed-on: https://gerrit.libreoffice.org/26210
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Takeshi Abe <tabe@fixedpoint.jp>
Diffstat (limited to 'starmath')
-rw-r--r-- | starmath/source/node.cxx | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/starmath/source/node.cxx b/starmath/source/node.cxx index 8f7f52cdeb71..ed064400e6fe 100644 --- a/starmath/source/node.cxx +++ b/starmath/source/node.cxx @@ -36,6 +36,7 @@ #include <cassert> #include <math.h> +#include <memory> #include <float.h> #include <vector> #include <boost/checked_delete.hpp> @@ -2194,9 +2195,10 @@ void SmTextNode::CreateTextFromNode(OUString &rText) else { SmParser aParseTest; - SmNode *pTable = aParseTest.Parse(GetToken().aText); + std::unique_ptr<SmTableNode> pTable(aParseTest.Parse(GetToken().aText)); + assert(pTable->GetType() == NTABLE); bQuoted=true; - if ( (pTable->GetType() == NTABLE) && (pTable->GetNumSubNodes() == 1) ) + if (pTable->GetNumSubNodes() == 1) { SmNode *pResult = pTable->GetSubNode(0); if ( (pResult->GetType() == NLINE) && @@ -2207,7 +2209,6 @@ void SmTextNode::CreateTextFromNode(OUString &rText) bQuoted=false; } } - delete pTable; if ((GetToken().eType == TIDENT) && (GetFontDesc() == FNT_FUNCTION)) { |