openoffice-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From o..@apache.org
Subject svn commit: r1574109 - in /openoffice/branches/AOO410: ./ main/ main/sw/source/core/undo/undobj.cxx
Date Tue, 04 Mar 2014 14:27:58 GMT
Author: orw
Date: Tue Mar  4 14:27:58 2014
New Revision: 1574109

URL: http://svn.apache.org/r1574109
Log:
123480: correct the previous made refactoring (revision 1572589)

	cherry-picked from trunk


Modified:
    openoffice/branches/AOO410/   (props changed)
    openoffice/branches/AOO410/main/   (props changed)
    openoffice/branches/AOO410/main/sw/source/core/undo/undobj.cxx

Propchange: openoffice/branches/AOO410/
------------------------------------------------------------------------------
  Merged /openoffice/trunk:r1574101

Propchange: openoffice/branches/AOO410/main/
------------------------------------------------------------------------------
  Merged /openoffice/trunk/main:r1574101

Modified: openoffice/branches/AOO410/main/sw/source/core/undo/undobj.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/AOO410/main/sw/source/core/undo/undobj.cxx?rev=1574109&r1=1574108&r2=1574109&view=diff
==============================================================================
--- openoffice/branches/AOO410/main/sw/source/core/undo/undobj.cxx (original)
+++ openoffice/branches/AOO410/main/sw/source/core/undo/undobj.cxx Tue Mar  4 14:27:58 2014
@@ -54,7 +54,8 @@ public:
         SwComparePosition eCmpPos,
         const SwPosition& rSttPos,
         const SwPosition& rEndPos,
-        SwRedline& rRedl );
+        SwRedline& rRedl,
+        sal_Bool bCopyNext );
 
     ~SwRedlineSaveData();
 
@@ -1000,9 +1001,10 @@ SwRedlineSaveData::SwRedlineSaveData(
     SwComparePosition eCmpPos,
     const SwPosition& rSttPos,
     const SwPosition& rEndPos,
-    SwRedline& rRedl )
+    SwRedline& rRedl,
+    sal_Bool bCopyNext )
     : SwUndRng( rRedl )
-    , SwRedlineData( rRedl.GetRedlineData(), sal_True )
+    , SwRedlineData( rRedl.GetRedlineData(), bCopyNext )
 {
     ASSERT( POS_OUTSIDE == eCmpPos || !rRedl.GetContentIdx(), "Redline mit Content" );
 
@@ -1012,6 +1014,7 @@ SwRedlineSaveData::SwRedlineSaveData(
         nEndNode = rEndPos.nNode.GetIndex();
         nEndCntnt = rEndPos.nContent.GetIndex();
         break;
+
     case POS_OVERLAP_BEHIND: 		// Pos1 ueberlappt Pos2 am Ende
         nSttNode = rSttPos.nNode.GetIndex();
         nSttCntnt = rSttPos.nContent.GetIndex();
@@ -1083,6 +1086,7 @@ void SwRedlineSaveData::RedlineToDoc( Sw
 	rDoc.SetRedlineMode_intern( eOld );
 }
 
+
 sal_Bool SwUndo::FillSaveData(
     const SwPaM& rRange,
     SwRedlineSaveDatas& rSData,
@@ -1103,6 +1107,7 @@ sal_Bool SwUndo::FillSaveData(
     for ( ; n < rTbl.Count(); ++n )
     {
         SwRedline* pRedl = rTbl[n];
+
         const SwComparePosition eCmpPos =
             ComparePosition( *pStt, *pEnd, *pRedl->Start(), *pRedl->End() );
         if ( eCmpPos != POS_BEFORE
@@ -1110,22 +1115,26 @@ sal_Bool SwUndo::FillSaveData(
              && eCmpPos != POS_COLLIDE_END
              && eCmpPos != POS_COLLIDE_START )
         {
-            pNewData = new SwRedlineSaveData( eCmpPos, *pStt, *pEnd, *pRedl );
+            pNewData = new SwRedlineSaveData( eCmpPos, *pStt, *pEnd, *pRedl, bCopyNext );
             rSData.Insert( pNewData, rSData.Count() );
         }
     }
-
     if ( rSData.Count() && bDelRange )
+    {
         rRange.GetDoc()->DeleteRedline( rRange, false, USHRT_MAX );
+    }
     return 0 != rSData.Count();
 }
 
+
 sal_Bool SwUndo::FillSaveDataForFmt(
     const SwPaM& rRange,
     SwRedlineSaveDatas& rSData )
 {
     if ( rSData.Count() )
+    {
         rSData.DeleteAndDestroy( 0, rSData.Count() );
+    }
 
     SwRedlineSaveData* pNewData;
     const SwPosition *pStt = rRange.Start(), *pEnd = rRange.End();
@@ -1137,12 +1146,13 @@ sal_Bool SwUndo::FillSaveDataForFmt(
         SwRedline* pRedl = rTbl[n];
         if ( nsRedlineType_t::REDLINE_FORMAT == pRedl->GetType() )
         {
-            const SwPosition *pRStt = pRedl->Start(), *pREnd = pRedl->End();
-
-            SwComparePosition eCmpPos = ComparePosition( *pStt, *pEnd, *pRStt, *pREnd );
-            if ( POS_BEFORE != eCmpPos && POS_BEHIND != eCmpPos && POS_COLLIDE_END
!= eCmpPos && POS_COLLIDE_START != eCmpPos )
+            const SwComparePosition eCmpPos = ComparePosition( *pStt, *pEnd, *pRedl->Start(),
*pRedl->End() );
+            if ( eCmpPos != POS_BEFORE
+                 && eCmpPos != POS_BEHIND
+                 && eCmpPos != POS_COLLIDE_END
+                 && eCmpPos != POS_COLLIDE_START )
             {
-                pNewData = new SwRedlineSaveData( eCmpPos, *pStt, *pEnd, *pRedl );
+                pNewData = new SwRedlineSaveData( eCmpPos, *pStt, *pEnd, *pRedl, sal_True
);
                 rSData.Insert( pNewData, rSData.Count() );
             }
 
@@ -1151,6 +1161,7 @@ sal_Bool SwUndo::FillSaveDataForFmt(
     return 0 != rSData.Count();
 }
 
+
 void SwUndo::SetSaveData( SwDoc& rDoc, const SwRedlineSaveDatas& rSData )
 {
     RedlineMode_t eOld = rDoc.GetRedlineMode();



Mime
View raw message