diff options
author | Takeshi Abe <tabe@fixedpoint.jp> | 2018-01-18 18:20:12 +0900 |
---|---|---|
committer | Takeshi Abe <tabe@fixedpoint.jp> | 2018-01-22 06:26:00 +0100 |
commit | f3d1b2e58c39618d99bf017702ef19f373464b34 (patch) | |
tree | eee2d5e21b1bfe7fde0732e22f47ce02501b7b97 /starmath/inc | |
parent | f1d1eb2c647af7b751b024faef09e01d849aacbb (diff) |
starmath: Make SmParser::Parse() return std::unique_ptr
Change-Id: I6c8811f71ab40398043cdcfa3334eee4381b4c7e
Reviewed-on: https://gerrit.libreoffice.org/48098
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Takeshi Abe <tabe@fixedpoint.jp>
Diffstat (limited to 'starmath/inc')
-rw-r--r-- | starmath/inc/document.hxx | 6 | ||||
-rw-r--r-- | starmath/inc/parse.hxx | 4 |
2 files changed, 5 insertions, 5 deletions
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<SmTableNode> mpTree; SfxItemPool *mpEditEngineItemPool; EditEngine *mpEditEngine; VclPtr<SfxPrinter> 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<SmTableNode> DoTable(); SmLineNode *DoLine(); std::unique_ptr<SmNode> 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<SmTableNode> Parse(const OUString &rBuffer); /** Parse rBuffer to formula subtree that constitutes an expression */ std::unique_ptr<SmNode> ParseExpression(const OUString &rBuffer); |