diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-08-10 13:43:56 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-08-14 12:03:26 +0200 |
commit | edc5240a96f003b9aec8f8d2ce92db39ad603fd7 (patch) | |
tree | da0faa62c787e15d7368a5dbf48e723c96652e2c /sw/inc | |
parent | ab0d9af99b2dc69fa8e7463fb33ca28cbccf484d (diff) |
rename SwPaM::GetContentNode to GetPointContentNode/GetMarkContentNode
Using a parameter to select point/mark makes the code much harder to
read
Change-Id: Ic24098a6045ff2262d4c808228ded7bf8206fe8b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138085
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/inc')
-rw-r--r-- | sw/inc/pam.hxx | 6 | ||||
-rw-r--r-- | sw/inc/unocrsrhelper.hxx | 4 |
2 files changed, 4 insertions, 6 deletions
diff --git a/sw/inc/pam.hxx b/sw/inc/pam.hxx index d5d6c74e7031..90b6b8d00e71 100644 --- a/sw/inc/pam.hxx +++ b/sw/inc/pam.hxx @@ -280,10 +280,8 @@ public: SwNode& GetMarkNode() const { return m_pMark->nNode.GetNode(); } /// @return current ContentNode at Point/Mark - SwContentNode* GetContentNode( bool bPoint = true ) const - { - return (bPoint ? m_pPoint->nNode : m_pMark->nNode).GetNode().GetContentNode(); - } + SwContentNode* GetPointContentNode() const { return m_pPoint->nNode.GetNode().GetContentNode(); } + SwContentNode* GetMarkContentNode() const { return m_pMark->nNode.GetNode().GetContentNode(); } /** Normalizes PaM, i.e. sort point and mark. diff --git a/sw/inc/unocrsrhelper.hxx b/sw/inc/unocrsrhelper.hxx index dd9e44b21d96..014421371ba0 100644 --- a/sw/inc/unocrsrhelper.hxx +++ b/sw/inc/unocrsrhelper.hxx @@ -88,8 +88,8 @@ namespace SwUnoCursorHelper inline bool IsStartOfPara(SwPaM& rUnoCursor) { return rUnoCursor.GetPoint()->nContent == 0;} inline bool IsEndOfPara(SwPaM& rUnoCursor) - { return rUnoCursor.GetContentNode() && - rUnoCursor.GetPoint()->nContent == rUnoCursor.GetContentNode()->Len();} + { return rUnoCursor.GetPointContentNode() && + rUnoCursor.GetPoint()->nContent == rUnoCursor.GetPointContentNode()->Len();} void resetCursorPropertyValue(const SfxItemPropertyMapEntry& rEntry, SwPaM& rPam); /// @throws css::lang::IllegalArgumentException |