From f3d1b2e58c39618d99bf017702ef19f373464b34 Mon Sep 17 00:00:00 2001 From: Takeshi Abe Date: Thu, 18 Jan 2018 18:20:12 +0900 Subject: starmath: Make SmParser::Parse() return std::unique_ptr Change-Id: I6c8811f71ab40398043cdcfa3334eee4381b4c7e Reviewed-on: https://gerrit.libreoffice.org/48098 Tested-by: Jenkins Reviewed-by: Takeshi Abe --- starmath/inc/document.hxx | 6 +++--- starmath/inc/parse.hxx | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'starmath/inc') diff --git a/starmath/inc/document.hxx b/starmath/inc/document.hxx index 2d6e63da5f2f..af2ce9475fc3 100644 --- a/starmath/inc/document.hxx +++ b/starmath/inc/document.hxx @@ -89,7 +89,7 @@ class SM_DLLPUBLIC SmDocShell : public SfxObjectShell, public SfxListener SmParser maParser; OUString maAccText; SvtLinguOptions maLinguOptions; - SmTableNode *mpTree; + std::unique_ptr mpTree; SfxItemPool *mpEditEngineItemPool; EditEngine *mpEditEngine; VclPtr mpPrinter; //q.v. comment to SmPrinter Access! @@ -177,8 +177,8 @@ public: void Parse(); SmParser & GetParser() { return maParser; } - const SmTableNode *GetFormulaTree() const { return mpTree; } - void SetFormulaTree(SmTableNode *pTree) { mpTree = pTree; } + const SmTableNode *GetFormulaTree() const { return mpTree.get(); } + void SetFormulaTree(SmTableNode *pTree) { mpTree.reset(pTree); } const std::set< OUString > & GetUsedSymbols() const { return maUsedSymbols; } diff --git a/starmath/inc/parse.hxx b/starmath/inc/parse.hxx index 5c4646e28eb8..a2faa73a3b40 100644 --- a/starmath/inc/parse.hxx +++ b/starmath/inc/parse.hxx @@ -78,7 +78,7 @@ class SmParser inline bool TokenInGroup( TG nGroup ); // grammar - SmTableNode *DoTable(); + std::unique_ptr DoTable(); SmLineNode *DoLine(); std::unique_ptr DoExpression(bool bUseExtraSpaces = true); SmNode *DoRelation(); @@ -114,7 +114,7 @@ public: SmParser(); /** Parse rBuffer to formula tree */ - SmTableNode *Parse(const OUString &rBuffer); + std::unique_ptr Parse(const OUString &rBuffer); /** Parse rBuffer to formula subtree that constitutes an expression */ std::unique_ptr ParseExpression(const OUString &rBuffer); -- cgit