sw/inc/ndarr.hxx                 |    2 ++
 sw/source/core/doc/docedt.cxx    |    2 +-
 sw/source/core/doc/docfmt.cxx    |    4 ++--
 sw/source/core/docnode/nodes.cxx |    6 ++++++
 4 files changed, 11 insertions(+), 3 deletions(-)

New commits:
commit f5eccd1ecf67daace793fb7c856b4429345a9338
Author:     Noel Grandin <noelgran...@gmail.com>
AuthorDate: Thu Aug 25 18:30:40 2022 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Thu Aug 25 20:22:16 2022 +0200

    add version of SwNodes::ForEach that takes SwNode params
    
    instead of SwNodeIndex. Part of the process of hiding the
    internals of SwPosition.
    
    Change-Id: I86f3eed9b614295857eb9219d76f3cd00c48a634
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138840
    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 0dabda23ec9f..8f8cce07a4dd 100644
--- a/sw/inc/ndarr.hxx
+++ b/sw/inc/ndarr.hxx
@@ -145,6 +145,8 @@ public:
         ForEach( SwNodeOffset(0), Count(), fnForEach, pArgs );
     }
     void ForEach( SwNodeOffset nStt, SwNodeOffset nEnd, FnForEach_SwNodes 
fnForEach, void* pArgs );
+    void ForEach( SwNode& rStart, SwNode& rEnd,
+                    FnForEach_SwNodes fnForEach, void* pArgs );
     void ForEach( const SwNodeIndex& rStart, const SwNodeIndex& rEnd,
                     FnForEach_SwNodes fnForEach, void* pArgs );
 
diff --git a/sw/source/core/doc/docedt.cxx b/sw/source/core/doc/docedt.cxx
index b20789b60bc8..2b097eca37cb 100644
--- a/sw/source/core/doc/docedt.cxx
+++ b/sw/source/core/doc/docedt.cxx
@@ -808,7 +808,7 @@ uno::Reference< XHyphenatedWord >  SwDoc::Hyphenate(
 
     SwHyphArgs aHyphArg( pPam, rCursorPos, pPageCnt, pPageSt );
     SwNodeIndex aTmpIdx( pPam->GetMark()->GetNode(), 1 );
-    GetNodes().ForEach( pPam->GetPoint()->nNode, aTmpIdx,
+    GetNodes().ForEach( pPam->GetPoint()->GetNode(), aTmpIdx.GetNode(),
                     lcl_HyphenateNode, &aHyphArg );
     aHyphArg.SetPam( pPam );
     return aHyphArg.GetHyphWord();  // will be set by lcl_HyphenateNode
diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx
index cc53bc815e82..357ca66aeb8d 100644
--- a/sw/source/core/doc/docfmt.cxx
+++ b/sw/source/core/doc/docfmt.cxx
@@ -380,7 +380,7 @@ void SwDoc::ResetAttrs( const SwPaM &rRg,
     }
 
     if( aTmpStt < aTmpEnd )
-        GetNodes().ForEach( pStt->nNode, aTmpEnd, lcl_RstAttr, &aPara );
+        GetNodes().ForEach( pStt->GetNode(), aTmpEnd.GetNode(), lcl_RstAttr, 
&aPara );
     else if( !rRg.HasMark() )
     {
         aPara.bResetAll = false ;
@@ -392,7 +392,7 @@ void SwDoc::ResetAttrs( const SwPaM &rRg,
     {
         if( bAdd )
             ++aTmpEnd;
-        GetNodes().ForEach( pStt->nNode, aTmpEnd, 
sw::DocumentContentOperationsManager::lcl_RstTextAttr, &aPara );
+        GetNodes().ForEach( pStt->GetNode(), aTmpEnd.GetNode(), 
sw::DocumentContentOperationsManager::lcl_RstTextAttr, &aPara );
     }
 
     getIDocumentState().SetModified();
diff --git a/sw/source/core/docnode/nodes.cxx b/sw/source/core/docnode/nodes.cxx
index 93384c28d12a..6a8de7c94ff9 100644
--- a/sw/source/core/docnode/nodes.cxx
+++ b/sw/source/core/docnode/nodes.cxx
@@ -2390,6 +2390,12 @@ void SwNodes::ForEach( const SwNodeIndex& rStart, const 
SwNodeIndex& rEnd,
     ForEach( rStart.GetIndex(), rEnd.GetIndex(), fnForEach, pArgs );
 }
 
+void SwNodes::ForEach( SwNode& rStart, SwNode& rEnd,
+                    FnForEach_SwNodes fnForEach, void* pArgs )
+{
+    ForEach( rStart.GetIndex(), rEnd.GetIndex(), fnForEach, pArgs );
+}
+
 void SwNodes::RemoveNode( SwNodeOffset nDelPos, SwNodeOffset nSz, bool bDel )
 {
 #ifndef NDEBUG

Reply via email to