LCOV - code coverage report
Current view: top level - sw/source/core/undo - unredln.cxx (source / functions) Hit Total Coverage
Test: commit 10e77ab3ff6f4314137acd6e2702a6e5c1ce1fae Lines: 16 269 5.9 %
Date: 2014-11-03 Functions: 6 34 17.6 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2             : /*
       3             :  * This file is part of the LibreOffice project.
       4             :  *
       5             :  * This Source Code Form is subject to the terms of the Mozilla Public
       6             :  * License, v. 2.0. If a copy of the MPL was not distributed with this
       7             :  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
       8             :  *
       9             :  * This file incorporates work covered by the following license notice:
      10             :  *
      11             :  *   Licensed to the Apache Software Foundation (ASF) under one or more
      12             :  *   contributor license agreements. See the NOTICE file distributed
      13             :  *   with this work for additional information regarding copyright
      14             :  *   ownership. The ASF licenses this file to you under the Apache
      15             :  *   License, Version 2.0 (the "License"); you may not use this file
      16             :  *   except in compliance with the License. You may obtain a copy of
      17             :  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
      18             :  */
      19             : 
      20             : #include <UndoRedline.hxx>
      21             : #include <hintids.hxx>
      22             : #include <unotools/charclass.hxx>
      23             : #include <doc.hxx>
      24             : #include <IDocumentRedlineAccess.hxx>
      25             : #include <swundo.hxx>
      26             : #include <pam.hxx>
      27             : #include <ndtxt.hxx>
      28             : #include <UndoCore.hxx>
      29             : #include <UndoDelete.hxx>
      30             : #include <rolbck.hxx>
      31             : #include <redline.hxx>
      32             : #include <docary.hxx>
      33             : #include <sortopt.hxx>
      34             : #include <docedt.hxx>
      35             : 
      36          14 : SwUndoRedline::SwUndoRedline( SwUndoId nUsrId, const SwPaM& rRange )
      37             :     : SwUndo( UNDO_REDLINE ), SwUndRng( rRange ),
      38             :     mpRedlData( 0 ), mpRedlSaveData( 0 ), mnUserId( nUsrId ),
      39          14 :     mbHiddenRedlines( false )
      40             : {
      41             :     // consider Redline
      42          14 :     SwDoc& rDoc = *rRange.GetDoc();
      43          14 :     if( rDoc.getIDocumentRedlineAccess().IsRedlineOn() )
      44             :     {
      45           0 :         switch( mnUserId )
      46             :         {
      47             :         case UNDO_DELETE:
      48             :         case UNDO_REPLACE:
      49           0 :             mpRedlData = new SwRedlineData( nsRedlineType_t::REDLINE_DELETE, rDoc.getIDocumentRedlineAccess().GetRedlineAuthor() );
      50           0 :             break;
      51             :         default:
      52             :             ;
      53             :         }
      54           0 :         SetRedlineMode( rDoc.getIDocumentRedlineAccess().GetRedlineMode() );
      55             :     }
      56             : 
      57          14 :     sal_uLong nEndExtra = rDoc.GetNodes().GetEndOfExtras().GetIndex();
      58             : 
      59          14 :     mpRedlSaveData = new SwRedlineSaveDatas;
      60          14 :     if( !FillSaveData( rRange, *mpRedlSaveData, false, UNDO_REJECT_REDLINE != mnUserId ))
      61          14 :         delete mpRedlSaveData, mpRedlSaveData = 0;
      62             :     else
      63             :     {
      64           0 :         mbHiddenRedlines = HasHiddenRedlines( *mpRedlSaveData );
      65           0 :         if( mbHiddenRedlines )           // then the NodeIndices of SwUndRng need to be corrected
      66             :         {
      67           0 :             nEndExtra -= rDoc.GetNodes().GetEndOfExtras().GetIndex();
      68           0 :             nSttNode -= nEndExtra;
      69           0 :             nEndNode -= nEndExtra;
      70             :         }
      71             :     }
      72          14 : }
      73             : 
      74          42 : SwUndoRedline::~SwUndoRedline()
      75             : {
      76          14 :     delete mpRedlData;
      77          14 :     delete mpRedlSaveData;
      78          28 : }
      79             : 
      80          14 : sal_uInt16 SwUndoRedline::GetRedlSaveCount() const
      81             : {
      82          14 :     return mpRedlSaveData ? mpRedlSaveData->size() : 0;
      83             : }
      84             : 
      85           0 : void SwUndoRedline::UndoImpl(::sw::UndoRedoContext & rContext)
      86             : {
      87           0 :     SwDoc *const pDoc = & rContext.GetDoc();
      88           0 :     SwPaM & rPam( AddUndoRedoPaM(rContext) );
      89             : 
      90           0 :     UndoRedlineImpl(*pDoc, rPam);
      91             : 
      92           0 :     if( mpRedlSaveData )
      93             :     {
      94           0 :         sal_uLong nEndExtra = pDoc->GetNodes().GetEndOfExtras().GetIndex();
      95           0 :         SetSaveData( *pDoc, *mpRedlSaveData );
      96           0 :         if( mbHiddenRedlines )
      97             :         {
      98           0 :             mpRedlSaveData->clear();
      99             : 
     100           0 :             nEndExtra = pDoc->GetNodes().GetEndOfExtras().GetIndex() - nEndExtra;
     101           0 :             nSttNode += nEndExtra;
     102           0 :             nEndNode += nEndExtra;
     103             :         }
     104           0 :         SetPaM(rPam, true);
     105             :     }
     106           0 : }
     107             : 
     108           0 : void SwUndoRedline::RedoImpl(::sw::UndoRedoContext & rContext)
     109             : {
     110           0 :     SwDoc *const pDoc = & rContext.GetDoc();
     111           0 :     RedlineMode_t eOld = pDoc->getIDocumentRedlineAccess().GetRedlineMode();
     112           0 :     pDoc->getIDocumentRedlineAccess().SetRedlineMode_intern((RedlineMode_t)(( eOld & ~nsRedlineMode_t::REDLINE_IGNORE) | nsRedlineMode_t::REDLINE_ON ));
     113             : 
     114           0 :     SwPaM & rPam( AddUndoRedoPaM(rContext) );
     115           0 :     if( mpRedlSaveData && mbHiddenRedlines )
     116             :     {
     117           0 :         sal_uLong nEndExtra = pDoc->GetNodes().GetEndOfExtras().GetIndex();
     118           0 :         FillSaveData(rPam, *mpRedlSaveData, false, UNDO_REJECT_REDLINE != mnUserId );
     119             : 
     120           0 :         nEndExtra -= pDoc->GetNodes().GetEndOfExtras().GetIndex();
     121           0 :         nSttNode -= nEndExtra;
     122           0 :         nEndNode -= nEndExtra;
     123             :     }
     124             : 
     125           0 :     RedoRedlineImpl(*pDoc, rPam);
     126             : 
     127           0 :     SetPaM(rPam, true);
     128           0 :     pDoc->getIDocumentRedlineAccess().SetRedlineMode_intern( eOld );
     129           0 : }
     130             : 
     131           0 : void SwUndoRedline::UndoRedlineImpl(SwDoc &, SwPaM &)
     132             : {
     133           0 : }
     134             : 
     135             : // default: remove redlines
     136           0 : void SwUndoRedline::RedoRedlineImpl(SwDoc & rDoc, SwPaM & rPam)
     137             : {
     138           0 :     rDoc.getIDocumentRedlineAccess().DeleteRedline(rPam, true, USHRT_MAX);
     139           0 : }
     140             : 
     141           0 : SwUndoRedlineDelete::SwUndoRedlineDelete( const SwPaM& rRange, SwUndoId nUsrId )
     142             :     : SwUndoRedline( nUsrId ? nUsrId : UNDO_DELETE, rRange ),
     143           0 :     bCanGroup( false ), bIsDelim( false ), bIsBackspace( false )
     144             : {
     145             :     const SwTxtNode* pTNd;
     146           0 :     if( UNDO_DELETE == mnUserId &&
     147           0 :         nSttNode == nEndNode && nSttCntnt + 1 == nEndCntnt &&
     148           0 :         0 != (pTNd = rRange.GetNode().GetTxtNode()) )
     149             :     {
     150           0 :         sal_Unicode const cCh = pTNd->GetTxt()[nSttCntnt];
     151           0 :         if( CH_TXTATR_BREAKWORD != cCh && CH_TXTATR_INWORD != cCh )
     152             :         {
     153           0 :             bCanGroup = true;
     154           0 :             bIsDelim = !GetAppCharClass().isLetterNumeric( pTNd->GetTxt(),
     155           0 :                                                             nSttCntnt );
     156           0 :             bIsBackspace = nSttCntnt == rRange.GetPoint()->nContent.GetIndex();
     157             :         }
     158             :     }
     159             : 
     160           0 :     bCacheComment = false;
     161           0 : }
     162             : 
     163           0 : void SwUndoRedlineDelete::UndoRedlineImpl(SwDoc & rDoc, SwPaM & rPam)
     164             : {
     165           0 :     rDoc.getIDocumentRedlineAccess().DeleteRedline(rPam, true, USHRT_MAX);
     166           0 : }
     167             : 
     168           0 : void SwUndoRedlineDelete::RedoRedlineImpl(SwDoc & rDoc, SwPaM & rPam)
     169             : {
     170           0 :     if (rPam.GetPoint() != rPam.GetMark())
     171             :     {
     172           0 :         rDoc.getIDocumentRedlineAccess().AppendRedline( new SwRangeRedline(*mpRedlData, rPam), false );
     173             :     }
     174           0 : }
     175             : 
     176           0 : bool SwUndoRedlineDelete::CanGrouping( const SwUndoRedlineDelete& rNext )
     177             : {
     178           0 :     bool bRet = false;
     179           0 :     if( UNDO_DELETE == mnUserId && mnUserId == rNext.mnUserId &&
     180           0 :         bCanGroup == rNext.bCanGroup &&
     181           0 :         bIsDelim == rNext.bIsDelim &&
     182           0 :         bIsBackspace == rNext.bIsBackspace &&
     183           0 :         nSttNode == nEndNode &&
     184           0 :         rNext.nSttNode == nSttNode &&
     185           0 :         rNext.nEndNode == nEndNode )
     186             :     {
     187           0 :         int bIsEnd = 0;
     188           0 :         if( rNext.nSttCntnt == nEndCntnt )
     189           0 :             bIsEnd = 1;
     190           0 :         else if( rNext.nEndCntnt == nSttCntnt )
     191           0 :             bIsEnd = -1;
     192             : 
     193           0 :         if( bIsEnd &&
     194           0 :             (( !mpRedlSaveData && !rNext.mpRedlSaveData ) ||
     195           0 :              ( mpRedlSaveData && rNext.mpRedlSaveData &&
     196             :                 SwUndo::CanRedlineGroup( *mpRedlSaveData,
     197           0 :                             *rNext.mpRedlSaveData, 1 != bIsEnd )
     198             :              )))
     199             :         {
     200           0 :             if( 1 == bIsEnd )
     201           0 :                 nEndCntnt = rNext.nEndCntnt;
     202             :             else
     203           0 :                 nSttCntnt = rNext.nSttCntnt;
     204           0 :             bRet = true;
     205             :         }
     206             :     }
     207           0 :     return bRet;
     208             : }
     209             : 
     210           0 : SwUndoRedlineSort::SwUndoRedlineSort( const SwPaM& rRange,
     211             :                                     const SwSortOptions& rOpt )
     212             :     : SwUndoRedline( UNDO_SORT_TXT, rRange ),
     213           0 :     pOpt( new SwSortOptions( rOpt ) ),
     214           0 :     nSaveEndNode( nEndNode ), nOffset( 0 ), nSaveEndCntnt( nEndCntnt )
     215             : {
     216           0 : }
     217             : 
     218           0 : SwUndoRedlineSort::~SwUndoRedlineSort()
     219             : {
     220           0 :     delete pOpt;
     221           0 : }
     222             : 
     223           0 : void SwUndoRedlineSort::UndoRedlineImpl(SwDoc & rDoc, SwPaM & rPam)
     224             : {
     225             :     // rPam contains the sorted range
     226             :     // aSaveRange contains copied (i.e. original) range
     227             : 
     228           0 :     SwPosition *const pStart = rPam.Start();
     229           0 :     SwPosition *const pEnd   = rPam.End();
     230             : 
     231           0 :     SwNodeIndex aPrevIdx( pStart->nNode, -1 );
     232           0 :     sal_uLong nOffsetTemp = pEnd->nNode.GetIndex() - pStart->nNode.GetIndex();
     233             : 
     234           0 :     if( 0 == ( nsRedlineMode_t::REDLINE_SHOW_DELETE & rDoc.getIDocumentRedlineAccess().GetRedlineMode()) )
     235             :     {
     236             :         // Search both Redline objects and make them visible to make the nodes
     237             :         // consistent again. The 'delete' one is hidden, thus search for the
     238             :         // 'insert' Redline object. The former is located directly after the latter.
     239           0 :         sal_uInt16 nFnd = rDoc.getIDocumentRedlineAccess().GetRedlinePos(
     240           0 :                             *rDoc.GetNodes()[ nSttNode + 1 ],
     241           0 :                             nsRedlineType_t::REDLINE_INSERT );
     242             :         OSL_ENSURE( USHRT_MAX != nFnd && nFnd+1 < (sal_uInt16)rDoc.getIDocumentRedlineAccess().GetRedlineTbl().size(),
     243             :                     "could not find an Insert object" );
     244           0 :         ++nFnd;
     245           0 :         rDoc.getIDocumentRedlineAccess().GetRedlineTbl()[nFnd]->Show( 1 );
     246             :     }
     247             : 
     248             :     {
     249           0 :         SwPaM aTmp( *rPam.GetMark() );
     250           0 :         aTmp.GetMark()->nContent = 0;
     251           0 :         aTmp.SetMark();
     252           0 :         aTmp.GetPoint()->nNode = nSaveEndNode;
     253           0 :         aTmp.GetPoint()->nContent.Assign( aTmp.GetCntntNode(), nSaveEndCntnt );
     254           0 :         rDoc.getIDocumentRedlineAccess().DeleteRedline( aTmp, true, USHRT_MAX );
     255             :     }
     256             : 
     257           0 :     rDoc.getIDocumentContentOperations().DelFullPara(rPam);
     258             : 
     259           0 :     SwPaM *const pPam = & rPam;
     260           0 :     pPam->DeleteMark();
     261           0 :     pPam->GetPoint()->nNode.Assign( aPrevIdx.GetNode(), +1 );
     262           0 :     SwCntntNode* pCNd = pPam->GetCntntNode();
     263           0 :     pPam->GetPoint()->nContent.Assign(pCNd, 0 );
     264           0 :     pPam->SetMark();
     265             : 
     266           0 :     pPam->GetPoint()->nNode += nOffsetTemp;
     267           0 :     pCNd = pPam->GetCntntNode();
     268           0 :     pPam->GetPoint()->nContent.Assign( pCNd, pCNd->Len() );
     269             : 
     270           0 :     SetValues( *pPam );
     271             : 
     272           0 :     SetPaM(rPam);
     273           0 : }
     274             : 
     275           0 : void SwUndoRedlineSort::RedoRedlineImpl(SwDoc & rDoc, SwPaM & rPam)
     276             : {
     277           0 :     SwPaM* pPam = &rPam;
     278           0 :     SwPosition* pStart = pPam->Start();
     279           0 :     SwPosition* pEnd   = pPam->End();
     280             : 
     281           0 :     SwNodeIndex aPrevIdx( pStart->nNode, -1 );
     282           0 :     sal_uLong nOffsetTemp = pEnd->nNode.GetIndex() - pStart->nNode.GetIndex();
     283           0 :     const sal_Int32 nCntStt  = pStart->nContent.GetIndex();
     284             : 
     285           0 :     rDoc.SortText(rPam, *pOpt);
     286             : 
     287           0 :     pPam->DeleteMark();
     288           0 :     pPam->GetPoint()->nNode.Assign( aPrevIdx.GetNode(), +1 );
     289           0 :     SwCntntNode* pCNd = pPam->GetCntntNode();
     290           0 :     sal_Int32 nLen = pCNd->Len();
     291           0 :     if( nLen > nCntStt )
     292           0 :         nLen = nCntStt;
     293           0 :     pPam->GetPoint()->nContent.Assign(pCNd, nLen );
     294           0 :     pPam->SetMark();
     295             : 
     296           0 :     pPam->GetPoint()->nNode += nOffsetTemp;
     297           0 :     pCNd = pPam->GetCntntNode();
     298           0 :     pPam->GetPoint()->nContent.Assign( pCNd, pCNd->Len() );
     299             : 
     300           0 :     SetValues( rPam );
     301             : 
     302           0 :     SetPaM( rPam );
     303           0 :     rPam.GetPoint()->nNode = nSaveEndNode;
     304           0 :     rPam.GetPoint()->nContent.Assign( rPam.GetCntntNode(), nSaveEndCntnt );
     305           0 : }
     306             : 
     307           0 : void SwUndoRedlineSort::RepeatImpl(::sw::RepeatContext & rContext)
     308             : {
     309           0 :     rContext.GetDoc().SortText( rContext.GetRepeatPaM(), *pOpt );
     310           0 : }
     311             : 
     312           0 : void SwUndoRedlineSort::SetSaveRange( const SwPaM& rRange )
     313             : {
     314           0 :     const SwPosition& rPos = *rRange.End();
     315           0 :     nSaveEndNode = rPos.nNode.GetIndex();
     316           0 :     nSaveEndCntnt = rPos.nContent.GetIndex();
     317           0 : }
     318             : 
     319           0 : void SwUndoRedlineSort::SetOffset( const SwNodeIndex& rIdx )
     320             : {
     321           0 :     nOffset = rIdx.GetIndex() - nSttNode;
     322           0 : }
     323             : 
     324           0 : SwUndoAcceptRedline::SwUndoAcceptRedline( const SwPaM& rRange )
     325           0 :     : SwUndoRedline( UNDO_ACCEPT_REDLINE, rRange )
     326             : {
     327           0 : }
     328             : 
     329           0 : void SwUndoAcceptRedline::RedoRedlineImpl(SwDoc & rDoc, SwPaM & rPam)
     330             : {
     331           0 :     rDoc.getIDocumentRedlineAccess().AcceptRedline(rPam, false);
     332           0 : }
     333             : 
     334           0 : void SwUndoAcceptRedline::RepeatImpl(::sw::RepeatContext & rContext)
     335             : {
     336           0 :     rContext.GetDoc().getIDocumentRedlineAccess().AcceptRedline(rContext.GetRepeatPaM(), true);
     337           0 : }
     338             : 
     339           0 : SwUndoRejectRedline::SwUndoRejectRedline( const SwPaM& rRange )
     340           0 :     : SwUndoRedline( UNDO_REJECT_REDLINE, rRange )
     341             : {
     342           0 : }
     343             : 
     344           0 : void SwUndoRejectRedline::RedoRedlineImpl(SwDoc & rDoc, SwPaM & rPam)
     345             : {
     346           0 :     rDoc.getIDocumentRedlineAccess().RejectRedline(rPam, false);
     347           0 : }
     348             : 
     349           0 : void SwUndoRejectRedline::RepeatImpl(::sw::RepeatContext & rContext)
     350             : {
     351           0 :     rContext.GetDoc().getIDocumentRedlineAccess().RejectRedline(rContext.GetRepeatPaM(), true);
     352           0 : }
     353             : 
     354           0 : SwUndoCompDoc::SwUndoCompDoc( const SwPaM& rRg, bool bIns )
     355             :     : SwUndo( UNDO_COMPAREDOC ), SwUndRng( rRg ), pRedlData( 0 ),
     356           0 :     pUnDel( 0 ), pUnDel2( 0 ), pRedlSaveData( 0 ), bInsert( bIns )
     357             : {
     358           0 :     SwDoc* pDoc = (SwDoc*)rRg.GetDoc();
     359           0 :     if( pDoc->getIDocumentRedlineAccess().IsRedlineOn() )
     360             :     {
     361           0 :         RedlineType_t eTyp = bInsert ? nsRedlineType_t::REDLINE_INSERT : nsRedlineType_t::REDLINE_DELETE;
     362           0 :         pRedlData = new SwRedlineData( eTyp, pDoc->getIDocumentRedlineAccess().GetRedlineAuthor() );
     363           0 :         SetRedlineMode( pDoc->getIDocumentRedlineAccess().GetRedlineMode() );
     364             :     }
     365           0 : }
     366             : 
     367           0 : SwUndoCompDoc::SwUndoCompDoc( const SwRangeRedline& rRedl )
     368             :     : SwUndo( UNDO_COMPAREDOC ), SwUndRng( rRedl ), pRedlData( 0 ),
     369             :     pUnDel( 0 ), pUnDel2( 0 ), pRedlSaveData( 0 ),
     370             :     // for MergeDoc the corresponding inverse is needed
     371           0 :     bInsert( nsRedlineType_t::REDLINE_DELETE == rRedl.GetType() )
     372             : {
     373           0 :     SwDoc* pDoc = (SwDoc*)rRedl.GetDoc();
     374           0 :     if( pDoc->getIDocumentRedlineAccess().IsRedlineOn() )
     375             :     {
     376           0 :         pRedlData = new SwRedlineData( rRedl.GetRedlineData() );
     377           0 :         SetRedlineMode( pDoc->getIDocumentRedlineAccess().GetRedlineMode() );
     378             :     }
     379             : 
     380           0 :     pRedlSaveData = new SwRedlineSaveDatas;
     381           0 :     if( !FillSaveData( rRedl, *pRedlSaveData, false, true ))
     382           0 :         delete pRedlSaveData, pRedlSaveData = 0;
     383           0 : }
     384             : 
     385           0 : SwUndoCompDoc::~SwUndoCompDoc()
     386             : {
     387           0 :     delete pRedlData;
     388           0 :     delete pUnDel;
     389           0 :     delete pUnDel2;
     390           0 :     delete pRedlSaveData;
     391           0 : }
     392             : 
     393           0 : void SwUndoCompDoc::UndoImpl(::sw::UndoRedoContext & rContext)
     394             : {
     395           0 :     SwDoc *const pDoc = & rContext.GetDoc();
     396           0 :     SwPaM *const pPam( & AddUndoRedoPaM(rContext) );
     397             : 
     398           0 :     if( !bInsert )
     399             :     {
     400             :         // delete Redlines
     401           0 :         RedlineMode_t eOld = pDoc->getIDocumentRedlineAccess().GetRedlineMode();
     402           0 :         pDoc->getIDocumentRedlineAccess().SetRedlineMode_intern((RedlineMode_t)(( eOld & ~nsRedlineMode_t::REDLINE_IGNORE) | nsRedlineMode_t::REDLINE_ON));
     403             : 
     404           0 :         pDoc->getIDocumentRedlineAccess().DeleteRedline( *pPam, true, USHRT_MAX );
     405             : 
     406           0 :         pDoc->getIDocumentRedlineAccess().SetRedlineMode_intern( eOld );
     407             : 
     408             :         // per definition Point is end (in SwUndRng!)
     409           0 :         SwCntntNode* pCSttNd = pPam->GetCntntNode( false );
     410           0 :         SwCntntNode* pCEndNd = pPam->GetCntntNode( true );
     411             : 
     412             :         // if start- and end-content is zero, then the doc-compare moves
     413             :         // complete nodes into the current doc. And then the selection
     414             :         // must be from end to start, so the delete join into the right
     415             :         // direction.
     416           0 :         if( !nSttCntnt && !nEndCntnt )
     417           0 :             pPam->Exchange();
     418             : 
     419             :         bool bJoinTxt, bJoinPrev;
     420           0 :         sw_GetJoinFlags( *pPam, bJoinTxt, bJoinPrev );
     421             : 
     422           0 :         pUnDel = new SwUndoDelete( *pPam, false );
     423             : 
     424           0 :         if( bJoinTxt )
     425           0 :             sw_JoinText( *pPam, bJoinPrev );
     426             : 
     427           0 :         if( pCSttNd && !pCEndNd)
     428             :         {
     429             :             // #112139# Do not step behind the end of content.
     430           0 :             SwNode & rTmp = pPam->GetNode(true);
     431           0 :             SwNode * pEnd = pDoc->GetNodes().DocumentSectionEndNode(&rTmp);
     432             : 
     433           0 :             if (&rTmp != pEnd)
     434             :             {
     435           0 :                 pPam->SetMark();
     436           0 :                 pPam->GetPoint()->nNode++;
     437           0 :                 pPam->GetBound( true ).nContent.Assign( 0, 0 );
     438           0 :                 pPam->GetBound( false ).nContent.Assign( 0, 0 );
     439           0 :                 pUnDel2 = new SwUndoDelete( *pPam, true );
     440             :             }
     441             :         }
     442           0 :         pPam->DeleteMark();
     443             :     }
     444             :     else
     445             :     {
     446           0 :         if( IDocumentRedlineAccess::IsRedlineOn( GetRedlineMode() ))
     447             :         {
     448           0 :             pDoc->getIDocumentRedlineAccess().DeleteRedline( *pPam, true, USHRT_MAX );
     449             : 
     450           0 :             if( pRedlSaveData )
     451           0 :                 SetSaveData( *pDoc, *pRedlSaveData );
     452             :         }
     453           0 :         SetPaM(*pPam, true);
     454             :     }
     455           0 : }
     456             : 
     457           0 : void SwUndoCompDoc::RedoImpl(::sw::UndoRedoContext & rContext)
     458             : {
     459           0 :     SwDoc *const pDoc = & rContext.GetDoc();
     460           0 :     SwPaM *const pPam( & AddUndoRedoPaM(rContext) );
     461             : 
     462           0 :     if( bInsert )
     463             :     {
     464           0 :         if( pRedlData && IDocumentRedlineAccess::IsRedlineOn( GetRedlineMode() ))
     465             :         {
     466           0 :             SwRangeRedline* pTmp = new SwRangeRedline( *pRedlData, *pPam );
     467           0 :             ((SwRedlineTbl&)pDoc->getIDocumentRedlineAccess().GetRedlineTbl()).Insert( pTmp );
     468           0 :             pTmp->InvalidateRange();
     469             :         }
     470           0 :         else if( !( nsRedlineMode_t::REDLINE_IGNORE & GetRedlineMode() ) &&
     471           0 :                 !pDoc->getIDocumentRedlineAccess().GetRedlineTbl().empty() )
     472           0 :             pDoc->getIDocumentRedlineAccess().SplitRedline( *pPam );
     473             :     }
     474             :     else
     475             :     {
     476           0 :         if( pUnDel2 )
     477             :         {
     478           0 :             pUnDel2->UndoImpl(rContext);
     479           0 :             delete pUnDel2, pUnDel2 = 0;
     480             :         }
     481           0 :         pUnDel->UndoImpl(rContext);
     482           0 :         delete pUnDel, pUnDel = 0;
     483             : 
     484           0 :         SetPaM( *pPam );
     485             : 
     486           0 :         SwRangeRedline* pTmp = new SwRangeRedline( *pRedlData, *pPam );
     487           0 :         ((SwRedlineTbl&)pDoc->getIDocumentRedlineAccess().GetRedlineTbl()).Insert( pTmp );
     488           0 :         pTmp->InvalidateRange();
     489             :     }
     490             : 
     491           0 :     SetPaM(*pPam, true);
     492         270 : }
     493             : 
     494             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10