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

Miklos Vajna vmiklos at collabora.co.uk
Mon Oct 30 09:25:58 UTC 2017


 sw/source/core/inc/UndoSplitMove.hxx |   22 ++---
 sw/source/core/undo/unmove.cxx       |  132 +++++++++++++++++------------------
 2 files changed, 77 insertions(+), 77 deletions(-)

New commits:
commit 66eaee557d5d85bb2f4ab243491d639205efa70b
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Mon Oct 30 09:09:08 2017 +0100

    sw: prefix members of SwUndoMove
    
    Change-Id: I2938845f3f454c085c3b159b17fb591869eaeac8
    Reviewed-on: https://gerrit.libreoffice.org/44045
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>

diff --git a/sw/source/core/inc/UndoSplitMove.hxx b/sw/source/core/inc/UndoSplitMove.hxx
index de22f9e62aa3..9119248bb5f5 100644
--- a/sw/source/core/inc/UndoSplitMove.hxx
+++ b/sw/source/core/inc/UndoSplitMove.hxx
@@ -49,16 +49,16 @@ class SwUndoMove : public SwUndo, private SwUndRng, private SwUndoSaveContent
     // nDest.. - destination range of move (after move!)
     // nIns..  - source Position of move (after move!)
     // nMv..   - destination position of move (before move!); for REDO
-    sal_uLong nDestSttNode, nDestEndNode, nInsPosNode, nMvDestNode;
-    sal_Int32 nDestSttContent, nDestEndContent, nInsPosContent, nMvDestContent;
+    sal_uLong m_nDestStartNode, m_nDestEndNode, m_nInsPosNode, m_nMoveDestNode;
+    sal_Int32 m_nDestStartContent, m_nDestEndContent, m_nInsPosContent, m_nMoveDestContent;
 
-    sal_uInt16 nFootnoteStt; // StartPos of Footnotes in History
+    sal_uInt16 m_nFootnoteStart; // StartPos of Footnotes in History
 
-    bool bJoinNext : 1,
-         bJoinPrev : 1,
-         bMoveRange : 1;
+    bool m_bJoinNext : 1,
+         m_bJoinPrev : 1,
+         m_bMoveRange : 1;
 
-    bool bMoveRedlines; // use DOC_MOVEREDLINES when calling SwDoc::Move
+    bool m_bMoveRedlines; // use DOC_MOVEREDLINES when calling SwDoc::Move
 
     void DelFootnote( const SwPaM& );
 
@@ -74,12 +74,12 @@ public:
     void SetDestRange( const SwNodeIndex& rStt, const SwNodeIndex& rEnd,
                         const SwNodeIndex& rInsPos );
 
-    bool IsMoveRange() const        { return bMoveRange; }
+    bool IsMoveRange() const        { return m_bMoveRange; }
     sal_uLong GetEndNode() const        { return nEndNode; }
-    sal_uLong GetDestSttNode() const    { return nDestSttNode; }
-    sal_Int32 GetDestSttContent() const  { return nDestSttContent; }
+    sal_uLong GetDestSttNode() const    { return m_nDestStartNode; }
+    sal_Int32 GetDestSttContent() const  { return m_nDestStartContent; }
 
-    void SetMoveRedlines( bool b )       { bMoveRedlines = b; }
+    void SetMoveRedlines( bool b )       { m_bMoveRedlines = b; }
 };
 
 #endif // INCLUDED_SW_SOURCE_CORE_INC_UNDOSPLITMOVE_HXX
diff --git a/sw/source/core/undo/unmove.cxx b/sw/source/core/undo/unmove.cxx
index e56edaf56415..cc762dd3e31f 100644
--- a/sw/source/core/undo/unmove.cxx
+++ b/sw/source/core/undo/unmove.cxx
@@ -30,18 +30,18 @@
 SwUndoMove::SwUndoMove( const SwPaM& rRange, const SwPosition& rMvPos )
     : SwUndo( SwUndoId::MOVE, rRange.GetDoc() )
     , SwUndRng( rRange )
-    , nDestSttNode(0)
-    , nDestEndNode(0)
-    , nInsPosNode(0)
-    , nMvDestNode(rMvPos.nNode.GetIndex())
-    , nDestSttContent(0)
-    , nDestEndContent(0)
-    , nInsPosContent(0)
-    , nMvDestContent(rMvPos.nContent.GetIndex())
-    , bJoinNext(false)
-    , bJoinPrev(false)
-    , bMoveRange(false)
-    , bMoveRedlines(false)
+    , m_nDestStartNode(0)
+    , m_nDestEndNode(0)
+    , m_nInsPosNode(0)
+    , m_nMoveDestNode(rMvPos.nNode.GetIndex())
+    , m_nDestStartContent(0)
+    , m_nDestEndContent(0)
+    , m_nInsPosContent(0)
+    , m_nMoveDestContent(rMvPos.nContent.GetIndex())
+    , m_bJoinNext(false)
+    , m_bJoinPrev(false)
+    , m_bMoveRange(false)
+    , m_bMoveRedlines(false)
 {
     // get StartNode from footnotes before delete!
     SwDoc* pDoc = rRange.GetDoc();
@@ -76,17 +76,17 @@ SwUndoMove::SwUndoMove( const SwPaM& rRange, const SwPosition& rMvPos )
     pTextNd = rMvPos.nNode.GetNode().GetTextNode();
     if (nullptr != pTextNd)
     {
-        pHistory->Add( pTextNd->GetTextColl(), nMvDestNode, SwNodeType::Text );
+        pHistory->Add( pTextNd->GetTextColl(), m_nMoveDestNode, SwNodeType::Text );
         if ( pTextNd->GetpSwpHints() )
         {
-            pHistory->CopyAttr( pTextNd->GetpSwpHints(), nMvDestNode,
+            pHistory->CopyAttr( pTextNd->GetpSwpHints(), m_nMoveDestNode,
                                 0, pTextNd->GetText().getLength(), false );
         }
         if( pTextNd->HasSwAttrSet() )
-            pHistory->CopyFormatAttr( *pTextNd->GetpSwAttrSet(), nMvDestNode );
+            pHistory->CopyFormatAttr( *pTextNd->GetpSwAttrSet(), m_nMoveDestNode );
     }
 
-    nFootnoteStt = pHistory->Count();
+    m_nFootnoteStart = pHistory->Count();
     DelFootnote( rRange );
 
     if( pHistory && !pHistory->Count() )
@@ -96,19 +96,19 @@ SwUndoMove::SwUndoMove( const SwPaM& rRange, const SwPosition& rMvPos )
 SwUndoMove::SwUndoMove( SwDoc* pDoc, const SwNodeRange& rRg,
                         const SwNodeIndex& rMvPos )
     : SwUndo(SwUndoId::MOVE, pDoc)
-    , nDestSttNode(0)
-    , nDestEndNode(0)
-    , nInsPosNode(0)
-    , nMvDestNode(rMvPos.GetIndex())
-    , nDestSttContent(0)
-    , nDestEndContent(0)
-    , nInsPosContent(0)
-    , bMoveRedlines(false)
+    , m_nDestStartNode(0)
+    , m_nDestEndNode(0)
+    , m_nInsPosNode(0)
+    , m_nMoveDestNode(rMvPos.GetIndex())
+    , m_nDestStartContent(0)
+    , m_nDestEndContent(0)
+    , m_nInsPosContent(0)
+    , m_bMoveRedlines(false)
 {
-    bMoveRange = true;
-    bJoinNext = bJoinPrev = false;
+    m_bMoveRange = true;
+    m_bJoinNext = m_bJoinPrev = false;
 
-    nSttContent = nEndContent = nMvDestContent = COMPLETE_STRING;
+    nSttContent = nEndContent = m_nMoveDestContent = COMPLETE_STRING;
 
     nSttNode = rRg.aStart.GetIndex();
     nEndNode = rRg.aEnd.GetIndex();
@@ -118,7 +118,7 @@ SwUndoMove::SwUndoMove( SwDoc* pDoc, const SwNodeRange& rRg,
 
     // is the current move from ContentArea into the special section?
     sal_uLong nContentStt = pDoc->GetNodes().GetEndOfAutotext().GetIndex();
-    if( nMvDestNode < nContentStt && rRg.aStart.GetIndex() > nContentStt )
+    if( m_nMoveDestNode < nContentStt && rRg.aStart.GetIndex() > nContentStt )
     {
         // delete all footnotes since they are undesired there
         SwPosition aPtPos( rRg.aEnd );
@@ -135,7 +135,7 @@ SwUndoMove::SwUndoMove( SwDoc* pDoc, const SwNodeRange& rRg,
             pHistory.reset();
     }
 
-    nFootnoteStt = 0;
+    m_nFootnoteStart = 0;
 }
 
 void SwUndoMove::SetDestRange( const SwPaM& rRange,
@@ -147,40 +147,40 @@ void SwUndoMove::SetDestRange( const SwPaM& rRange,
                         ? rRange.GetMark()
                         : rRange.GetPoint();
 
-    nDestSttNode    = pStt->nNode.GetIndex();
-    nDestSttContent   = pStt->nContent.GetIndex();
-    nDestEndNode    = pEnd->nNode.GetIndex();
-    nDestEndContent   = pEnd->nContent.GetIndex();
+    m_nDestStartNode    = pStt->nNode.GetIndex();
+    m_nDestStartContent   = pStt->nContent.GetIndex();
+    m_nDestEndNode    = pEnd->nNode.GetIndex();
+    m_nDestEndContent   = pEnd->nContent.GetIndex();
 
-    nInsPosNode     = rInsPos.nNode.GetIndex();
-    nInsPosContent    = rInsPos.nContent.GetIndex();
+    m_nInsPosNode     = rInsPos.nNode.GetIndex();
+    m_nInsPosContent    = rInsPos.nContent.GetIndex();
 
     if( bCorrPam )
     {
-        nDestSttNode--;
-        nDestEndNode--;
+        m_nDestStartNode--;
+        m_nDestEndNode--;
     }
 
-    bJoinNext = nDestSttNode != nDestEndNode &&
+    m_bJoinNext = m_nDestStartNode != m_nDestEndNode &&
                 pStt->nNode.GetNode().GetTextNode() &&
                 pEnd->nNode.GetNode().GetTextNode();
-    bJoinPrev = bJoin;
+    m_bJoinPrev = bJoin;
 }
 
 void SwUndoMove::SetDestRange( const SwNodeIndex& rStt,
                                 const SwNodeIndex& rEnd,
                                 const SwNodeIndex& rInsPos )
 {
-    nDestSttNode = rStt.GetIndex();
-    nDestEndNode = rEnd.GetIndex();
-    if( nDestSttNode > nDestEndNode )
+    m_nDestStartNode = rStt.GetIndex();
+    m_nDestEndNode = rEnd.GetIndex();
+    if( m_nDestStartNode > m_nDestEndNode )
     {
-        nDestSttNode = nDestEndNode;
-        nDestEndNode = rStt.GetIndex();
+        m_nDestStartNode = m_nDestEndNode;
+        m_nDestEndNode = rStt.GetIndex();
     }
-    nInsPosNode  = rInsPos.GetIndex();
+    m_nInsPosNode  = rInsPos.GetIndex();
 
-    nDestSttContent = nDestEndContent = nInsPosContent = COMPLETE_STRING;
+    m_nDestStartContent = m_nDestEndContent = m_nInsPosContent = COMPLETE_STRING;
 }
 
 void SwUndoMove::UndoImpl(::sw::UndoRedoContext & rContext)
@@ -190,14 +190,14 @@ void SwUndoMove::UndoImpl(::sw::UndoRedoContext & rContext)
     // Block so that we can jump out of it
     do {
         // create index position and section based on the existing values
-        SwNodeIndex aIdx( pDoc->GetNodes(), nDestSttNode );
+        SwNodeIndex aIdx( pDoc->GetNodes(), m_nDestStartNode );
 
-        if( bMoveRange )
+        if( m_bMoveRange )
         {
             // only a move with SwRange
             SwNodeRange aRg( aIdx, aIdx );
-            aRg.aEnd = nDestEndNode;
-            aIdx = nInsPosNode;
+            aRg.aEnd = m_nDestEndNode;
+            aIdx = m_nInsPosNode;
             bool bSuccess = pDoc->getIDocumentContentOperations().MoveNodeRange( aRg, aIdx,
                     SwMoveFlags::DEFAULT );
             if (!bSuccess)
@@ -205,17 +205,17 @@ void SwUndoMove::UndoImpl(::sw::UndoRedoContext & rContext)
         }
         else
         {
-            SwPaM aPam( aIdx.GetNode(), nDestSttContent,
-                        *pDoc->GetNodes()[ nDestEndNode ], nDestEndContent );
+            SwPaM aPam( aIdx.GetNode(), m_nDestStartContent,
+                        *pDoc->GetNodes()[ m_nDestEndNode ], m_nDestEndContent );
 
             // #i17764# if redlines are to be moved, we may not remove them
             // before pDoc->Move gets a chance to handle them
-            if( ! bMoveRedlines )
+            if( ! m_bMoveRedlines )
                 RemoveIdxFromRange( aPam, false );
 
-            SwPosition aPos( *pDoc->GetNodes()[ nInsPosNode] );
+            SwPosition aPos( *pDoc->GetNodes()[ m_nInsPosNode] );
             SwContentNode* pCNd = aPos.nNode.GetNode().GetContentNode();
-            aPos.nContent.Assign( pCNd, nInsPosContent );
+            aPos.nContent.Assign( pCNd, m_nInsPosContent );
 
             if( pCNd->HasSwAttrSet() )
                 pCNd->ResetAllAttr();
@@ -224,7 +224,7 @@ void SwUndoMove::UndoImpl(::sw::UndoRedoContext & rContext)
                 static_cast<SwTextNode*>(pCNd)->ClearSwpHintsArr( false );
 
             // first delete all attributes at InsertPos
-            const bool bSuccess = pDoc->getIDocumentContentOperations().MoveRange( aPam, aPos, (bMoveRedlines)
+            const bool bSuccess = pDoc->getIDocumentContentOperations().MoveRange( aPam, aPos, (m_bMoveRedlines)
                         ? SwMoveFlags::REDLINES
                         : SwMoveFlags::DEFAULT );
             if (!bSuccess)
@@ -238,7 +238,7 @@ void SwUndoMove::UndoImpl(::sw::UndoRedoContext & rContext)
         }
 
         SwTextNode* pTextNd = aIdx.GetNode().GetTextNode();
-        if( bJoinNext )
+        if( m_bJoinNext )
         {
             {
                 RemoveIdxRel( aIdx.GetIndex() + 1, SwPosition( aIdx,
@@ -248,7 +248,7 @@ void SwUndoMove::UndoImpl(::sw::UndoRedoContext & rContext)
             pTextNd->JoinNext();
         }
 
-        if( bJoinPrev && pTextNd->CanJoinPrev( &aIdx ) )
+        if( m_bJoinPrev && pTextNd->CanJoinPrev( &aIdx ) )
         {
             // Are there any Pams in the next TextNode?
             pTextNd = aIdx.GetNode().GetTextNode();
@@ -263,14 +263,14 @@ void SwUndoMove::UndoImpl(::sw::UndoRedoContext & rContext)
 
     if( pHistory )
     {
-        if( nFootnoteStt != pHistory->Count() )
-            pHistory->Rollback( pDoc, nFootnoteStt );
+        if( m_nFootnoteStart != pHistory->Count() )
+            pHistory->Rollback( pDoc, m_nFootnoteStart );
         pHistory->TmpRollback( pDoc, 0 );
         pHistory->SetTmpEnd( pHistory->Count() );
     }
 
     // set the cursor onto Undo area
-    if( !bMoveRange )
+    if( !m_bMoveRange )
     {
         AddUndoRedoPaM(rContext);
     }
@@ -282,13 +282,13 @@ void SwUndoMove::RedoImpl(::sw::UndoRedoContext & rContext)
     SwDoc& rDoc = rContext.GetDoc();
 
     SwNodes& rNds = rDoc.GetNodes();
-    SwNodeIndex aIdx( rNds, nMvDestNode );
+    SwNodeIndex aIdx( rNds, m_nMoveDestNode );
 
-    if( bMoveRange )
+    if( m_bMoveRange )
     {
         // only a move with SwRange
         SwNodeRange aRg( rNds, nSttNode, rNds, nEndNode );
-        rDoc.getIDocumentContentOperations().MoveNodeRange( aRg, aIdx, (bMoveRedlines)
+        rDoc.getIDocumentContentOperations().MoveNodeRange( aRg, aIdx, (m_bMoveRedlines)
                 ? SwMoveFlags::REDLINES
                 : SwMoveFlags::DEFAULT );
     }
@@ -297,7 +297,7 @@ void SwUndoMove::RedoImpl(::sw::UndoRedoContext & rContext)
         SwPaM aPam(*rPam.GetPoint());
         SetPaM( aPam );
         SwPosition aMvPos( aIdx, SwIndex( aIdx.GetNode().GetContentNode(),
-                                        nMvDestContent ));
+                                        m_nMoveDestContent ));
 
         DelFootnote( aPam );
         RemoveIdxFromRange( aPam, false );
@@ -333,7 +333,7 @@ void SwUndoMove::DelFootnote( const SwPaM& rRange )
     // is the current move from ContentArea into the special section?
     SwDoc* pDoc = rRange.GetDoc();
     sal_uLong nContentStt = pDoc->GetNodes().GetEndOfAutotext().GetIndex();
-    if( nMvDestNode < nContentStt &&
+    if( m_nMoveDestNode < nContentStt &&
         rRange.GetPoint()->nNode.GetIndex() >= nContentStt )
     {
         // delete all footnotes since they are undesired there


More information about the Libreoffice-commits mailing list