sw/inc/ndarr.hxx                 |    2 +-
 sw/source/core/crsr/pam.cxx      |    4 ++--
 sw/source/core/docnode/nodes.cxx |    8 ++++----
 3 files changed, 7 insertions(+), 7 deletions(-)

New commits:
commit 0182491e5fdfe5fa085d6bed527bb66e8b6fdf39
Author:     Noel Grandin <noelgran...@gmail.com>
AuthorDate: Sat Aug 13 16:00:14 2022 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Sat Aug 13 19:08:28 2022 +0200

    pass SwNode instead of SwNodeIndex to GetSectionLevel
    
    part of the process of hiding the internals of SwPosition
    
    Change-Id: I08f28a918c0d165ef4d143b8121d0aad5771dec0
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138231
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/sw/inc/ndarr.hxx b/sw/inc/ndarr.hxx
index d2a58d988074..b50b98b571b8 100644
--- a/sw/inc/ndarr.hxx
+++ b/sw/inc/ndarr.hxx
@@ -166,7 +166,7 @@ public:
        Implementation in doc.hxx (because one needs to know Doc for it) ! */
     bool IsDocNodes() const;
 
-    static sal_uInt16 GetSectionLevel(const SwNodeIndex &rIndex);
+    static sal_uInt16 GetSectionLevel(const SwNode &rIndex);
     void Delete(const SwNodeIndex &rPos, SwNodeOffset nNodes = 
SwNodeOffset(1));
 
     bool MoveNodes( const SwNodeRange&, SwNodes& rNodes, const SwNodeIndex&,
diff --git a/sw/source/core/crsr/pam.cxx b/sw/source/core/crsr/pam.cxx
index b84973ec7c74..29bfc5a4200f 100644
--- a/sw/source/core/crsr/pam.cxx
+++ b/sw/source/core/crsr/pam.cxx
@@ -1052,7 +1052,7 @@ void GoStartSection( SwPosition * pPos )
 {
     // jump to section's beginning
     SwNodes& rNodes = pPos->GetNodes();
-    sal_uInt16 nLevel = SwNodes::GetSectionLevel( pPos->nNode );
+    sal_uInt16 nLevel = SwNodes::GetSectionLevel( pPos->GetNode() );
     if( pPos->nNode < rNodes.GetEndOfContent().StartOfSectionIndex() )
         nLevel--;
     do { SwNodes::GoStartOfSection( &pPos->nNode ); } while( nLevel-- );
@@ -1073,7 +1073,7 @@ void GoEndSection( SwPosition * pPos )
 {
     // jump to section's beginning/end
     SwNodes& rNodes = pPos->GetNodes();
-    sal_uInt16 nLevel = SwNodes::GetSectionLevel( pPos->nNode );
+    sal_uInt16 nLevel = SwNodes::GetSectionLevel( pPos->GetNode() );
     if( pPos->nNode < rNodes.GetEndOfContent().StartOfSectionIndex() )
         nLevel--;
     do { SwNodes::GoEndOfSection( &pPos->nNode ); } while( nLevel-- );
diff --git a/sw/source/core/docnode/nodes.cxx b/sw/source/core/docnode/nodes.cxx
index 891d2f7017c0..4cda9d0a6a8e 100644
--- a/sw/source/core/docnode/nodes.cxx
+++ b/sw/source/core/docnode/nodes.cxx
@@ -1265,12 +1265,12 @@ void SwNodes::Delete(const SwNodeIndex &rIndex, 
SwNodeOffset nNodes)
  * @param rIdx position of the node
  * @return section level at the given position
  */
-sal_uInt16 SwNodes::GetSectionLevel(const SwNodeIndex &rIdx)
+sal_uInt16 SwNodes::GetSectionLevel(const SwNode &rIdx)
 {
     // special treatment for 1st Node
-    if(rIdx == SwNodeOffset(0)) return 1;
+    if(rIdx.GetIndex() == SwNodeOffset(0)) return 1;
     // no recursion! This calls a SwNode::GetSectionLevel (missing "s")
-    return rIdx.GetNode().GetSectionLevel();
+    return rIdx.GetSectionLevel();
 }
 
 void SwNodes::GoStartOfSection(SwNodeIndex *pIdx)
@@ -1454,7 +1454,7 @@ static bool lcl_HighestLevel( SwNode* pNode, void * pPara 
)
  */
 sal_uInt16 HighestLevel( SwNodes & rNodes, const SwNodeRange & rRange )
 {
-    HighLevel aPara( SwNodes::GetSectionLevel( rRange.aStart ));
+    HighLevel aPara( SwNodes::GetSectionLevel( rRange.aStart.GetNode() ));
     rNodes.ForEach( rRange.aStart, rRange.aEnd, lcl_HighestLevel, &aPara );
     return aPara.nTop;
 

Reply via email to