sw/inc/ndindex.hxx                                      |  215 +++-------------
 sw/source/core/crsr/swcrsr.cxx                          |   10 
 sw/source/core/doc/DocumentContentOperationsManager.cxx |   12 
 sw/source/core/doc/DocumentRedlineManager.cxx           |    3 
 sw/source/core/doc/docnew.cxx                           |   12 
 sw/source/core/unocore/unotext.cxx                      |    2 
 sw/source/filter/docx/swdocxreader.cxx                  |    2 
 sw/source/filter/xml/XMLRedlineImportHelper.cxx         |    2 
 sw/source/uibase/docvw/UnfloatTableButton.cxx           |    2 
 sw/source/uibase/wrtsh/wrtsh1.cxx                       |    6 
 10 files changed, 75 insertions(+), 191 deletions(-)

New commits:
commit b0b9e755d3b81ad453ebe8f800a1e7c005efc471
Author:     Mike Kaganski <mike.kagan...@collabora.com>
AuthorDate: Sat Mar 11 17:40:37 2023 +0300
Commit:     Mike Kaganski <mike.kagan...@collabora.com>
CommitDate: Sat Mar 11 20:30:10 2023 +0000

    Simplify SwNodeIndex
    
    Change-Id: Ic3bb99d30445c2c355ec8634651bb308d198f714
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148683
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>

diff --git a/sw/inc/ndindex.hxx b/sw/inc/ndindex.hxx
index 98c1357821e7..bbe76f1be706 100644
--- a/sw/inc/ndindex.hxx
+++ b/sw/inc/ndindex.hxx
@@ -31,8 +31,9 @@ class SAL_WARN_UNUSED SW_DLLPUBLIC SwNodeIndex final : public 
sw::Ring<SwNodeInd
 {
     SwNode * m_pNode;
 
-    void RegisterIndex( SwNodes& rNodes )
+    void RegisterIndex()
     {
+        SwNodes& rNodes = GetNodes();
         if(!rNodes.m_vIndices)
         {
 #if defined(__GNUC__) && __GNUC__ == 12
@@ -46,8 +47,9 @@ class SAL_WARN_UNUSED SW_DLLPUBLIC SwNodeIndex final : public 
sw::Ring<SwNodeInd
         }
         MoveTo(rNodes.m_vIndices);
     }
-    void DeRegisterIndex( SwNodes& rNodes )
+    void DeRegisterIndex()
     {
+        SwNodes& rNodes = GetNodes();
         if(rNodes.m_vIndices == this)
             rNodes.m_vIndices = GetNextInRing();
         MoveTo(nullptr);
@@ -55,59 +57,44 @@ class SAL_WARN_UNUSED SW_DLLPUBLIC SwNodeIndex final : 
public sw::Ring<SwNodeInd
             rNodes.m_vIndices = nullptr;
     }
 
+    SwNodeIndex(SwNode* pNode) : m_pNode(pNode) { RegisterIndex(); }
+
 public:
     SwNodeIndex( SwNodes& rNds, sal_Int32 nIdx ) : SwNodeIndex(rNds, 
SwNodeOffset(nIdx)) {}
     explicit SwNodeIndex( SwNodes& rNds, SwNodeOffset nIdx = SwNodeOffset(0) )
-        : m_pNode( rNds[ nIdx ] )
-    {
-        RegisterIndex( rNds );
-    };
+        : SwNodeIndex( rNds[ nIdx ] ) {}
+
     SwNodeIndex( const SwNodeIndex& rIdx, sal_Int32 nDiff ) : 
SwNodeIndex(rIdx, SwNodeOffset(nDiff)) {}
-    SwNodeIndex( const SwNodeIndex& rIdx, SwNodeOffset nDiff )
-        : sw::Ring<SwNodeIndex>()
-    {
-        if( nDiff )
-            m_pNode = rIdx.GetNodes()[ rIdx.GetIndex() + nDiff ];
-        else
-            m_pNode = rIdx.m_pNode;
-        RegisterIndex( m_pNode->GetNodes() );
-    }
-    SwNodeIndex( const SwNodeIndex& rIdx ) : SwNodeIndex(rIdx, 0) {}
+    SwNodeIndex( const SwNodeIndex& rIdx, SwNodeOffset nDiff = SwNodeOffset(0) 
)
+        : SwNodeIndex( nDiff ? rIdx.GetNodes()[ rIdx.GetIndex() + nDiff ] : 
rIdx.m_pNode ) {}
 
     SwNodeIndex( const SwNode& rNd, sal_Int32 nDiff ) : SwNodeIndex(rNd, 
SwNodeOffset(nDiff)) {}
-    explicit SwNodeIndex( const SwNode& rNd, SwNodeOffset nDiff = 
SwNodeOffset(0) )
-    {
-        if( nDiff )
-            m_pNode = rNd.GetNodes()[ rNd.GetIndex() + nDiff ];
-        else
-            m_pNode = const_cast<SwNode*>(&rNd);
-        RegisterIndex( m_pNode->GetNodes() );
-    }
+    explicit SwNodeIndex( const SwNode& rNd )
+        : SwNodeIndex( const_cast<SwNode*>(&rNd) ) {}
+    explicit SwNodeIndex( const SwNode& rNd, SwNodeOffset nDiff )
+        : SwNodeIndex( nDiff ? *rNd.GetNodes()[ rNd.GetIndex() + nDiff ] : rNd 
) {}
 
-    virtual  ~SwNodeIndex() override
-        { DeRegisterIndex( m_pNode->GetNodes() ); }
+    virtual ~SwNodeIndex() override { DeRegisterIndex(); }
 
-    inline SwNodeOffset operator++();
-    inline SwNodeOffset operator--();
-    inline SwNodeOffset operator++(int);
-    inline SwNodeOffset operator--(int);
+    SwNodeIndex& operator++() { return operator+=(SwNodeOffset(1)); }
+    SwNodeIndex& operator--() { return operator-=(SwNodeOffset(1)); }
 
-    inline SwNodeOffset operator+=( SwNodeOffset );
-    inline SwNodeOffset operator-=( SwNodeOffset );
+    SwNodeIndex& operator+=( SwNodeOffset nOffset ) { return 
operator=(GetIndex() + nOffset); }
+    SwNodeIndex& operator-=( SwNodeOffset nOffset ) { return 
operator=(GetIndex() - nOffset); }
 
-    inline bool operator< ( const SwNodeIndex& ) const;
-    inline bool operator<=( const SwNodeIndex& ) const;
-    inline bool operator> ( const SwNodeIndex& ) const;
-    inline bool operator>=( const SwNodeIndex& ) const;
-    inline bool operator==( const SwNodeIndex& ) const;
-    inline bool operator!=( const SwNodeIndex& ) const;
+    bool operator<( const SwNodeIndex& rIndex ) const { return 
operator<(rIndex.GetNode()); }
+    bool operator<=( const SwNodeIndex& rIndex ) const { return 
operator<=(rIndex.GetNode()); }
+    bool operator>( const SwNodeIndex& rIndex ) const { return 
operator>(rIndex.GetNode()); }
+    bool operator>=( const SwNodeIndex& rIndex ) const { return 
operator>=(rIndex.GetNode()); }
+    bool operator==( const SwNodeIndex& rIndex ) const { return 
operator==(rIndex.GetNode()); }
+    bool operator!=( const SwNodeIndex& rIndex ) const { return 
operator!=(rIndex.GetNode()); }
 
-    inline bool operator< ( SwNodeOffset ) const;
-    inline bool operator<=( SwNodeOffset ) const;
-    inline bool operator> ( SwNodeOffset ) const;
-    inline bool operator>=( SwNodeOffset ) const;
-    inline bool operator==( SwNodeOffset ) const;
-    inline bool operator!=( SwNodeOffset ) const;
+    bool operator<( SwNodeOffset nOther ) const { return GetIndex() < nOther; }
+    bool operator<=( SwNodeOffset nOther ) const { return GetIndex() <= 
nOther; }
+    bool operator>( SwNodeOffset nOther ) const { return GetIndex() > nOther; }
+    bool operator>=( SwNodeOffset nOther ) const { return GetIndex() >= 
nOther; }
+    bool operator==( SwNodeOffset nOther ) const { return GetIndex() == 
nOther; }
+    bool operator!=( SwNodeOffset nOther ) const { return GetIndex() != 
nOther; }
 
     bool operator<( const SwNode& rNd ) const { return 
operator<(rNd.GetIndex()); }
     bool operator<=( const SwNode& rNd ) const { return 
operator<=(rNd.GetIndex()); }
@@ -117,20 +104,20 @@ public:
     bool operator!=( const SwNode& rNd ) const { return m_pNode != &rNd; }
 
     inline SwNodeIndex& operator=( SwNodeOffset );
-    inline SwNodeIndex& operator=( const SwNodeIndex& );
+    SwNodeIndex& operator=( const SwNodeIndex& rIdx ) { return 
operator=(*rIdx.m_pNode); }
     inline SwNodeIndex& operator=( const SwNode& );
 
     // Return value of index as SwNodeOffset.
-    inline SwNodeOffset GetIndex() const;
+    SwNodeOffset GetIndex() const { return m_pNode->GetIndex(); }
 
     // Enables assignments without creation of a temporary object.
-    inline SwNodeIndex& Assign( SwNodes const & rNds, SwNodeOffset );
+    SwNodeIndex& Assign( SwNodes const & rNds, SwNodeOffset nIdx ) { return 
operator=(*rNds[nIdx]); }
     SwNodeIndex& Assign( const SwNode& rNd, sal_Int32 nOffset ) { return 
Assign(rNd, SwNodeOffset(nOffset)); }
     inline SwNodeIndex& Assign( const SwNode& rNd, SwNodeOffset nOffset = 
SwNodeOffset(0) );
 
     // Gets pointer on NodesArray.
-    inline const SwNodes& GetNodes() const;
-    inline       SwNodes& GetNodes();
+    const SwNodes& GetNodes() const { return m_pNode->GetNodes(); }
+          SwNodes& GetNodes() { return m_pNode->GetNodes(); }
 
     SwNodeIndex* GetNext() { return GetNextInRing(); }
     SwNode& GetNode() const { return *m_pNode; }
@@ -139,7 +126,7 @@ public:
 inline std::ostream &operator <<(std::ostream& s, const SwNodeIndex& index)
 {
     return s << "SwNodeIndex (node " << sal_Int32(index.GetIndex()) << ")";
-};
+}
 
 // SwRange
 
@@ -150,156 +137,48 @@ public:
     SwNodeIndex aEnd;
 
     SwNodeRange( const SwNodeIndex &rS, const SwNodeIndex &rE )
-        : aStart( rS ), aEnd( rE ) {};
+        : aStart( rS ), aEnd( rE ) {}
     SwNodeRange( const SwNode &rS, const SwNode &rE )
-        : aStart( rS ), aEnd( rE ) {};
-    SwNodeRange( const SwNodeRange &rRange )
-        : aStart( rRange.aStart ), aEnd( rRange.aEnd ) {};
+        : aStart( rS ), aEnd( rE ) {}
+    SwNodeRange( const SwNodeRange &rRange ) = default;
 
     SwNodeRange( SwNodes& rNds, SwNodeOffset nSttIdx, SwNodeOffset nEndIdx = 
SwNodeOffset(0) )
-        : aStart( rNds, nSttIdx ), aEnd( rNds, nEndIdx ) {};
+        : aStart( rNds, nSttIdx ), aEnd( rNds, nEndIdx ) {}
 
     SwNodeRange( const SwNodeIndex& rS, SwNodeOffset nSttDiff, const 
SwNodeIndex& rE, SwNodeOffset nEndDiff = SwNodeOffset(0) )
-        : aStart( rS, nSttDiff ), aEnd( rE, nEndDiff ) {};
+        : aStart( rS, nSttDiff ), aEnd( rE, nEndDiff ) {}
     SwNodeRange( const SwNode& rS, SwNodeOffset nSttDiff, const SwNode& rE, 
SwNodeOffset nEndDiff = SwNodeOffset(0) )
-        : aStart( rS, nSttDiff ), aEnd( rE, nEndDiff ) {};
+        : aStart( rS, nSttDiff ), aEnd( rE, nEndDiff ) {}
 };
 
 // For inlines node.hxx is needed which in turn needs this one.
 // Therefore all inlines accessing m_pNode are implemented here.
 
-inline SwNodeOffset SwNodeIndex::GetIndex() const
-{
-    return m_pNode->GetIndex();
-}
-inline const SwNodes& SwNodeIndex::GetNodes() const
-{
-    return m_pNode->GetNodes();
-}
-inline SwNodes& SwNodeIndex::GetNodes()
-{
-    return m_pNode->GetNodes();
-}
-inline bool SwNodeIndex::operator< ( SwNodeOffset const nOther ) const
-{
-    return m_pNode->GetIndex() < nOther;
-}
-inline bool SwNodeIndex::operator<=( SwNodeOffset const nOther ) const
-{
-    return m_pNode->GetIndex() <= nOther;
-}
-inline bool SwNodeIndex::operator> ( SwNodeOffset const nOther ) const
-{
-    return m_pNode->GetIndex() > nOther;
-}
-inline bool SwNodeIndex::operator>=( SwNodeOffset const nOther ) const
-{
-    return m_pNode->GetIndex() >= nOther;
-}
-inline bool SwNodeIndex::operator==( SwNodeOffset const nOther ) const
-{
-    return m_pNode->GetIndex() == nOther;
-}
-inline bool SwNodeIndex::operator!=( SwNodeOffset const nOther ) const
-{
-    return m_pNode->GetIndex() != nOther;
-}
-inline bool SwNodeIndex::operator<( const SwNodeIndex& rIndex ) const
-{
-    return m_pNode->GetIndex() < rIndex.GetIndex();
-}
-inline bool SwNodeIndex::operator<=( const SwNodeIndex& rIndex ) const
-{
-    return m_pNode->GetIndex() <= rIndex.GetIndex();
-}
-inline bool SwNodeIndex::operator>( const SwNodeIndex& rIndex ) const
-{
-    return m_pNode->GetIndex() > rIndex.GetIndex();
-}
-inline bool SwNodeIndex::operator>=( const SwNodeIndex& rIndex ) const
-{
-    return m_pNode->GetIndex() >= rIndex.GetIndex();
-}
-inline bool SwNodeIndex::operator==( const SwNodeIndex& rIdx ) const
-{
-    return m_pNode == rIdx.m_pNode;
-}
-inline bool SwNodeIndex::operator!=( const SwNodeIndex& rIdx ) const
-{
-    return m_pNode != rIdx.m_pNode;
-}
-
-inline SwNodeOffset SwNodeIndex::operator++()
-{
-    m_pNode = GetNodes()[ m_pNode->GetIndex() + 1 ];
-    return m_pNode->GetIndex();
-}
-inline SwNodeOffset SwNodeIndex::operator--()
-{
-    m_pNode = GetNodes()[ m_pNode->GetIndex() - 1 ];
-    return m_pNode->GetIndex();
-}
-inline SwNodeOffset SwNodeIndex::operator++(int)
-{
-    SwNodeOffset nOldIndex = m_pNode->GetIndex();
-    m_pNode = GetNodes()[ nOldIndex + 1 ];
-    return nOldIndex;
-}
-inline SwNodeOffset SwNodeIndex::operator--(int)
-{
-    SwNodeOffset nOldIndex = m_pNode->GetIndex();
-    m_pNode = GetNodes()[ nOldIndex - 1 ];
-    return nOldIndex;
-}
-
-inline SwNodeOffset SwNodeIndex::operator+=( SwNodeOffset const nOffset )
-{
-    m_pNode = GetNodes()[ m_pNode->GetIndex() + nOffset ];
-    return m_pNode->GetIndex();
-}
-inline SwNodeOffset SwNodeIndex::operator-=( SwNodeOffset const nOffset )
-{
-    m_pNode = GetNodes()[ m_pNode->GetIndex() - nOffset ];
-    return m_pNode->GetIndex();
-}
-
 inline SwNodeIndex& SwNodeIndex::operator=( SwNodeOffset const nNew )
 {
     m_pNode = GetNodes()[ nNew ];
     return *this;
 }
 
-SwNodeIndex& SwNodeIndex::operator=( const SwNodeIndex& rIdx )
-{
-    *this = *(rIdx.m_pNode);
-    return *this;
-}
-
 SwNodeIndex& SwNodeIndex::operator=( const SwNode& rNd )
 {
-    if (&m_pNode->GetNodes() != &rNd.GetNodes())
+    if (&GetNodes() != &rNd.GetNodes())
     {
-        DeRegisterIndex( m_pNode->GetNodes() );
+        DeRegisterIndex();
         m_pNode = const_cast<SwNode*>(&rNd);
-        RegisterIndex( m_pNode->GetNodes() );
+        RegisterIndex();
     }
     else
         m_pNode = const_cast<SwNode*>(&rNd);
     return *this;
 }
 
-SwNodeIndex& SwNodeIndex::Assign( SwNodes const & rNds, SwNodeOffset nIdx )
-{
-    *this = *rNds[ nIdx ];
-    return *this;
-}
-
 SwNodeIndex& SwNodeIndex::Assign( const SwNode& rNd, SwNodeOffset nOffset )
 {
     *this = rNd;
 
     if( nOffset )
-        m_pNode = m_pNode->GetNodes()[ m_pNode->GetIndex() + nOffset ];
+        m_pNode = GetNodes()[ GetIndex() + nOffset ];
 
     return *this;
 }
diff --git a/sw/source/core/crsr/swcrsr.cxx b/sw/source/core/crsr/swcrsr.cxx
index 0c0411b9e51b..2d3ba90b3546 100644
--- a/sw/source/core/crsr/swcrsr.cxx
+++ b/sw/source/core/crsr/swcrsr.cxx
@@ -645,8 +645,11 @@ SetNextCursor:
                 RestoreSavePos();
             return true;
         }
-        else if( pNd->IsTableNode() && aCellStt++ )
+        else if( pNd->IsTableNode() )
+        {
+            ++aCellStt;
             goto GoNextCell;
+        }
 
         bProt = false; // index is now on a content node
         goto SetNextCursor;
@@ -697,8 +700,11 @@ SetPrevCursor:
                 RestoreSavePos();
             return true;
         }
-        else if( pNd->StartOfSectionNode()->IsTableNode() && aCellStt-- )
+        else if( pNd->StartOfSectionNode()->IsTableNode() )
+        {
+            --aCellStt;
             goto GoPrevCell;
+        }
 
         bProt = false; // index is now on a content node
         goto SetPrevCursor;
diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx 
b/sw/source/core/doc/DocumentContentOperationsManager.cxx
index 9881292afb30..39c54d4c5668 100644
--- a/sw/source/core/doc/DocumentContentOperationsManager.cxx
+++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx
@@ -195,7 +195,7 @@ namespace
                 {
                     --rDelCount;
                 }
-                rLastIdx--;
+                --rLastIdx;
             }
         }
     }
@@ -2696,7 +2696,7 @@ void DocumentContentOperationsManager::MoveAndJoin( 
SwPaM& rPaM, SwPosition& rPo
     SwNodeIndex aIdx( rPaM.Start()->GetNode() );
     bool bJoinText = aIdx.GetNode().IsTextNode();
     bool bOneNode = rPaM.GetPoint()->GetNode() == rPaM.GetMark()->GetNode();
-    aIdx--;             // in front of the move area!
+    --aIdx;             // in front of the move area!
 
     bool bRet = MoveRange( rPaM, rPos, SwMoveFlags::DEFAULT );
     if( !bRet || bOneNode )
@@ -5038,7 +5038,7 @@ bool 
DocumentContentOperationsManager::CopyImplImpl(SwPaM& rPam, SwPosition& rPo
                         pEnd->AdjustContent( -nCpyLen );
                 }
 
-                aRg.aStart++;
+                ++aRg.aStart;
 
                 if( bOneNode )
                 {
@@ -5089,13 +5089,13 @@ bool 
DocumentContentOperationsManager::CopyImplImpl(SwPaM& rPam, SwPosition& rPo
 
                 // Correct the area again
                 if( bEndEqualIns )
-                    aRg.aEnd--;
+                    --aRg.aEnd;
                 // The end would also be moved
                 else if( rPos == *pEnd )
                 {
                     rPos.Adjust(SwNodeOffset(-1));
                     rPos.SetContent( nContentEnd );
-                    aRg.aEnd--;
+                    --aRg.aEnd;
                 }
             }
             else if( bCanMoveBack )
@@ -5119,7 +5119,7 @@ bool 
DocumentContentOperationsManager::CopyImplImpl(SwPaM& rPam, SwPosition& rPo
                 pDestTextNd = rDoc.GetNodes().MakeTextNode( aInsPos.GetNode(),
                             
rDoc.getIDocumentStylePoolAccess().GetTextCollFromPool(RES_POOLCOLL_STANDARD));
                 aDestIdx.Assign( pDestTextNd, 0  );
-                aInsPos--;
+                --aInsPos;
 
                 // if we have to insert an extra text node
                 // at the destination, this node will be our new destination
diff --git a/sw/source/core/doc/DocumentRedlineManager.cxx 
b/sw/source/core/doc/DocumentRedlineManager.cxx
index 60ddf9d62151..e3ab6bed2c09 100644
--- a/sw/source/core/doc/DocumentRedlineManager.cxx
+++ b/sw/source/core/doc/DocumentRedlineManager.cxx
@@ -2286,8 +2286,7 @@ DocumentRedlineManager::AppendRedline(SwRangeRedline* 
pNewRedl, bool const bCall
                         // tracked deletion of the text containing such a 
table leaves an
                         // empty table at the place of the table (a problem 
inherited from OOo).
                         pTextNd = nullptr;
-                        while( --aIdx && pDelNd->GetIndex() < aIdx.GetIndex() 
&&
-                                !aIdx.GetNode().IsContentNode() )
+                        while( --aIdx > *pDelNd && 
!aIdx.GetNode().IsContentNode() )
                         {
                             // possible table end
                             if( aIdx.GetNode().IsEndNode() && 
aIdx.GetNode().FindTableNode() )
diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx
index 0a5aedf6a105..c36da0c4f6a7 100644
--- a/sw/source/core/doc/docnew.cxx
+++ b/sw/source/core/doc/docnew.cxx
@@ -1037,15 +1037,15 @@ SwNodeIndex SwDoc::AppendDoc(const SwDoc& rSource, 
sal_uInt16 const nStartPageNu
 #ifdef DBG_UTIL
     SAL_INFO( "sw.docappend", "NodeType 0x" << std::hex << 
static_cast<int>(aSourceIdx.GetNode().GetNodeType())
                               << std::dec << " " << 
aSourceIdx.GetNode().GetIndex() );
-    aSourceIdx++;
+    ++aSourceIdx;
     SAL_INFO( "sw.docappend", "NodeType 0x" << std::hex << 
static_cast<int>(aSourceIdx.GetNode().GetNodeType())
                                             << std::dec << " " << 
aSourceIdx.GetNode().GetIndex() );
     if ( aSourceIdx.GetNode().GetNodeType() != SwNodeType::End ) {
-        aSourceIdx++;
+        ++aSourceIdx;
         SAL_INFO( "sw.docappend", "NodeType 0x" << std::hex << 
static_cast<int>(aSourceIdx.GetNode().GetNodeType()) << std::dec );
-        aSourceIdx--;
+        --aSourceIdx;
     }
-    aSourceIdx--;
+    --aSourceIdx;
     SAL_INFO( "sw.docappend", ".." );
     SAL_INFO( "sw.docappend", "NodeType 0x" << std::hex << 
static_cast<int>(aSourceEndIdx.GetNode().GetNodeType())
                               << std::dec << " " << 
aSourceEndIdx.GetNode().GetIndex() );
@@ -1181,7 +1181,7 @@ SwNodeIndex SwDoc::AppendDoc(const SwDoc& rSource, 
sal_uInt16 const nStartPageNu
         {
             SwNodeIndex aIndexBefore(rInsPos.GetNode());
 
-            aIndexBefore--;
+            --aIndexBefore;
 #ifdef DBG_UTIL
             SAL_INFO( "sw.docappend", "CopyRange In: " << CNTNT_DOC( this ) );
 #endif
@@ -1222,7 +1222,7 @@ SwNodeIndex SwDoc::AppendDoc(const SwDoc& rSource, 
sal_uInt16 const nStartPageNu
 
                 // find the first node allowed to contain a RES_PAGEDESC
                 while (true) {
-                    aFixupIdx++;
+                    ++aFixupIdx;
 
                     SwNode &node = aFixupIdx.GetNode();
                     if ( node.IsTextNode() ) {
diff --git a/sw/source/core/unocore/unotext.cxx 
b/sw/source/core/unocore/unotext.cxx
index a3853fb8c643..c698d2a6042a 100644
--- a/sw/source/core/unocore/unotext.cxx
+++ b/sw/source/core/unocore/unotext.cxx
@@ -1475,7 +1475,7 @@ static bool isGraphicNode(const SwFrameFormat* 
pFrameFormat)
     }
     auto index = *pFrameFormat->GetContent().GetContentIdx();
     // consider the next node -> there is the graphic stored
-    index++;
+    ++index;
     return index.GetNode().IsGrfNode();
 }
 
diff --git a/sw/source/filter/docx/swdocxreader.cxx 
b/sw/source/filter/docx/swdocxreader.cxx
index 028fb973c760..4ceff14ecd44 100644
--- a/sw/source/filter/docx/swdocxreader.cxx
+++ b/sw/source/filter/docx/swdocxreader.cxx
@@ -176,7 +176,7 @@ bool SwDOCXReader::MakeEntries( SwDoc *pD, SwTextBlocks 
&rBlocks )
             }
 
             // Do not copy name
-            aStart++;
+            ++aStart;
 
             // Get content
             SwPaM aPam( aStart );
diff --git a/sw/source/filter/xml/XMLRedlineImportHelper.cxx 
b/sw/source/filter/xml/XMLRedlineImportHelper.cxx
index a78a7e484e1a..931fdf963bc8 100644
--- a/sw/source/filter/xml/XMLRedlineImportHelper.cxx
+++ b/sw/source/filter/xml/XMLRedlineImportHelper.cxx
@@ -118,7 +118,7 @@ void XTextRangeOrNodeIndexPosition::Set( 
Reference<XTextRange> const & rRange )
 void XTextRangeOrNodeIndexPosition::Set( SwNode const & rIndex )
 {
     m_oIndex = rIndex;
-    (*m_oIndex)-- ;   // previous node!!!
+    --(*m_oIndex) ;   // previous node!!!
     m_xRange = nullptr;
 }
 
diff --git a/sw/source/uibase/docvw/UnfloatTableButton.cxx 
b/sw/source/uibase/docvw/UnfloatTableButton.cxx
index 4b2c18f1d500..79443c3adea1 100644
--- a/sw/source/uibase/docvw/UnfloatTableButton.cxx
+++ b/sw/source/uibase/docvw/UnfloatTableButton.cxx
@@ -120,7 +120,7 @@ void UnfloatTableButton::MouseButtonDown(const MouseEvent& 
/*rMEvt*/)
     if (pTextFrame->GetTextNodeFirst() == nullptr)
         return;
 
-    SwNodeIndex aInsertPos((*pTextFrame->GetTextNodeFirst()));
+    SwNodeIndex aInsertPos(*pTextFrame->GetTextNodeFirst());
 
     SwTableNode* pTableNode = pTableFrame->GetTable()->GetTableNode();
     if (pTableNode == nullptr)
diff --git a/sw/source/uibase/wrtsh/wrtsh1.cxx 
b/sw/source/uibase/wrtsh/wrtsh1.cxx
index 1284db4fbb88..8b480bdabb39 100644
--- a/sw/source/uibase/wrtsh/wrtsh1.cxx
+++ b/sw/source/uibase/wrtsh/wrtsh1.cxx
@@ -2497,7 +2497,7 @@ void SwWrtShell::MakeOutlineContentVisible(const size_t 
nPos, bool bMakeVisible,
             pNd->GetContentNode()->DelFrames(nullptr);
         else if (pNd->IsTableNode())
             pNd->GetTableNode()->DelFrames(nullptr);
-        aIdx++;
+        ++aIdx;
     }
 
     if (bMakeVisible) // make outline nodes outline content visible
@@ -2529,7 +2529,7 @@ void SwWrtShell::MakeOutlineContentVisible(const size_t 
nPos, bool bMakeVisible,
                         }
                     }
                 }
-                aIdx++;
+                ++aIdx;
             }
         }
     }
@@ -2651,7 +2651,7 @@ bool SwWrtShell::HasFoldedOutlineContentSelected()
             continue;
         // Return true if any nodes in PaM are folded outline content nodes.
         SwOutlineNodes::size_type nPos;
-        for (SwNodeIndex aIdx = aPointIdx; aIdx <= aMarkIdx; aIdx++)
+        for (SwNodeIndex aIdx = aPointIdx; aIdx <= aMarkIdx; ++aIdx)
         {
             if 
(GetDoc()->GetNodes().GetOutLineNds().Seek_Entry(&(aIdx.GetNode()), &nPos) &&
                     !GetAttrOutlineContentVisible(nPos))

Reply via email to