sw/inc/pam.hxx                   |    2 ++
 sw/source/core/crsr/bookmark.cxx |    6 +++---
 2 files changed, 5 insertions(+), 3 deletions(-)

New commits:
commit 0d479babebbed721b0a3cc0c4ba88ea2cc377e21
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Mon Aug 1 10:39:25 2022 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Tue Aug 2 21:35:31 2022 +0200

    introduce SwPosition::SetMark
    
    as part of the process of hiding the internals of SwPosition
    
    largely done by doing:
    git grep -lF 'nContent.SetMark' | xargs perl -pi -e
        's/\bnContent\.SetMark/SetMark/g'
    
    Change-Id: I7fe558da8fffdd8e56598c3063a1058bd5239977
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137697
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/sw/inc/pam.hxx b/sw/inc/pam.hxx
index 4df18cafb49b..365338e476af 100644
--- a/sw/inc/pam.hxx
+++ b/sw/inc/pam.hxx
@@ -81,6 +81,8 @@ struct SAL_WARN_UNUSED SW_DLLPUBLIC SwPosition
 
 
     sal_Int32 GetContentIndex() const { return nContent.GetIndex(); }
+
+    void SetMark(const sw::mark::IMark* pMark) { nContent.SetMark(pMark); }
 };
 
 SW_DLLPUBLIC std::ostream &operator <<(std::ostream& s, const SwPosition& 
position);
diff --git a/sw/source/core/crsr/bookmark.cxx b/sw/source/core/crsr/bookmark.cxx
index acca29c7e470..3bb2f2eb90e1 100644
--- a/sw/source/core/crsr/bookmark.cxx
+++ b/sw/source/core/crsr/bookmark.cxx
@@ -271,7 +271,7 @@ namespace sw::mark
         : m_pPos1(new SwPosition(*(aPaM.GetPoint())))
         , m_aName(rName)
     {
-        m_pPos1->nContent.SetMark(this);
+        m_pPos1->SetMark(this);
         lcl_FixPosition(*m_pPos1);
         if (aPaM.HasMark() && (*aPaM.GetMark() != *aPaM.GetPoint()))
         {
@@ -294,13 +294,13 @@ namespace sw::mark
     void MarkBase::SetMarkPos(const SwPosition& rNewPos)
     {
         std::make_unique<SwPosition>(rNewPos).swap(m_pPos1);
-        m_pPos1->nContent.SetMark(this);
+        m_pPos1->SetMark(this);
     }
 
     void MarkBase::SetOtherMarkPos(const SwPosition& rNewPos)
     {
         std::make_unique<SwPosition>(rNewPos).swap(m_pPos2);
-        m_pPos2->nContent.SetMark(this);
+        m_pPos2->SetMark(this);
     }
 
     OUString MarkBase::ToString( ) const

Reply via email to