[Libreoffice-commits] core.git: 2 commits - sw/source

Caolán McNamara caolanm at redhat.com
Wed Oct 19 14:49:56 UTC 2016


 sw/source/core/crsr/swcrsr.cxx                          |    5 ++++-
 sw/source/core/doc/DocumentContentOperationsManager.cxx |    2 +-
 sw/source/core/docnode/ndtbl.cxx                        |    2 +-
 sw/source/core/docnode/node.cxx                         |    2 +-
 sw/source/core/text/frmcrsr.cxx                         |    7 +++----
 sw/source/core/undo/untbl.cxx                           |    2 +-
 sw/source/filter/ww8/ww8par.cxx                         |    2 +-
 7 files changed, 12 insertions(+), 10 deletions(-)

New commits:
commit af84c70c95e99935d2efdb98bc105d2a7852ebda
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Oct 19 15:37:34 2016 +0100

    coverity#1371301 Missing move assignment operator
    
    Change-Id: Ibd6d4b52c24989af6872b4eb3c6c585c1e24a4db

diff --git a/sw/source/core/crsr/swcrsr.cxx b/sw/source/core/crsr/swcrsr.cxx
index 56dc9a0..69de007 100644
--- a/sw/source/core/crsr/swcrsr.cxx
+++ b/sw/source/core/crsr/swcrsr.cxx
@@ -1965,7 +1965,10 @@ bool SwCursor::GoPrevNextCell( bool bNext, sal_uInt16 nCnt )
             (!bNext && !aCellIdx.GetNode().IsEndNode()) )
             return false;
 
-        rPtIdx = bNext ? aCellIdx : SwNodeIndex(*aCellIdx.GetNode().StartOfSectionNode());
+        if (bNext)
+            rPtIdx = aCellIdx;
+        else
+            rPtIdx.Assign(*aCellIdx.GetNode().StartOfSectionNode());
 
         pTableBoxStartNode = rPtIdx.GetNode().FindTableBoxStartNode();
         pTableBox = pTableBoxStartNode->GetTableBox();
diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx
index e051892..b0d05c3 100644
--- a/sw/source/core/docnode/ndtbl.cxx
+++ b/sw/source/core/docnode/ndtbl.cxx
@@ -1420,7 +1420,7 @@ SwTableNode* SwNodes::TextToTable( const SwNodes::TableRanges_t & rTableNodes,
                     aCellNodeIdx.GetNode().m_pStartOfSection = pSttNd;
                     //skip start/end node pairs
                     if( aCellNodeIdx.GetNode().IsStartNode() )
-                        aCellNodeIdx = SwNodeIndex( *aCellNodeIdx.GetNode().EndOfSectionNode() );
+                        aCellNodeIdx.Assign(*aCellNodeIdx.GetNode().EndOfSectionNode());
                 }
 
                 // assign Section to the Box
diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx
index 8ab388c..50c6e18 100644
--- a/sw/source/core/docnode/node.cxx
+++ b/sw/source/core/docnode/node.cxx
@@ -833,7 +833,7 @@ sal_uInt8 SwNode::HasPrevNextLayNode() const
         if( IsValidNextPrevNd( aIdx.GetNode() ))
             nRet |= ND_HAS_PREV_LAYNODE;
         // #i77805# - skip section start and end nodes
-        aIdx = SwNodeIndex( *this, +1 );
+        aIdx.Assign(*this, +1);
         while ( aIdx.GetNode().IsSectionNode() ||
                 ( aIdx.GetNode().IsEndNode() &&
                   aIdx.GetNode().StartOfSectionNode()->IsSectionNode() ) )
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 35320c4..f6add22 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -4569,7 +4569,7 @@ void wwSectionManager::InsertSegments()
                     mrReader.m_rDoc.GetNodes().MakeTextNode(aAnchor,
                     mrReader.m_rDoc.getIDocumentStylePoolAccess().GetTextCollFromPool( RES_POOLCOLL_TEXT ));
 
-                aSectPaM.GetPoint()->nNode = SwNodeIndex(*pTextNd);
+                aSectPaM.GetPoint()->nNode.Assign(*pTextNd);
                 aSectPaM.GetPoint()->nContent.Assign(
                     aSectPaM.GetContentNode(), 0);
             }
commit e8baf2d2f1d3eaa6fadbda0ff3ef798a497bbdec
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Oct 19 15:32:53 2016 +0100

    coverity#1371270 Missing move assignment operator
    
    Change-Id: I9a5656fa3a4d4283a1daec957da9d909390d9eb2

diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx b/sw/source/core/doc/DocumentContentOperationsManager.cxx
index f12fd3b..7cd5c76 100644
--- a/sw/source/core/doc/DocumentContentOperationsManager.cxx
+++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx
@@ -4516,7 +4516,7 @@ bool DocumentContentOperationsManager::CopyImpl( SwPaM& rPam, SwPosition& rPos,
     {
         assert(*pCopyPam->GetPoint() == rPos);
         // the Node rPos points to may be deleted so unregister ...
-        rPos.nContent = SwIndex(nullptr);
+        rPos.nContent.Assign(nullptr, 0);
         lcl_DeleteRedlines(rPam, *pCopyPam);
         rPos = *pCopyPam->GetPoint(); // ... and restore.
     }
diff --git a/sw/source/core/text/frmcrsr.cxx b/sw/source/core/text/frmcrsr.cxx
index d2c4a89..130c710 100644
--- a/sw/source/core/text/frmcrsr.cxx
+++ b/sw/source/core/text/frmcrsr.cxx
@@ -689,7 +689,7 @@ bool SwTextFrame::LeftMargin(SwPaM *pPam) const
             nIndx = 0;
         }
     }
-    pPam->GetPoint()->nContent = SwIndex( pFrame->GetTextNode(), nIndx );
+    pPam->GetPoint()->nContent.Assign(pFrame->GetTextNode(), nIndx);
     SwTextCursor::SetRightMargin( false );
     return true;
 }
@@ -730,7 +730,7 @@ bool SwTextFrame::RightMargin(SwPaM *pPam, bool bAPI) const
                 --nRightMargin;
         }
     }
-    pPam->GetPoint()->nContent = SwIndex( pFrame->GetTextNode(), nRightMargin );
+    pPam->GetPoint()->nContent.Assign(pFrame->GetTextNode(), nRightMargin);
     SwTextCursor::SetRightMargin( !bAPI );
     return true;
 }
@@ -839,8 +839,7 @@ bool SwTextFrame::UnitUp_( SwPaM *pPam, const SwTwips nOffset,
                     nTmpOfst = nStart;
                     aSet.SetRight( true );
                 }
-                pPam->GetPoint()->nContent =
-                      SwIndex( const_cast<SwTextFrame*>(this)->GetTextNode(), nTmpOfst );
+                pPam->GetPoint()->nContent.Assign(const_cast<SwTextFrame*>(this)->GetTextNode(), nTmpOfst);
                 return true;
             }
 
diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx
index 392dae9..c0cf47d 100644
--- a/sw/source/core/undo/untbl.cxx
+++ b/sw/source/core/undo/untbl.cxx
@@ -2769,7 +2769,7 @@ SwUndo* SwUndoTableCpyTable::PrepareRedline( SwDoc* pDoc, const SwTableBox& rBox
             }
         }
         else
-            aInsertEnd.nContent = SwIndex( nullptr );
+            aInsertEnd.nContent.Assign(nullptr, 0);
     }
     // For joined (merged) contents the start of deletion and end of insertion are identical
     // otherwise adjacent nodes.


More information about the Libreoffice-commits mailing list