[Libreoffice-commits] core.git: starmath/source

Takeshi Abe tabe at fixedpoint.jp
Tue Jun 14 00:39:55 UTC 2016


 starmath/source/node.cxx |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

New commits:
commit 5338ee66e8b5b368f1536121bda621076d83a72b
Author: Takeshi Abe <tabe at fixedpoint.jp>
Date:   Mon Jun 13 16:14:42 2016 +0900

    starmath: SmTableNode has type NTABLE
    
    Change-Id: I406b38f41c694d7b4df4d2bc78e7731eb2ef02e4
    Reviewed-on: https://gerrit.libreoffice.org/26210
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Takeshi Abe <tabe at fixedpoint.jp>

diff --git a/starmath/source/node.cxx b/starmath/source/node.cxx
index 8f7f52c..ed06440 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))
         {


More information about the Libreoffice-commits mailing list