LibreOffice Module sw (master)  1
unredln.cxx
Go to the documentation of this file.
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 <osl/diagnose.h>
23 #include <unotools/charclass.hxx>
24 #include <doc.hxx>
26 #include <swundo.hxx>
27 #include <pam.hxx>
28 #include <ndtxt.hxx>
29 #include <txtfrm.hxx>
30 #include <UndoCore.hxx>
31 #include <UndoDelete.hxx>
32 #include <strings.hrc>
33 #include <redline.hxx>
34 #include <docary.hxx>
35 #include <sortopt.hxx>
36 #include <docedt.hxx>
37 
39  : SwUndo( SwUndoId::REDLINE, &rRange.GetDoc() ), SwUndRng( rRange ),
40  mnUserId( nUsrId ),
41  mbHiddenRedlines( false )
42 {
43  // consider Redline
44  SwDoc& rDoc = rRange.GetDoc();
46  {
47  switch( mnUserId )
48  {
49  case SwUndoId::DELETE:
50  case SwUndoId::REPLACE:
51  mpRedlData.reset( new SwRedlineData( RedlineType::Delete, rDoc.getIDocumentRedlineAccess().GetRedlineAuthor() ) );
52  break;
53  default:
54  ;
55  }
57  }
58 
59  sal_uLong nEndExtra = rDoc.GetNodes().GetEndOfExtras().GetIndex();
60 
63  {
64  mpRedlSaveData.reset();
65  }
66  else
67  {
69  if( mbHiddenRedlines ) // then the NodeIndices of SwUndRng need to be corrected
70  {
71  nEndExtra -= rDoc.GetNodes().GetEndOfExtras().GetIndex();
72  m_nSttNode -= nEndExtra;
73  m_nEndNode -= nEndExtra;
74  }
75  }
76 }
77 
79 {
80  mpRedlData.reset();
81  mpRedlSaveData.reset();
82 }
83 
85 {
86  return mpRedlSaveData ? mpRedlSaveData->size() : 0;
87 }
88 
90 {
91  SwDoc& rDoc = rContext.GetDoc();
92  SwPaM& rPam(AddUndoRedoPaM(rContext));
93 
94  // fix PaM for deletions shown in margin
95  bool bIsDeletion = dynamic_cast<SwUndoRedlineDelete*>(this);
97  sal_uInt32 nMaxId = SAL_MAX_UINT32;
98  if ( bIsDeletion && rTable.size() > 0 )
99  {
100  // Nodes of the deletion range are in the newest invisible redlines.
101  // Set all redlines visible and recover the original deletion range.
102  for (sal_uInt32 nNodes = 0; nNodes < m_nEndNode - m_nSttNode + 1; ++nNodes)
103  {
104  SwRedlineTable::size_type nCurRedlinePos = 0;
105  SwRangeRedline * pRedline(rTable[nCurRedlinePos]);
106 
107  // search last but nNodes redline by its nth biggest id
108  for( SwRedlineTable::size_type n = 1; n < rTable.size(); ++n )
109  {
110  SwRangeRedline *pRed(rTable[n]);
111  if ( !pRed->HasMark() && pRedline->GetId() < pRed->GetId() && pRed->GetId() < nMaxId )
112  {
113  nCurRedlinePos = n;
114  pRedline = pRed;
115  }
116  }
117 
118  nMaxId = pRedline->GetId();
119 
120  if ( !pRedline->IsVisible() && !pRedline->HasMark() )
121  {
122  // set it visible
123  pRedline->Show(0, rTable.GetPos(pRedline), /*bForced=*/true);
124  pRedline->Show(1, rTable.GetPos(pRedline), /*bForced=*/true);
125 
126  // extend the range
127  if ( nNodes==0 )
128  rPam = *pRedline;
129  else
130  {
131  rPam.SetMark();
132  *rPam.GetMark() = *pRedline->GetMark();
133  }
134  }
135  }
136  }
137 
138  UndoRedlineImpl(rDoc, rPam);
139 
140  if( mpRedlSaveData )
141  {
142  sal_uLong nEndExtra = rDoc.GetNodes().GetEndOfExtras().GetIndex();
143  SetSaveData(rDoc, *mpRedlSaveData);
144  if( mbHiddenRedlines )
145  {
146  mpRedlSaveData->clear();
147 
148  nEndExtra = rDoc.GetNodes().GetEndOfExtras().GetIndex() - nEndExtra;
149  m_nSttNode += nEndExtra;
150  m_nEndNode += nEndExtra;
151  }
152  SetPaM(rPam, true);
153  }
154 
155  // update frames after calling SetSaveData
156  if ( bIsDeletion )
157  {
159  }
160  else if (dynamic_cast<SwUndoAcceptRedline*>(this)
161  || dynamic_cast<SwUndoRejectRedline*>(this))
162  { // (can't check here if there's a delete redline being accepted)
164  }
165 }
166 
168 {
169  SwDoc& rDoc = rContext.GetDoc();
172 
173  SwPaM & rPam( AddUndoRedoPaM(rContext) );
175  {
176  sal_uLong nEndExtra = rDoc.GetNodes().GetEndOfExtras().GetIndex();
178 
179  nEndExtra -= rDoc.GetNodes().GetEndOfExtras().GetIndex();
180  m_nSttNode -= nEndExtra;
181  m_nEndNode -= nEndExtra;
182  }
183 
184  RedoRedlineImpl(rDoc, rPam);
185 
186  SetPaM(rPam, true);
188 }
189 
191 {
192 }
193 
194 // default: remove redlines
196 {
197  rDoc.getIDocumentRedlineAccess().DeleteRedline(rPam, true, RedlineType::Any);
198 }
199 
201  : SwUndoRedline( nUsrId != SwUndoId::EMPTY ? nUsrId : SwUndoId::DELETE, rRange ),
202  m_bCanGroup( false ), m_bIsDelim( false ), m_bIsBackspace( false )
203 {
204  const SwTextNode* pTNd;
205  SetRedlineText(rRange.GetText());
206  if( SwUndoId::DELETE == mnUserId &&
208  nullptr != (pTNd = rRange.GetNode().GetTextNode()) )
209  {
210  sal_Unicode const cCh = pTNd->GetText()[m_nSttContent];
211  if( CH_TXTATR_BREAKWORD != cCh && CH_TXTATR_INWORD != cCh )
212  {
213  m_bCanGroup = true;
215  m_nSttContent );
217  }
218  }
219 
220  m_bCacheComment = false;
221 }
222 
223 // bit of a hack, replace everything...
225 {
226  SwRewriter aResult;
228  aStr = ShortenString(aStr, nUndoStringLength, SwResId(STR_LDOTS));
229  SwRewriter aRewriter;
230  aRewriter.AddRule(UndoArg1, aStr);
231  OUString ret = aRewriter.Apply(SwResId(STR_UNDO_REDLINE_DELETE));
232  aResult.AddRule(UndoArg1, ret);
233  return aResult;
234 }
235 
236 void SwUndoRedlineDelete::SetRedlineText(const OUString & rText)
237 {
238  m_sRedlineText = rText;
239 }
240 
242 {
243  rDoc.getIDocumentRedlineAccess().DeleteRedline(rPam, true, RedlineType::Any);
244 }
245 
247 {
248  if (rPam.GetPoint() != rPam.GetMark())
249  {
251  }
253 }
254 
256 {
257  bool bRet = false;
258  if( SwUndoId::DELETE == mnUserId && mnUserId == rNext.mnUserId &&
259  m_bCanGroup == rNext.m_bCanGroup &&
260  m_bIsDelim == rNext.m_bIsDelim &&
261  m_bIsBackspace == rNext.m_bIsBackspace &&
262  m_nSttNode == m_nEndNode &&
263  rNext.m_nSttNode == m_nSttNode &&
264  rNext.m_nEndNode == m_nEndNode )
265  {
266  int bIsEnd = 0;
267  if( rNext.m_nSttContent == m_nEndContent )
268  bIsEnd = 1;
269  else if( rNext.m_nEndContent == m_nSttContent )
270  bIsEnd = -1;
271 
272  if( bIsEnd &&
273  (( !mpRedlSaveData && !rNext.mpRedlSaveData ) ||
274  ( mpRedlSaveData && rNext.mpRedlSaveData &&
276  *rNext.mpRedlSaveData, 1 != bIsEnd )
277  )))
278  {
279  if( 1 == bIsEnd )
281  else
283  bRet = true;
284  }
285  }
286  return bRet;
287 }
288 
290  const SwSortOptions& rOpt )
291  : SwUndoRedline( SwUndoId::SORT_TXT, rRange ),
292  m_pOpt( new SwSortOptions( rOpt ) ),
293  m_nSaveEndNode( m_nEndNode ), m_nSaveEndContent( m_nEndContent )
294 {
295 }
296 
298 {
299 }
300 
302 {
303  // rPam contains the sorted range
304  // aSaveRange contains copied (i.e. original) range
305 
306  SwPosition *const pStart = rPam.Start();
307  SwPosition *const pEnd = rPam.End();
308 
309  SwNodeIndex aPrevIdx( pStart->nNode, -1 );
310  sal_uLong nOffsetTemp = pEnd->nNode.GetIndex() - pStart->nNode.GetIndex();
311 
313  {
314  // Search both Redline objects and make them visible to make the nodes
315  // consistent again. The 'delete' one is hidden, thus search for the
316  // 'insert' Redline object. The former is located directly after the latter.
318  *rDoc.GetNodes()[ m_nSttNode + 1 ],
319  RedlineType::Insert );
320  OSL_ENSURE( SwRedlineTable::npos != nFnd && nFnd+1 < rDoc.getIDocumentRedlineAccess().GetRedlineTable().size(),
321  "could not find an Insert object" );
322  ++nFnd;
323  rDoc.getIDocumentRedlineAccess().GetRedlineTable()[nFnd]->Show(1, nFnd);
324  }
325 
326  {
327  SwPaM aTmp( *rPam.GetMark() );
328  aTmp.GetMark()->nContent = 0;
329  aTmp.SetMark();
330  aTmp.GetPoint()->nNode = m_nSaveEndNode;
331  aTmp.GetPoint()->nContent.Assign( aTmp.GetContentNode(), m_nSaveEndContent );
332  rDoc.getIDocumentRedlineAccess().DeleteRedline( aTmp, true, RedlineType::Any );
333  }
334 
336 
337  SwPaM *const pPam = & rPam;
338  pPam->DeleteMark();
339  pPam->GetPoint()->nNode.Assign( aPrevIdx.GetNode(), +1 );
340  SwContentNode* pCNd = pPam->GetContentNode();
341  pPam->GetPoint()->nContent.Assign(pCNd, 0 );
342  pPam->SetMark();
343 
344  pPam->GetPoint()->nNode += nOffsetTemp;
345  pCNd = pPam->GetContentNode();
346  pPam->GetPoint()->nContent.Assign( pCNd, pCNd->Len() );
347 
348  SetValues( *pPam );
349 
350  SetPaM(rPam);
351 }
352 
354 {
355  SwPaM* pPam = &rPam;
356  SwPosition* pStart = pPam->Start();
357  SwPosition* pEnd = pPam->End();
358 
359  SwNodeIndex aPrevIdx( pStart->nNode, -1 );
360  sal_uLong nOffsetTemp = pEnd->nNode.GetIndex() - pStart->nNode.GetIndex();
361  const sal_Int32 nCntStt = pStart->nContent.GetIndex();
362 
363  rDoc.SortText(rPam, *m_pOpt);
364 
365  pPam->DeleteMark();
366  pPam->GetPoint()->nNode.Assign( aPrevIdx.GetNode(), +1 );
367  SwContentNode* pCNd = pPam->GetContentNode();
368  sal_Int32 nLen = pCNd->Len();
369  if( nLen > nCntStt )
370  nLen = nCntStt;
371  pPam->GetPoint()->nContent.Assign(pCNd, nLen );
372  pPam->SetMark();
373 
374  pPam->GetPoint()->nNode += nOffsetTemp;
375  pCNd = pPam->GetContentNode();
376  pPam->GetPoint()->nContent.Assign( pCNd, pCNd->Len() );
377 
378  SetValues( rPam );
379 
380  SetPaM( rPam );
381  rPam.GetPoint()->nNode = m_nSaveEndNode;
383 }
384 
386 {
387  rContext.GetDoc().SortText( rContext.GetRepeatPaM(), *m_pOpt );
388 }
389 
391 {
392  const SwPosition& rPos = *rRange.End();
393  m_nSaveEndNode = rPos.nNode.GetIndex();
395 }
396 
399 {
400 }
401 
403 {
404  rDoc.getIDocumentRedlineAccess().AcceptRedline(rPam, false);
405 }
406 
408 {
409  rContext.GetDoc().getIDocumentRedlineAccess().AcceptRedline(rContext.GetRepeatPaM(), true);
410 }
411 
414 {
415 }
416 
418 {
419  rDoc.getIDocumentRedlineAccess().RejectRedline(rPam, false);
420 }
421 
423 {
424  rContext.GetDoc().getIDocumentRedlineAccess().RejectRedline(rContext.GetRepeatPaM(), true);
425 }
426 
427 SwUndoCompDoc::SwUndoCompDoc( const SwPaM& rRg, bool bIns )
428  : SwUndo( SwUndoId::COMPAREDOC, &rRg.GetDoc() ), SwUndRng( rRg ),
429  m_bInsert( bIns )
430 {
431  SwDoc& rDoc = rRg.GetDoc();
433  {
434  RedlineType eTyp = m_bInsert ? RedlineType::Insert : RedlineType::Delete;
437  }
438 }
439 
441  : SwUndo( SwUndoId::COMPAREDOC, &rRedl.GetDoc() ), SwUndRng( rRedl ),
442  // for MergeDoc the corresponding inverse is needed
443  m_bInsert( RedlineType::Delete == rRedl.GetType() )
444 {
445  SwDoc& rDoc = rRedl.GetDoc();
447  {
448  m_pRedlineData.reset( new SwRedlineData( rRedl.GetRedlineData() ) );
450  }
451 
453  if( !FillSaveData( rRedl, *m_pRedlineSaveDatas, false ))
454  {
455  m_pRedlineSaveDatas.reset();
456  }
457 }
458 
460 {
461  m_pRedlineData.reset();
462  m_pUndoDelete.reset();
463  m_pUndoDelete2.reset();
464  m_pRedlineSaveDatas.reset();
465 }
466 
468 {
469  SwDoc& rDoc = rContext.GetDoc();
470  SwPaM& rPam(AddUndoRedoPaM(rContext));
471 
472  if( !m_bInsert )
473  {
474  // delete Redlines
477 
478  rDoc.getIDocumentRedlineAccess().DeleteRedline(rPam, true, RedlineType::Any);
479 
481 
482  // per definition Point is end (in SwUndRng!)
483  SwContentNode* pCSttNd = rPam.GetContentNode(false);
484  SwContentNode* pCEndNd = rPam.GetContentNode();
485 
486  // if start- and end-content is zero, then the doc-compare moves
487  // complete nodes into the current doc. And then the selection
488  // must be from end to start, so the delete join into the right
489  // direction.
490  if( !m_nSttContent && !m_nEndContent )
491  rPam.Exchange();
492 
493  bool bJoinText, bJoinPrev;
494  sw_GetJoinFlags(rPam, bJoinText, bJoinPrev);
495 
496  m_pUndoDelete.reset( new SwUndoDelete(rPam, false) );
497 
498  if( bJoinText )
499  sw_JoinText(rPam, bJoinPrev);
500 
501  if( pCSttNd && !pCEndNd)
502  {
503  // #112139# Do not step behind the end of content.
504  SwNode & rTmp = rPam.GetNode();
505  SwNode * pEnd = rDoc.GetNodes().DocumentSectionEndNode(&rTmp);
506 
507  if (&rTmp != pEnd)
508  {
509  rPam.SetMark();
510  ++rPam.GetPoint()->nNode;
511  rPam.GetBound().nContent.Assign( nullptr, 0 );
512  rPam.GetBound( false ).nContent.Assign( nullptr, 0 );
513  m_pUndoDelete2.reset( new SwUndoDelete(rPam, true) );
514  }
515  }
516  rPam.DeleteMark();
517  }
518  else
519  {
521  {
522  rDoc.getIDocumentRedlineAccess().DeleteRedline(rPam, true, RedlineType::Any);
523 
524  if( m_pRedlineSaveDatas )
526  }
527  SetPaM(rPam, true);
528  }
529 }
530 
532 {
533  SwDoc& rDoc = rContext.GetDoc();
534 
535  if( m_bInsert )
536  {
537  SwPaM& rPam(AddUndoRedoPaM(rContext));
539  {
540  SwRangeRedline* pTmp = new SwRangeRedline(*m_pRedlineData, rPam);
543  }
544  else if( !( RedlineFlags::Ignore & GetRedlineFlags() ) &&
546  {
548  }
549  SetPaM(rPam, true);
550  }
551  else
552  {
553  if( m_pUndoDelete2 )
554  {
555  m_pUndoDelete2->UndoImpl(rContext);
556  m_pUndoDelete2.reset();
557  }
558  m_pUndoDelete->UndoImpl(rContext);
559  m_pUndoDelete.reset();
560 
561  // note: don't call SetPaM before executing Undo of members
562  SwPaM& rPam(AddUndoRedoPaM(rContext));
563 
564  SwRangeRedline* pTmp = new SwRangeRedline(*m_pRedlineData, rPam);
567 
568  SetPaM(rPam, true);
569  }
570 }
571 
572 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sal_uInt16 GetRedlSaveCount() const
Definition: unredln.cxx:84
SwPaM & AddUndoRedoPaM(::sw::UndoRedoContext &, bool const bCorrToContent=false) const
Definition: undobj.cxx:110
virtual sal_Int32 Len() const
Definition: node.cxx:1246
void DeleteMark()
Definition: pam.hxx:177
sal_uLong GetIndex() const
Definition: node.hxx:291
SwNode & GetNode(bool bPoint=true) const
Definition: pam.hxx:223
virtual void RepeatImpl(::sw::RepeatContext &) override
Definition: unredln.cxx:422
void Show(sal_uInt16 nLoop, size_t nMyPos, bool bForced=false)
Definition: docredln.cxx:1149
Marks a position in the document model.
Definition: pam.hxx:35
void UpdateFramesForAddDeleteRedline(SwDoc &rDoc, SwPaM const &rPam)
virtual ~SwUndoRedline() override
Definition: unredln.cxx:78
std::unique_ptr< SwRedlineSaveDatas > m_pRedlineSaveDatas
const OUString & GetText() const
Definition: ndtxt.hxx:218
std::unique_ptr< SwRedlineSaveDatas > mpRedlSaveData
Definition: UndoRedline.hxx:36
SwUndoId
Definition: swundo.hxx:29
virtual void UndoImpl(::sw::UndoRedoContext &) override
Definition: unredln.cxx:467
virtual AppendResult AppendRedline(SwRangeRedline *pNewRedl, bool bCallDelete)=0
Append a new redline.
virtual void SetRedlineFlags_intern(RedlineFlags eMode)=0
Set a new redline mode.
SwNodeIndex nNode
Definition: pam.hxx:37
virtual void RedoRedlineImpl(SwDoc &rDoc, SwPaM &rPam) override
Definition: unredln.cxx:246
sal_uIntPtr sal_uLong
SwPaM & GetRepeatPaM()
Definition: UndoCore.hxx:129
virtual ~SwUndoRedlineSort() override
Definition: unredln.cxx:297
const SwPosition * GetMark() const
Definition: pam.hxx:209
sal_uLong m_nEndNode
Definition: undobj.hxx:230
sal_Int64 n
Definition: doc.hxx:188
std::unique_ptr< SwSortOptions > m_pOpt
Definition: UndoRedline.hxx:80
virtual ~SwUndoCompDoc() override
Definition: unredln.cxx:459
void SetRedlineFlags(RedlineFlags eMode)
Definition: undobj.hxx:120
SwNode & GetNode() const
Definition: ndindex.hxx:119
SwNode * DocumentSectionEndNode(SwNode *pNode) const
Definition: nodes.cxx:2322
SwPosition & GetBound(bool bOne=true)
Definition: pam.hxx:245
IDocumentContentOperations const & getIDocumentContentOperations() const
Definition: doc.cxx:315
SwUndoCompDoc(const SwPaM &rRg, bool bIns)
Definition: unredln.cxx:427
void SetRedlineText(const OUString &rText)
Definition: unredln.cxx:236
std::unique_ptr< SwRedlineData > m_pRedlineData
size_type size() const
Definition: docary.hxx:265
void SetValues(const SwPaM &rPam)
Definition: undobj.cxx:60
SwContentNode * GetContentNode(bool bPoint=true) const
Definition: pam.hxx:229
OUString SwResId(TranslateId aId)
Definition: swmodule.cxx:165
#define SAL_MAX_UINT32
#define CH_TXTATR_BREAKWORD
Definition: hintids.hxx:170
bool isLetterNumeric(const OUString &rStr, sal_Int32 nPos) const
sal_uInt16 sal_Unicode
#define CH_TXTATR_INWORD
Definition: hintids.hxx:171
SwUndoRedline(SwUndoId nUserId, const SwPaM &rRange)
Definition: unredln.cxx:38
bool mbHiddenRedlines
Definition: UndoRedline.hxx:38
SwIndex nContent
Definition: pam.hxx:38
bool empty() const
Definition: docary.hxx:264
static bool IsRedlineOn(const RedlineFlags eM)
SwDoc & GetDoc() const
Definition: UndoCore.hxx:127
sal_uLong GetIndex() const
Definition: ndindex.hxx:152
virtual void RedoRedlineImpl(SwDoc &rDoc, SwPaM &rPam) override
Definition: unredln.cxx:417
static bool CanRedlineGroup(SwRedlineSaveDatas &rCurr, const SwRedlineSaveDatas &rCheck, bool bCurrIsEnd)
Definition: undobj.cxx:1502
bool CanGrouping(const SwUndoRedlineDelete &rPrev)
Definition: unredln.cxx:255
RedlineFlags on.
SwDoc & GetDoc() const
Definition: UndoCore.hxx:95
RedlineFlags GetRedlineFlags() const
Definition: undobj.hxx:119
bool sw_JoinText(SwPaM &rPam, bool bJoinPrev)
Definition: docedt.cxx:354
const SwRedlineData & GetRedlineData(sal_uInt16 nPos=0) const
Definition: docredln.cxx:1858
virtual void RepeatImpl(::sw::RepeatContext &) override
Definition: unredln.cxx:407
virtual std::size_t GetRedlineAuthor()=0
void InvalidateRange(Invalidation)
Initiate the layout.
Definition: docredln.cxx:1282
bool SortText(const SwPaM &, const SwSortOptions &)
Sort Text in the Document.
Definition: docsort.cxx:283
OUString GetText() const
Definition: pam.cxx:1076
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:136
virtual SwRedlineTable::size_type GetRedlinePos(const SwNode &rNode, RedlineType nType) const =0
size_type GetPos(const SwRangeRedline *p) const
Definition: docredln.cxx:630
void SetSaveRange(const SwPaM &rRange)
Definition: unredln.cxx:390
static bool HasHiddenRedlines(const SwRedlineSaveDatas &rSData)
Definition: undobj.cxx:1494
const SwPosition * GetPoint() const
Definition: pam.hxx:207
OUString DenoteSpecialCharacters(const OUString &rStr, bool bQuoted=true)
Denotes special characters in a string.
Definition: undel.cxx:718
SwIndex & Assign(SwIndexReg *, sal_Int32)
Definition: index.cxx:206
OUString Apply(const OUString &rStr) const
Definition: SwRewriter.cxx:39
virtual void RedoImpl(::sw::UndoRedoContext &) override
Definition: unredln.cxx:531
SwUndoRedlineDelete(const SwPaM &rRange, SwUndoId nUserId)
Definition: unredln.cxx:200
static void SetSaveData(SwDoc &rDoc, SwRedlineSaveDatas &rSData)
Definition: undobj.cxx:1475
void Exchange()
Definition: pam.cxx:492
virtual bool DeleteRedline(const SwPaM &rPam, bool bSaveInUndo, RedlineType nDelType)=0
vector_type::size_type size_type
Definition: docary.hxx:223
bool HasMark() const
A PaM marks a selection if Point and Mark are distinct positions.
Definition: pam.hxx:205
sal_Int32 m_nEndContent
Definition: undobj.hxx:231
virtual void UndoImpl(::sw::UndoRedoContext &) override
Definition: unredln.cxx:89
void AddRule(SwUndoArg eWhat, const OUString &rWith)
Definition: SwRewriter.cxx:25
virtual void RedoRedlineImpl(SwDoc &rDoc, SwPaM &rPam) override
Definition: unredln.cxx:353
Marks a node in the document model.
Definition: ndindex.hxx:31
bool m_bCacheComment
Definition: undobj.hxx:61
std::unique_ptr< SwRedlineData > mpRedlData
Definition: UndoRedline.hxx:35
SwUndoRejectRedline(const SwPaM &rRange)
Definition: unredln.cxx:412
SwUndoRedlineSort(const SwPaM &rRange, const SwSortOptions &rOpt)
Definition: unredln.cxx:289
sal_uInt32 GetId() const
Definition: redline.hxx:182
show all deletes
const SwPosition * Start() const
Definition: pam.hxx:212
bool IsVisible() const
Definition: redline.hxx:187
virtual void RedoImpl(::sw::UndoRedoContext &) override
Definition: unredln.cxx:167
void SetMark(const sw::mark::IMark *pMark)
Definition: index.cxx:222
std::unique_ptr< SwUndoDelete > m_pUndoDelete
sal_uLong m_nSttNode
Definition: undobj.hxx:230
ignore Redlines
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:79
virtual bool SplitRedline(const SwPaM &rPam)=0
SwUndoAcceptRedline(const SwPaM &rRange)
Definition: unredln.cxx:397
IDocumentRedlineAccess const & getIDocumentRedlineAccess() const
Definition: doc.cxx:335
virtual void RedoRedlineImpl(SwDoc &rDoc, SwPaM &rPam) override
Definition: unredln.cxx:402
void SetPaM(SwPaM &, bool bCorrToContent=false) const
Definition: undobj.cxx:82
void UpdateFramesForRemoveDeleteRedline(SwDoc &rDoc, SwPaM const &rPam)
OUString ShortenString(const OUString &rStr, sal_Int32 nLength, const OUString &rFillStr)
Shortens a string to a maximum length.
Definition: undobj.cxx:1534
SwUndoId mnUserId
Definition: UndoRedline.hxx:37
virtual bool DelFullPara(SwPaM &)=0
Delete full paragraphs.
sal_Int32 GetIndex() const
Definition: index.hxx:91
virtual bool IsRedlineOn() const =0
Query if redlining is on.
SwNodes & GetNodes()
Definition: doc.hxx:409
const SwPosition * End() const
Definition: pam.hxx:217
virtual void RedoRedlineImpl(SwDoc &rDoc, SwPaM &rPam)
Definition: unredln.cxx:195
sal_uLong m_nSaveEndNode
Definition: UndoRedline.hxx:81
virtual RedlineFlags GetRedlineFlags() const =0
Query the currently set redline mode.
SwDoc & GetDoc() const
Definition: pam.hxx:243
virtual bool AcceptRedline(SwRedlineTable::size_type nPos, bool bCallDelete)=0
void sw_GetJoinFlags(SwPaM &rPam, bool &rJoinText, bool &rJoinPrev)
Definition: docedt.cxx:323
RedlineType
virtual void SetMark()
Unless this is called, the getter method of Mark will return Point.
Definition: pam.cxx:478
static bool FillSaveData(const SwPaM &rRange, SwRedlineSaveDatas &rSData, bool bDelRange=true, bool bCopyNext=true)
Definition: undobj.cxx:1410
virtual bool RejectRedline(SwRedlineTable::size_type nPos, bool bCallDelete)=0
virtual SwRewriter GetRewriter() const override
Returns the rewriter for this object.
Definition: unredln.cxx:224
virtual const SwRedlineTable & GetRedlineTable() const =0
bool Insert(SwRangeRedline *&p)
Definition: docredln.cxx:431
SwNode & GetEndOfExtras() const
This is the last EndNode of a special section.
Definition: ndarr.hxx:158
std::unique_ptr< SwUndoDelete > m_pUndoDelete2
virtual void UndoRedlineImpl(SwDoc &rDoc, SwPaM &rPam)
Definition: unredln.cxx:190
CharClass & GetAppCharClass()
Definition: init.cxx:703
static constexpr size_type npos
Definition: docary.hxx:224
aStr
virtual void RepeatImpl(::sw::RepeatContext &) override
Definition: unredln.cxx:385
sal_Int32 m_nSaveEndContent
Definition: UndoRedline.hxx:82
sal_Int32 m_nSttContent
Definition: undobj.hxx:231
const int nUndoStringLength
Definition: UndoCore.hxx:238
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
Definition: ndtxt.hxx:856
virtual void UndoRedlineImpl(SwDoc &rDoc, SwPaM &rPam) override
Definition: unredln.cxx:301
SwNodeIndex & Assign(SwNodes const &rNds, sal_uLong)
Definition: ndindex.hxx:272
Base class of the Writer document model elements.
Definition: node.hxx:80
virtual void UndoRedlineImpl(SwDoc &rDoc, SwPaM &rPam) override
Definition: unredln.cxx:241