From edc5240a96f003b9aec8f8d2ce92db39ad603fd7 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 10 Aug 2022 13:43:56 +0200 Subject: 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 --- sw/inc/pam.hxx | 6 ++---- sw/inc/unocrsrhelper.hxx | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) (limited to 'sw/inc') 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 -- cgit