diff options
author | Takeshi Abe <tabe@fixedpoint.jp> | 2016-05-10 11:51:44 +0900 |
---|---|---|
committer | Takeshi Abe <tabe@fixedpoint.jp> | 2016-05-11 00:58:56 +0000 |
commit | b871a97d35a4160b7403c07bfac10aaa744fbbfd (patch) | |
tree | d61ff39deee957245452aec006a0a30d7de32cac /starmath | |
parent | 750e39302ee9bc7e2583b8efbca79c25c93d0bff (diff) |
starmath: Drop unused non-const variant of GetLeftMost
... resulting in one less const_cast.
Change-Id: I3dad339f25524fc22e7a02b08ee7ec01b341e991
Reviewed-on: https://gerrit.libreoffice.org/24810
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Takeshi Abe <tabe@fixedpoint.jp>
Diffstat (limited to 'starmath')
-rw-r--r-- | starmath/inc/node.hxx | 15 | ||||
-rw-r--r-- | starmath/source/node.cxx | 12 |
2 files changed, 10 insertions, 17 deletions
diff --git a/starmath/inc/node.hxx b/starmath/inc/node.hxx index 48442a2261ea..c6e54198ffb1 100644 --- a/starmath/inc/node.hxx +++ b/starmath/inc/node.hxx @@ -119,11 +119,7 @@ public: return const_cast<SmNode *>(this)->GetSubNode(nIndex); } - virtual SmNode * GetLeftMost(); - const SmNode * GetLeftMost() const - { - return const_cast<SmNode *>(this)->GetLeftMost(); - } + virtual const SmNode * GetLeftMost() const; sal_uInt16 & Flags() { return mnFlags; } sal_uInt16 & Attributes() { return mnAttributes; } @@ -661,8 +657,7 @@ public: { } - using SmNode::GetLeftMost; - virtual SmNode * GetLeftMost() override; + virtual const SmNode * GetLeftMost() const override; virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) override; virtual long GetFormulaBaseline() const override; @@ -859,8 +854,7 @@ public: SetNumSubNodes(3); } - using SmNode::GetLeftMost; - virtual SmNode * GetLeftMost() override; + virtual const SmNode * GetLeftMost() const override; virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) override; void CreateTextFromNode(OUString &rText) override; @@ -1201,8 +1195,7 @@ public: sal_uInt16 GetNumCols() const {return nNumCols;} void SetRowCol(sal_uInt16 nMatrixRows, sal_uInt16 nMatrixCols); - using SmNode::GetLeftMost; - virtual SmNode * GetLeftMost() override; + virtual const SmNode * GetLeftMost() const override; virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) override; void CreateTextFromNode(OUString &rText) override; diff --git a/starmath/source/node.cxx b/starmath/source/node.cxx index 1104196b099f..7f2b04d23268 100644 --- a/starmath/source/node.cxx +++ b/starmath/source/node.cxx @@ -93,12 +93,12 @@ SmNode * SmNode::GetSubNode(sal_uInt16 /*nIndex*/) } -SmNode * SmNode::GetLeftMost() +const SmNode * SmNode::GetLeftMost() const // returns leftmost node of current subtree. //! (this assumes the one with index 0 is always the leftmost subnode //! for the current node). { - SmNode *pNode = GetNumSubNodes() > 0 ? + const SmNode *pNode = GetNumSubNodes() > 0 ? GetSubNode(0) : nullptr; return pNode ? pNode->GetLeftMost() : this; @@ -569,7 +569,7 @@ void SmTableNode::Arrange(OutputDevice &rDev, const SmFormat &rFormat) } } -SmNode * SmTableNode::GetLeftMost() +const SmNode * SmTableNode::GetLeftMost() const { return this; } @@ -660,7 +660,7 @@ void SmExpressionNode::Arrange(OutputDevice &rDev, const SmFormat &rFormat) SmLineNode::Arrange(rDev, rFormat); // copy alignment of leftmost subnode if any - SmNode *pNode = GetLeftMost(); + const SmNode *pNode = GetLeftMost(); if (pNode) SetRectHorAlign(pNode->GetRectHorAlign(), false); } @@ -965,7 +965,7 @@ void SmBinVerNode::CreateTextFromNode(OUString &rText) } -SmNode * SmBinVerNode::GetLeftMost() +const SmNode * SmBinVerNode::GetLeftMost() const { return this; } @@ -2419,7 +2419,7 @@ void SmMatrixNode::SetRowCol(sal_uInt16 nMatrixRows, sal_uInt16 nMatrixCols) } -SmNode * SmMatrixNode::GetLeftMost() +const SmNode * SmMatrixNode::GetLeftMost() const { return this; } |