diff options
author | Takeshi Abe <tabe@fixedpoint.jp> | 2016-06-30 18:00:05 +0900 |
---|---|---|
committer | Takeshi Abe <tabe@fixedpoint.jp> | 2016-07-01 05:13:54 +0000 |
commit | faddbce32ed863bda4238e54dd11df1b468ccd86 (patch) | |
tree | e51969246d4165369555518a1a420397c80aab8e /starmath/inc | |
parent | 45129b0a204fc2a40b2d071cc6c9f36d027c3242 (diff) |
Make SmStructureNode's ctor initialize the number of sub nodes
This also drops newly unused SetNumSubNodes() as a result.
Change-Id: I9b33cb547eb6883da4b45dc5760144cce8fa14ee
Reviewed-on: https://gerrit.libreoffice.org/26795
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Takeshi Abe <tabe@fixedpoint.jp>
Diffstat (limited to 'starmath/inc')
-rw-r--r-- | starmath/inc/node.hxx | 35 |
1 files changed, 13 insertions, 22 deletions
diff --git a/starmath/inc/node.hxx b/starmath/inc/node.hxx index 72da13b2d50c..c93c978feaa2 100644 --- a/starmath/inc/node.hxx +++ b/starmath/inc/node.hxx @@ -286,8 +286,9 @@ class SmStructureNode : public SmNode SmNodeArray aSubNodes; protected: - SmStructureNode(SmNodeType eNodeType, const SmToken &rNodeToken) - : SmNode(eNodeType, rNodeToken) + SmStructureNode(SmNodeType eNodeType, const SmToken &rNodeToken, size_t nSize = 0) + : SmNode(eNodeType, rNodeToken) + , aSubNodes(nSize) {} public: @@ -296,7 +297,6 @@ public: virtual bool IsVisible() const override; virtual sal_uInt16 GetNumSubNodes() const override; - void SetNumSubNodes(sal_uInt16 nSize) { aSubNodes.resize(nSize); } using SmNode::GetSubNode; virtual SmNode * GetSubNode(sal_uInt16 nIndex) override; @@ -745,9 +745,8 @@ class SmUnHorNode : public SmStructureNode { public: explicit SmUnHorNode(const SmToken &rNodeToken) - : SmStructureNode(NUNHOR, rNodeToken) + : SmStructureNode(NUNHOR, rNodeToken, 2) { - SetNumSubNodes(2); } virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) override; @@ -775,9 +774,8 @@ protected: public: explicit SmRootNode(const SmToken &rNodeToken) - : SmStructureNode(NROOT, rNodeToken) + : SmStructureNode(NROOT, rNodeToken, 3) { - SetNumSubNodes(3); } virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) override; @@ -805,9 +803,8 @@ class SmDynIntegralNode : public SmStructureNode { public: explicit SmDynIntegralNode(const SmToken &rNodeToken) - : SmStructureNode(NDYNINT, rNodeToken) + : SmStructureNode(NDYNINT, rNodeToken, 2) { - SetNumSubNodes(2); } virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) override; @@ -836,9 +833,8 @@ class SmBinHorNode : public SmStructureNode { public: explicit SmBinHorNode(const SmToken &rNodeToken) - : SmStructureNode(NBINHOR, rNodeToken) + : SmStructureNode(NBINHOR, rNodeToken, 3) { - SetNumSubNodes(3); } virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) override; @@ -869,9 +865,8 @@ class SmBinVerNode : public SmStructureNode { public: explicit SmBinVerNode(const SmToken &rNodeToken) - : SmStructureNode(NBINVER, rNodeToken) + : SmStructureNode(NBINVER, rNodeToken, 3) { - SetNumSubNodes(3); } virtual const SmNode * GetLeftMost() const override; @@ -956,9 +951,8 @@ class SmSubSupNode : public SmStructureNode public: explicit SmSubSupNode(const SmToken &rNodeToken) - : SmStructureNode(NSUBSUP, rNodeToken) + : SmStructureNode(NSUBSUP, rNodeToken, 1 + SUBSUP_NUM_ENTRIES) { - SetNumSubNodes(1 + SUBSUP_NUM_ENTRIES); bUseLimits = false; } @@ -1007,9 +1001,8 @@ class SmBraceNode : public SmStructureNode { public: explicit SmBraceNode(const SmToken &rNodeToken) - : SmStructureNode(NBRACE, rNodeToken) + : SmStructureNode(NBRACE, rNodeToken, 3) { - SetNumSubNodes(3); } SmMathSymbolNode* OpeningBrace(); @@ -1083,10 +1076,9 @@ public: }; -inline SmVerticalBraceNode::SmVerticalBraceNode(const SmToken &rNodeToken) : - SmStructureNode(NVERTICAL_BRACE, rNodeToken) +inline SmVerticalBraceNode::SmVerticalBraceNode(const SmToken &rNodeToken) + : SmStructureNode(NVERTICAL_BRACE, rNodeToken, 3) { - SetNumSubNodes(3); } @@ -1104,9 +1096,8 @@ class SmOperNode : public SmStructureNode { public: explicit SmOperNode(const SmToken &rNodeToken) - : SmStructureNode(NOPER, rNodeToken) + : SmStructureNode(NOPER, rNodeToken, 2) { - SetNumSubNodes(2); } SmNode * GetSymbol(); |