sw/source/core/doc/docruby.cxx |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 9940a5dce79fe9dc3e6ff0302c9be8c7d1648f67
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Thu Sep 22 15:31:06 2022 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Thu Sep 22 21:00:37 2022 +0200

    use more SwPosition::AdjustContent
    
    part of the process of hiding the internals of SwPosition
    
    Change-Id: Ieaaeafdbef6cdd715d1d8610cf6094d1bbf08b09
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140434
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/sw/source/core/doc/docruby.cxx b/sw/source/core/doc/docruby.cxx
index c269d5a6290b..07c11097f81c 100644
--- a/sw/source/core/doc/docruby.cxx
+++ b/sw/source/core/doc/docruby.cxx
@@ -153,7 +153,7 @@ void SwDoc::SetRubyList( const SwPaM& rPam, const 
SwRubyList& rList )
                         {
                             getIDocumentContentOperations().InsertString( 
aPam, pEntry->GetText() );
                             aPam.SetMark();
-                            aPam.GetMark()->nContent -= 
pEntry->GetText().getLength();
+                            aPam.GetMark()->AdjustContent( 
-pEntry->GetText().getLength() );
                             getIDocumentContentOperations().InsertPoolItem(
                                 aPam, pEntry->GetRubyAttr(), 
SetAttrMode::DONTEXPAND );
                         }
@@ -213,7 +213,7 @@ bool SwDoc::SelectNextRubyChars( SwPaM& rPam, 
SwRubyListEntry& rEntry )
                     if( !bHasMark && nStart > pAttr->GetStart() )
                     {
                         nStart = pAttr->GetStart();
-                        pPos->nContent = nStart;
+                        pPos->SetContent(nStart);
                     }
                 }
                 break;
@@ -232,7 +232,7 @@ bool SwDoc::SelectNextRubyChars( SwPaM& rPam, 
SwRubyListEntry& rEntry )
         if (nWordStt < nStart && nWordStt >= 0)
         {
             nStart = nWordStt;
-            pPos->nContent = nStart;
+            pPos->SetContent(nStart);
         }
     }
 
@@ -243,13 +243,13 @@ bool SwDoc::SelectNextRubyChars( SwPaM& rPam, 
SwRubyListEntry& rEntry )
     {
         if( pAttr && nStart == pAttr->GetStart() )
         {
-            pPos->nContent = nStart;
+            pPos->SetContent(nStart);
             if( !rPam.HasMark() )
             {
                 rPam.SetMark();
-                pPos->nContent = pAttr->GetAnyEnd();
+                pPos->SetContent(pAttr->GetAnyEnd());
                 if( pPos->GetContentIndex() > nEnd )
-                    pPos->nContent = nEnd;
+                    pPos->SetContent(nEnd);
                 rEntry.SetRubyAttr( pAttr->GetRuby() );
             }
             break;

Reply via email to