LCOV - code coverage report
Current view: top level - sw/source/core/undo - unredln.cxx (source / functions) Hit Total Coverage
Test: commit c8344322a7af75b84dd3ca8f78b05543a976dfd5 Lines: 37 269 13.8 %
Date: 2015-06-13 12:38:46 Functions: 10 34 29.4 %
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          17 : SwUndoRedline::SwUndoRedline( SwUndoId nUsrId, const SwPaM& rRange )
      37             :     : SwUndo( UNDO_REDLINE ), SwUndRng( rRange ),
      38             :     mpRedlData( 0 ), mpRedlSaveData( 0 ), mnUserId( nUsrId ),
      39          17 :     mbHiddenRedlines( false )
      40             : {
      41             :     // consider Redline
      42          17 :     SwDoc& rDoc = *rRange.GetDoc();
      43          17 :     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          17 :     sal_uLong nEndExtra = rDoc.GetNodes().GetEndOfExtras().GetIndex();
      58             : 
      59          17 :     mpRedlSaveData = new SwRedlineSaveDatas;
      60          17 :     if( !FillSaveData( rRange, *mpRedlSaveData, false, UNDO_REJECT_REDLINE != mnUserId ))
      61           7 :         delete mpRedlSaveData, mpRedlSaveData = 0;
      62             :     else
      63             :     {
      64          10 :         mbHiddenRedlines = HasHiddenRedlines( *mpRedlSaveData );
      65          10 :         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          17 : }
      73             : 
      74          41 : SwUndoRedline::~SwUndoRedline()
      75             : {
      76          17 :     delete mpRedlData;
      77          17 :     delete mpRedlSaveData;
      78          24 : }
      79             : 
      80           7 : sal_uInt16 SwUndoRedline::GetRedlSaveCount() const
      81             : {
      82           7 :     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 SwTextNode* pTNd;
     146           0 :     if( UNDO_DELETE == mnUserId &&
     147           0 :         nSttNode == nEndNode && nSttContent + 1 == nEndContent &&
     148           0 :         0 != (pTNd = rRange.GetNode().GetTextNode()) )
     149             :     {
     150           0 :         sal_Unicode const cCh = pTNd->GetText()[nSttContent];
     151           0 :         if( CH_TXTATR_BREAKWORD != cCh && CH_TXTATR_INWORD != cCh )
     152             :         {
     153           0 :             bCanGroup = true;
     154           0 :             bIsDelim = !GetAppCharClass().isLetterNumeric( pTNd->GetText(),
     155           0 :                                                             nSttContent );
     156           0 :             bIsBackspace = nSttContent == 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.nSttContent == nEndContent )
     189           0 :             bIsEnd = 1;
     190           0 :         else if( rNext.nEndContent == nSttContent )
     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 :                 nEndContent = rNext.nEndContent;
     202             :             else
     203           0 :                 nSttContent = rNext.nSttContent;
     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 ), nSaveEndContent( nEndContent )
     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().GetRedlineTable().size(),
     243             :                     "could not find an Insert object" );
     244           0 :         ++nFnd;
     245           0 :         rDoc.getIDocumentRedlineAccess().GetRedlineTable()[nFnd]->Show(1, nFnd);
     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.GetContentNode(), nSaveEndContent );
     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 :     SwContentNode* pCNd = pPam->GetContentNode();
     263           0 :     pPam->GetPoint()->nContent.Assign(pCNd, 0 );
     264           0 :     pPam->SetMark();
     265             : 
     266           0 :     pPam->GetPoint()->nNode += nOffsetTemp;
     267           0 :     pCNd = pPam->GetContentNode();
     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 :     SwContentNode* pCNd = pPam->GetContentNode();
     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->GetContentNode();
     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.GetContentNode(), nSaveEndContent );
     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 :     nSaveEndContent = 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          10 : SwUndoAcceptRedline::SwUndoAcceptRedline( const SwPaM& rRange )
     325          10 :     : SwUndoRedline( UNDO_ACCEPT_REDLINE, rRange )
     326             : {
     327          10 : }
     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 = 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           6 : 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           6 :     bInsert( nsRedlineType_t::REDLINE_DELETE == rRedl.GetType() )
     372             : {
     373           6 :     SwDoc* pDoc = rRedl.GetDoc();
     374           6 :     if( pDoc->getIDocumentRedlineAccess().IsRedlineOn() )
     375             :     {
     376           6 :         pRedlData = new SwRedlineData( rRedl.GetRedlineData() );
     377           6 :         SetRedlineMode( pDoc->getIDocumentRedlineAccess().GetRedlineMode() );
     378             :     }
     379             : 
     380           6 :     pRedlSaveData = new SwRedlineSaveDatas;
     381           6 :     if( !FillSaveData( rRedl, *pRedlSaveData, false, true ))
     382           6 :         delete pRedlSaveData, pRedlSaveData = 0;
     383           6 : }
     384             : 
     385          18 : SwUndoCompDoc::~SwUndoCompDoc()
     386             : {
     387           6 :     delete pRedlData;
     388           6 :     delete pUnDel;
     389           6 :     delete pUnDel2;
     390           6 :     delete pRedlSaveData;
     391          12 : }
     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 :         SwContentNode* pCSttNd = pPam->GetContentNode( false );
     410           0 :         SwContentNode* pCEndNd = pPam->GetContentNode( 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( !nSttContent && !nEndContent )
     417           0 :             pPam->Exchange();
     418             : 
     419             :         bool bJoinText, bJoinPrev;
     420           0 :         sw_GetJoinFlags( *pPam, bJoinText, bJoinPrev );
     421             : 
     422           0 :         pUnDel = new SwUndoDelete( *pPam, false );
     423             : 
     424           0 :         if( bJoinText )
     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 :             static_cast<SwRedlineTable&>(pDoc->getIDocumentRedlineAccess().GetRedlineTable()).Insert( pTmp );
     468           0 :             pTmp->InvalidateRange();
     469             :         }
     470           0 :         else if( !( nsRedlineMode_t::REDLINE_IGNORE & GetRedlineMode() ) &&
     471           0 :                 !pDoc->getIDocumentRedlineAccess().GetRedlineTable().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 :         static_cast<SwRedlineTable&>(pDoc->getIDocumentRedlineAccess().GetRedlineTable()).Insert( pTmp );
     488           0 :         pTmp->InvalidateRange();
     489             :     }
     490             : 
     491           0 :     SetPaM(*pPam, true);
     492         177 : }
     493             : 
     494             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.11