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  std::unique_ptr<SwPaM> pNewPam;
132  pNewPam.reset(new SwPaM(*pRedline->GetMark(), *rPam.GetPoint()));
133  rPam = *pNewPam;
134  }
135  }
136  }
137  }
138 
139  UndoRedlineImpl(rDoc, rPam);
140 
141  if( mpRedlSaveData )
142  {
143  sal_uLong nEndExtra = rDoc.GetNodes().GetEndOfExtras().GetIndex();
144  SetSaveData(rDoc, *mpRedlSaveData);
145  if( mbHiddenRedlines )
146  {
147  mpRedlSaveData->clear();
148 
149  nEndExtra = rDoc.GetNodes().GetEndOfExtras().GetIndex() - nEndExtra;
150  m_nSttNode += nEndExtra;
151  m_nEndNode += nEndExtra;
152  }
153  SetPaM(rPam, true);
154  }
155 
156  // update frames after calling SetSaveData
157  if ( bIsDeletion )
158  {
160  }
161  else if (dynamic_cast<SwUndoAcceptRedline*>(this)
162  || dynamic_cast<SwUndoRejectRedline*>(this))
163  { // (can't check here if there's a delete redline being accepted)
165  }
166 }
167 
169 {
170  SwDoc& rDoc = rContext.GetDoc();
173 
174  SwPaM & rPam( AddUndoRedoPaM(rContext) );
176  {
177  sal_uLong nEndExtra = rDoc.GetNodes().GetEndOfExtras().GetIndex();
179 
180  nEndExtra -= rDoc.GetNodes().GetEndOfExtras().GetIndex();
181  m_nSttNode -= nEndExtra;
182  m_nEndNode -= nEndExtra;
183  }
184 
185  RedoRedlineImpl(rDoc, rPam);
186 
187  SetPaM(rPam, true);
189 }
190 
192 {
193 }
194 
195 // default: remove redlines
197 {
198  rDoc.getIDocumentRedlineAccess().DeleteRedline(rPam, true, RedlineType::Any);
199 }
200 
202  : SwUndoRedline( nUsrId != SwUndoId::EMPTY ? nUsrId : SwUndoId::DELETE, rRange ),
203  m_bCanGroup( false ), m_bIsDelim( false ), m_bIsBackspace( false )
204 {
205  const SwTextNode* pTNd;
206  SetRedlineText(rRange.GetText());
207  if( SwUndoId::DELETE == mnUserId &&
209  nullptr != (pTNd = rRange.GetNode().GetTextNode()) )
210  {
211  sal_Unicode const cCh = pTNd->GetText()[m_nSttContent];
212  if( CH_TXTATR_BREAKWORD != cCh && CH_TXTATR_INWORD != cCh )
213  {
214  m_bCanGroup = true;
216  m_nSttContent );
218  }
219  }
220 
221  m_bCacheComment = false;
222 }
223 
224 // bit of a hack, replace everything...
226 {
227  SwRewriter aResult;
229  aStr = ShortenString(aStr, nUndoStringLength, SwResId(STR_LDOTS));
230  SwRewriter aRewriter;
231  aRewriter.AddRule(UndoArg1, aStr);
232  OUString ret = aRewriter.Apply(SwResId(STR_UNDO_REDLINE_DELETE));
233  aResult.AddRule(UndoArg1, ret);
234  return aResult;
235 }
236 
237 void SwUndoRedlineDelete::SetRedlineText(const OUString & rText)
238 {
239  m_sRedlineText = rText;
240 }
241 
243 {
244  rDoc.getIDocumentRedlineAccess().DeleteRedline(rPam, true, RedlineType::Any);
245 }
246 
248 {
249  if (rPam.GetPoint() != rPam.GetMark())
250  {
252  }
254 }
255 
257 {
258  bool bRet = false;
259  if( SwUndoId::DELETE == mnUserId && mnUserId == rNext.mnUserId &&
260  m_bCanGroup == rNext.m_bCanGroup &&
261  m_bIsDelim == rNext.m_bIsDelim &&
262  m_bIsBackspace == rNext.m_bIsBackspace &&
263  m_nSttNode == m_nEndNode &&
264  rNext.m_nSttNode == m_nSttNode &&
265  rNext.m_nEndNode == m_nEndNode )
266  {
267  int bIsEnd = 0;
268  if( rNext.m_nSttContent == m_nEndContent )
269  bIsEnd = 1;
270  else if( rNext.m_nEndContent == m_nSttContent )
271  bIsEnd = -1;
272 
273  if( bIsEnd &&
274  (( !mpRedlSaveData && !rNext.mpRedlSaveData ) ||
275  ( mpRedlSaveData && rNext.mpRedlSaveData &&
277  *rNext.mpRedlSaveData, 1 != bIsEnd )
278  )))
279  {
280  if( 1 == bIsEnd )
282  else
284  bRet = true;
285  }
286  }
287  return bRet;
288 }
289 
291  const SwSortOptions& rOpt )
292  : SwUndoRedline( SwUndoId::SORT_TXT, rRange ),
293  m_pOpt( new SwSortOptions( rOpt ) ),
294  m_nSaveEndNode( m_nEndNode ), m_nSaveEndContent( m_nEndContent )
295 {
296 }
297 
299 {
300 }
301 
303 {
304  // rPam contains the sorted range
305  // aSaveRange contains copied (i.e. original) range
306 
307  SwPosition *const pStart = rPam.Start();
308  SwPosition *const pEnd = rPam.End();
309 
310  SwNodeIndex aPrevIdx( pStart->nNode, -1 );
311  sal_uLong nOffsetTemp = pEnd->nNode.GetIndex() - pStart->nNode.GetIndex();
312 
314  {
315  // Search both Redline objects and make them visible to make the nodes
316  // consistent again. The 'delete' one is hidden, thus search for the
317  // 'insert' Redline object. The former is located directly after the latter.
319  *rDoc.GetNodes()[ m_nSttNode + 1 ],
320  RedlineType::Insert );
321  OSL_ENSURE( SwRedlineTable::npos != nFnd && nFnd+1 < rDoc.getIDocumentRedlineAccess().GetRedlineTable().size(),
322  "could not find an Insert object" );
323  ++nFnd;
324  rDoc.getIDocumentRedlineAccess().GetRedlineTable()[nFnd]->Show(1, nFnd);
325  }
326 
327  {
328  SwPaM aTmp( *rPam.GetMark() );
329  aTmp.GetMark()->nContent = 0;
330  aTmp.SetMark();
331  aTmp.GetPoint()->nNode = m_nSaveEndNode;
332  aTmp.GetPoint()->nContent.Assign( aTmp.GetContentNode(), m_nSaveEndContent );
333  rDoc.getIDocumentRedlineAccess().DeleteRedline( aTmp, true, RedlineType::Any );
334  }
335 
337 
338  SwPaM *const pPam = & rPam;
339  pPam->DeleteMark();
340  pPam->GetPoint()->nNode.Assign( aPrevIdx.GetNode(), +1 );
341  SwContentNode* pCNd = pPam->GetContentNode();
342  pPam->GetPoint()->nContent.Assign(pCNd, 0 );
343  pPam->SetMark();
344 
345  pPam->GetPoint()->nNode += nOffsetTemp;
346  pCNd = pPam->GetContentNode();
347  pPam->GetPoint()->nContent.Assign( pCNd, pCNd->Len() );
348 
349  SetValues( *pPam );
350 
351  SetPaM(rPam);
352 }
353 
355 {
356  SwPaM* pPam = &rPam;
357  SwPosition* pStart = pPam->Start();
358  SwPosition* pEnd = pPam->End();
359 
360  SwNodeIndex aPrevIdx( pStart->nNode, -1 );
361  sal_uLong nOffsetTemp = pEnd->nNode.GetIndex() - pStart->nNode.GetIndex();
362  const sal_Int32 nCntStt = pStart->nContent.GetIndex();
363 
364  rDoc.SortText(rPam, *m_pOpt);
365 
366  pPam->DeleteMark();
367  pPam->GetPoint()->nNode.Assign( aPrevIdx.GetNode(), +1 );
368  SwContentNode* pCNd = pPam->GetContentNode();
369  sal_Int32 nLen = pCNd->Len();
370  if( nLen > nCntStt )
371  nLen = nCntStt;
372  pPam->GetPoint()->nContent.Assign(pCNd, nLen );
373  pPam->SetMark();
374 
375  pPam->GetPoint()->nNode += nOffsetTemp;
376  pCNd = pPam->GetContentNode();
377  pPam->GetPoint()->nContent.Assign( pCNd, pCNd->Len() );
378 
379  SetValues( rPam );
380 
381  SetPaM( rPam );
382  rPam.GetPoint()->nNode = m_nSaveEndNode;
384 }
385 
387 {
388  rContext.GetDoc().SortText( rContext.GetRepeatPaM(), *m_pOpt );
389 }
390 
392 {
393  const SwPosition& rPos = *rRange.End();
394  m_nSaveEndNode = rPos.nNode.GetIndex();
396 }
397 
400 {
401 }
402 
404 {
405  rDoc.getIDocumentRedlineAccess().AcceptRedline(rPam, false);
406 }
407 
409 {
410  rContext.GetDoc().getIDocumentRedlineAccess().AcceptRedline(rContext.GetRepeatPaM(), true);
411 }
412 
415 {
416 }
417 
419 {
420  rDoc.getIDocumentRedlineAccess().RejectRedline(rPam, false);
421 }
422 
424 {
425  rContext.GetDoc().getIDocumentRedlineAccess().RejectRedline(rContext.GetRepeatPaM(), true);
426 }
427 
428 SwUndoCompDoc::SwUndoCompDoc( const SwPaM& rRg, bool bIns )
429  : SwUndo( SwUndoId::COMPAREDOC, &rRg.GetDoc() ), SwUndRng( rRg ),
430  m_bInsert( bIns )
431 {
432  SwDoc& rDoc = rRg.GetDoc();
434  {
435  RedlineType eTyp = m_bInsert ? RedlineType::Insert : RedlineType::Delete;
438  }
439 }
440 
442  : SwUndo( SwUndoId::COMPAREDOC, &rRedl.GetDoc() ), SwUndRng( rRedl ),
443  // for MergeDoc the corresponding inverse is needed
444  m_bInsert( RedlineType::Delete == rRedl.GetType() )
445 {
446  SwDoc& rDoc = rRedl.GetDoc();
448  {
449  m_pRedlineData.reset( new SwRedlineData( rRedl.GetRedlineData() ) );
451  }
452 
454  if( !FillSaveData( rRedl, *m_pRedlineSaveDatas, false ))
455  {
456  m_pRedlineSaveDatas.reset();
457  }
458 }
459 
461 {
462  m_pRedlineData.reset();
463  m_pUndoDelete.reset();
464  m_pUndoDelete2.reset();
465  m_pRedlineSaveDatas.reset();
466 }
467 
469 {
470  SwDoc& rDoc = rContext.GetDoc();
471  SwPaM& rPam(AddUndoRedoPaM(rContext));
472 
473  if( !m_bInsert )
474  {
475  // delete Redlines
478 
479  rDoc.getIDocumentRedlineAccess().DeleteRedline(rPam, true, RedlineType::Any);
480 
482 
483  // per definition Point is end (in SwUndRng!)
484  SwContentNode* pCSttNd = rPam.GetContentNode(false);
485  SwContentNode* pCEndNd = rPam.GetContentNode();
486 
487  // if start- and end-content is zero, then the doc-compare moves
488  // complete nodes into the current doc. And then the selection
489  // must be from end to start, so the delete join into the right
490  // direction.
491  if( !m_nSttContent && !m_nEndContent )
492  rPam.Exchange();
493 
494  bool bJoinText, bJoinPrev;
495  sw_GetJoinFlags(rPam, bJoinText, bJoinPrev);
496 
497  m_pUndoDelete.reset( new SwUndoDelete(rPam, false) );
498 
499  if( bJoinText )
500  sw_JoinText(rPam, bJoinPrev);
501 
502  if( pCSttNd && !pCEndNd)
503  {
504  // #112139# Do not step behind the end of content.
505  SwNode & rTmp = rPam.GetNode();
506  SwNode * pEnd = rDoc.GetNodes().DocumentSectionEndNode(&rTmp);
507 
508  if (&rTmp != pEnd)
509  {
510  rPam.SetMark();
511  ++rPam.GetPoint()->nNode;
512  rPam.GetBound().nContent.Assign( nullptr, 0 );
513  rPam.GetBound( false ).nContent.Assign( nullptr, 0 );
514  m_pUndoDelete2.reset( new SwUndoDelete(rPam, true) );
515  }
516  }
517  rPam.DeleteMark();
518  }
519  else
520  {
522  {
523  rDoc.getIDocumentRedlineAccess().DeleteRedline(rPam, true, RedlineType::Any);
524 
525  if( m_pRedlineSaveDatas )
527  }
528  SetPaM(rPam, true);
529  }
530 }
531 
533 {
534  SwDoc& rDoc = rContext.GetDoc();
535 
536  if( m_bInsert )
537  {
538  SwPaM& rPam(AddUndoRedoPaM(rContext));
540  {
541  SwRangeRedline* pTmp = new SwRangeRedline(*m_pRedlineData, rPam);
544  }
545  else if( !( RedlineFlags::Ignore & GetRedlineFlags() ) &&
547  {
549  }
550  SetPaM(rPam, true);
551  }
552  else
553  {
554  if( m_pUndoDelete2 )
555  {
556  m_pUndoDelete2->UndoImpl(rContext);
557  m_pUndoDelete2.reset();
558  }
559  m_pUndoDelete->UndoImpl(rContext);
560  m_pUndoDelete.reset();
561 
562  // note: don't call SetPaM before executing Undo of members
563  SwPaM& rPam(AddUndoRedoPaM(rContext));
564 
565  SwRangeRedline* pTmp = new SwRangeRedline(*m_pRedlineData, rPam);
568 
569  SetPaM(rPam, true);
570  }
571 }
572 
573 /* 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:109
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:423
void Show(sal_uInt16 nLoop, size_t nMyPos, bool bForced=false)
Definition: docredln.cxx:1119
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:215
std::unique_ptr< SwRedlineSaveDatas > mpRedlSaveData
Definition: UndoRedline.hxx:36
SwUndoId
Definition: swundo.hxx:29
virtual void UndoImpl(::sw::UndoRedoContext &) override
Definition: unredln.cxx:468
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:247
sal_uIntPtr sal_uLong
SwPaM & GetRepeatPaM()
Definition: UndoCore.hxx:128
virtual ~SwUndoRedlineSort() override
Definition: unredln.cxx:298
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:460
void SetRedlineFlags(RedlineFlags eMode)
Definition: undobj.hxx:120
SwNode & GetNode() const
Definition: ndindex.hxx:119
SwNode * DocumentSectionEndNode(SwNode *pNode) const
Definition: nodes.cxx:2324
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:428
void SetRedlineText(const OUString &rText)
Definition: unredln.cxx:237
std::unique_ptr< SwRedlineData > m_pRedlineData
size_type size() const
Definition: docary.hxx:261
void SetValues(const SwPaM &rPam)
Definition: undobj.cxx:59
SwContentNode * GetContentNode(bool bPoint=true) const
Definition: pam.hxx:229
#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:260
static bool IsRedlineOn(const RedlineFlags eM)
SwDoc & GetDoc() const
Definition: UndoCore.hxx:126
sal_uLong GetIndex() const
Definition: ndindex.hxx:152
virtual void RedoRedlineImpl(SwDoc &rDoc, SwPaM &rPam) override
Definition: unredln.cxx:418
static bool CanRedlineGroup(SwRedlineSaveDatas &rCurr, const SwRedlineSaveDatas &rCheck, bool bCurrIsEnd)
Definition: undobj.cxx:1498
bool CanGrouping(const SwUndoRedlineDelete &rPrev)
Definition: unredln.cxx:256
RedlineFlags on.
SwDoc & GetDoc() const
Definition: UndoCore.hxx:94
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:1828
virtual void RepeatImpl(::sw::RepeatContext &) override
Definition: unredln.cxx:408
virtual std::size_t GetRedlineAuthor()=0
void InvalidateRange(Invalidation)
Initiate the layout.
Definition: docredln.cxx:1252
bool SortText(const SwPaM &, const SwSortOptions &)
Sort Text in the Document.
Definition: docsort.cxx:282
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:601
void SetSaveRange(const SwPaM &rRange)
Definition: unredln.cxx:391
static bool HasHiddenRedlines(const SwRedlineSaveDatas &rSData)
Definition: undobj.cxx:1490
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:41
virtual void RedoImpl(::sw::UndoRedoContext &) override
Definition: unredln.cxx:532
SwUndoRedlineDelete(const SwPaM &rRange, SwUndoId nUserId)
Definition: unredln.cxx:201
static void SetSaveData(SwDoc &rDoc, SwRedlineSaveDatas &rSData)
Definition: undobj.cxx:1471
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:27
virtual void RedoRedlineImpl(SwDoc &rDoc, SwPaM &rPam) override
Definition: unredln.cxx:354
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:413
SwUndoRedlineSort(const SwPaM &rRange, const SwSortOptions &rOpt)
Definition: unredln.cxx:290
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:168
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:398
IDocumentRedlineAccess const & getIDocumentRedlineAccess() const
Definition: doc.cxx:335
virtual void RedoRedlineImpl(SwDoc &rDoc, SwPaM &rPam) override
Definition: unredln.cxx:403
void SetPaM(SwPaM &, bool bCorrToContent=false) const
Definition: undobj.cxx:81
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:1530
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:196
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:1406
virtual bool RejectRedline(SwRedlineTable::size_type nPos, bool bCallDelete)=0
virtual SwRewriter GetRewriter() const override
Returns the rewriter for this object.
Definition: unredln.cxx:225
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:161
OUString SwResId(std::string_view aId)
Definition: swmodule.cxx:165
std::unique_ptr< SwUndoDelete > m_pUndoDelete2
virtual void UndoRedlineImpl(SwDoc &rDoc, SwPaM &rPam)
Definition: unredln.cxx:191
CharClass & GetAppCharClass()
Definition: init.cxx:702
static constexpr size_type npos
Definition: docary.hxx:224
aStr
virtual void RepeatImpl(::sw::RepeatContext &) override
Definition: unredln.cxx:386
sal_Int32 m_nSaveEndContent
Definition: UndoRedline.hxx:82
sal_Int32 m_nSttContent
Definition: undobj.hxx:231
const int nUndoStringLength
Definition: UndoCore.hxx:224
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
Definition: ndtxt.hxx:850
virtual void UndoRedlineImpl(SwDoc &rDoc, SwPaM &rPam) override
Definition: unredln.cxx:302
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:242