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>
24#include <doc.hxx>
26#include <swundo.hxx>
27#include <pam.hxx>
28#include <ndtxt.hxx>
29#include <txtfrm.hxx>
30#include <mvsave.hxx>
31#include <rolbck.hxx>
32#include <UndoCore.hxx>
33#include <UndoDelete.hxx>
34#include <strings.hrc>
35#include <redline.hxx>
36#include <docary.hxx>
37#include <sortopt.hxx>
38#include <docedt.hxx>
39
41 : SwUndo( SwUndoId::REDLINE, &rRange.GetDoc() ), SwUndRng( rRange ),
42 mnUserId( nUsrId ),
43 mbHiddenRedlines( false )
44{
45 // consider Redline
46 SwDoc& rDoc = rRange.GetDoc();
48 {
49 switch( mnUserId )
50 {
53 mpRedlData.reset( new SwRedlineData( RedlineType::Delete, rDoc.getIDocumentRedlineAccess().GetRedlineAuthor() ) );
54 break;
55 default:
56 ;
57 }
59 }
60
61 SwNodeOffset nEndExtra = rDoc.GetNodes().GetEndOfExtras().GetIndex();
62
65 {
66 mpRedlSaveData.reset();
67 }
68 else
69 {
71 if( mbHiddenRedlines ) // then the NodeIndices of SwUndRng need to be corrected
72 {
73 nEndExtra -= rDoc.GetNodes().GetEndOfExtras().GetIndex();
74 m_nSttNode -= nEndExtra;
75 m_nEndNode -= nEndExtra;
76 }
77 }
78}
79
81{
82 mpRedlData.reset();
83 mpRedlSaveData.reset();
84}
85
87{
88 return mpRedlSaveData ? mpRedlSaveData->size() : 0;
89}
90
92{
93 SwDoc& rDoc = rContext.GetDoc();
94 SwPaM& rPam(AddUndoRedoPaM(rContext));
95
96 // fix PaM for deletions shown in margin
97 bool bIsDeletion = dynamic_cast<SwUndoRedlineDelete*>(this);
99 sal_uInt32 nMaxId = SAL_MAX_UINT32;
100 if ( bIsDeletion && rTable.size() > 0 )
101 {
102 // Nodes of the deletion range are in the newest invisible redlines.
103 // Set all redlines visible and recover the original deletion range.
104 for (SwNodeOffset nNodes(0); nNodes < m_nEndNode - m_nSttNode + 1; ++nNodes)
105 {
106 SwRedlineTable::size_type nCurRedlinePos = 0;
107 SwRangeRedline * pRedline(rTable[nCurRedlinePos]);
108
109 // search last but nNodes redline by its nth biggest id
110 for( SwRedlineTable::size_type n = 1; n < rTable.size(); ++n )
111 {
112 SwRangeRedline *pRed(rTable[n]);
113 if ( !pRed->HasMark() && pRedline->GetId() < pRed->GetId() && pRed->GetId() < nMaxId )
114 {
115 nCurRedlinePos = n;
116 pRedline = pRed;
117 }
118 }
119
120 nMaxId = pRedline->GetId();
121
122 if ( !pRedline->IsVisible() && !pRedline->HasMark() )
123 {
124 // set it visible
125 pRedline->Show(0, rTable.GetPos(pRedline), /*bForced=*/true);
126 pRedline->Show(1, rTable.GetPos(pRedline), /*bForced=*/true);
127
128 // extend the range
129 if ( nNodes == SwNodeOffset(0) )
130 rPam = *pRedline;
131 else
132 {
133 rPam.SetMark();
134 *rPam.GetMark() = *pRedline->GetMark();
135 }
136 }
137 }
138 }
139
140 UndoRedlineImpl(rDoc, rPam);
141
142 if( mpRedlSaveData )
143 {
144 SwNodeOffset nEndExtra = rDoc.GetNodes().GetEndOfExtras().GetIndex();
146 if( mbHiddenRedlines )
147 {
148 mpRedlSaveData->clear();
149
150 nEndExtra = rDoc.GetNodes().GetEndOfExtras().GetIndex() - nEndExtra;
151 m_nSttNode += nEndExtra;
152 m_nEndNode += nEndExtra;
153 }
154 SetPaM(rPam, true);
155 }
156
157 // update frames after calling SetSaveData
158 if ( bIsDeletion )
159 {
161 }
162 else if (dynamic_cast<SwUndoAcceptRedline*>(this)
163 || dynamic_cast<SwUndoRejectRedline*>(this))
164 { // (can't check here if there's a delete redline being accepted)
166 }
167}
168
170{
171 SwDoc& rDoc = rContext.GetDoc();
174
175 SwPaM & rPam( AddUndoRedoPaM(rContext) );
177 {
178 SwNodeOffset nEndExtra = rDoc.GetNodes().GetEndOfExtras().GetIndex();
180
181 nEndExtra -= rDoc.GetNodes().GetEndOfExtras().GetIndex();
182 m_nSttNode -= nEndExtra;
183 m_nEndNode -= nEndExtra;
184 }
185
186 RedoRedlineImpl(rDoc, rPam);
187
188 SetPaM(rPam, true);
190}
191
193{
194}
195
196// default: remove redlines
198{
199 rDoc.getIDocumentRedlineAccess().DeleteRedline(rPam, true, RedlineType::Any);
200}
201
203 const SwPaM& rRange, SwUndoId const nUsrId, SwDeleteFlags const flags)
204 : SwUndoRedline( nUsrId != SwUndoId::EMPTY ? nUsrId : SwUndoId::DELETE, rRange ),
205 m_bCanGroup( false ), m_bIsDelim( false ), m_bIsBackspace( false )
206{
207 const SwTextNode* pTNd;
208 SetRedlineText(rRange.GetText());
209 if( SwUndoId::DELETE == mnUserId &&
211 nullptr != (pTNd = rRange.GetPointNode().GetTextNode()) )
212 {
213 sal_Unicode const cCh = pTNd->GetText()[m_nSttContent];
214 if( CH_TXTATR_BREAKWORD != cCh && CH_TXTATR_INWORD != cCh )
215 {
216 m_bCanGroup = true;
220 }
221 }
222
223 m_bCacheComment = false;
225 {
226 InitHistory(rRange);
227 }
228}
229
231{
232 m_pHistory.reset(new SwHistory);
233 // try to rely on direction of rPam here so it works for
234 // backspacing/deleting consecutive characters
235 SaveFlyArr flys;
236 SaveFlyInRange(rRedline, *rRedline.GetMark(), flys, false, m_pHistory.get());
237 RestFlyInRange(flys, *rRedline.GetPoint(), &rRedline.GetPoint()->GetNode(), true);
238 if (m_pHistory->Count())
239 {
240 m_bCanGroup = false; // how to group history?
241 }
242}
243
244// bit of a hack, replace everything...
246{
247 SwRewriter aResult;
250 SwRewriter aRewriter;
251 aRewriter.AddRule(UndoArg1, aStr);
252 OUString ret = aRewriter.Apply(SwResId(STR_UNDO_REDLINE_DELETE));
253 aResult.AddRule(UndoArg1, ret);
254 return aResult;
255}
256
257void SwUndoRedlineDelete::SetRedlineText(const OUString & rText)
258{
259 m_sRedlineText = rText;
260}
261
263{
264 rDoc.getIDocumentRedlineAccess().DeleteRedline(rPam, true, RedlineType::Any);
265 if (m_pHistory)
266 {
267 m_pHistory->TmpRollback(&rDoc, 0);
268 }
269}
270
272{
273 if (rPam.GetPoint() != rPam.GetMark())
274 {
275 if (m_pHistory) // if it was created before, it must be recreated now
276 {
277 rPam.Normalize(m_bIsBackspace); // to check the correct edge
278 InitHistory(rPam);
279 }
281 }
283}
284
286{
287 bool bRet = false;
288 if( SwUndoId::DELETE == mnUserId && mnUserId == rNext.mnUserId &&
289 m_bCanGroup && rNext.m_bCanGroup &&
290 m_bIsDelim == rNext.m_bIsDelim &&
293 rNext.m_nSttNode == m_nSttNode &&
294 rNext.m_nEndNode == m_nEndNode )
295 {
296 int bIsEnd = 0;
297 if( rNext.m_nSttContent == m_nEndContent )
298 bIsEnd = 1;
299 else if( rNext.m_nEndContent == m_nSttContent )
300 bIsEnd = -1;
301
302 if( bIsEnd &&
303 (( !mpRedlSaveData && !rNext.mpRedlSaveData ) ||
304 ( mpRedlSaveData && rNext.mpRedlSaveData &&
306 *rNext.mpRedlSaveData, 1 != bIsEnd )
307 )))
308 {
309 if( 1 == bIsEnd )
311 else
313 bRet = true;
314 }
315 }
316 return bRet;
317}
318
320 const SwSortOptions& rOpt )
321 : SwUndoRedline( SwUndoId::SORT_TXT, rRange ),
322 m_pOpt( new SwSortOptions( rOpt ) ),
323 m_nSaveEndNode( m_nEndNode ), m_nSaveEndContent( m_nEndContent )
324{
325}
326
328{
329}
330
332{
333 // rPam contains the sorted range
334 // aSaveRange contains copied (i.e. original) range
335
336 auto [pStart, pEnd] = rPam.StartEnd(); // SwPosition*
337
338 SwNodeIndex aPrevIdx( pStart->GetNode(), -1 );
339 SwNodeOffset nOffsetTemp = pEnd->GetNodeIndex() - pStart->GetNodeIndex();
340
342 {
343 // Search both Redline objects and make them visible to make the nodes
344 // consistent again. The 'delete' one is hidden, thus search for the
345 // 'insert' Redline object. The former is located directly after the latter.
347 *rDoc.GetNodes()[ m_nSttNode + 1 ],
348 RedlineType::Insert );
349 OSL_ENSURE( SwRedlineTable::npos != nFnd && nFnd+1 < rDoc.getIDocumentRedlineAccess().GetRedlineTable().size(),
350 "could not find an Insert object" );
351 ++nFnd;
352 rDoc.getIDocumentRedlineAccess().GetRedlineTable()[nFnd]->Show(1, nFnd);
353 }
354
355 {
356 SwPaM aTmp( rPam.GetMark()->GetNode() );
357 aTmp.SetMark();
359 rDoc.getIDocumentRedlineAccess().DeleteRedline( aTmp, true, RedlineType::Any );
360 }
361
363
364 SwPaM *const pPam = & rPam;
365 pPam->DeleteMark();
366 pPam->GetPoint()->Assign( aPrevIdx.GetNode(), SwNodeOffset(+1) );
367 pPam->SetMark();
368
369 pPam->GetPoint()->Adjust(nOffsetTemp);
370 SwContentNode* pCNd = pPam->GetPointContentNode();
371 pPam->GetPoint()->SetContent( pCNd->Len() );
372
373 SetValues( *pPam );
374
375 SetPaM(rPam);
376}
377
379{
380 SwPaM* pPam = &rPam;
381 auto [pStart, pEnd] = pPam->StartEnd(); // SwPosition*
382
383 SwNodeIndex aPrevIdx( pStart->GetNode(), -1 );
384 SwNodeOffset nOffsetTemp = pEnd->GetNodeIndex() - pStart->GetNodeIndex();
385 const sal_Int32 nCntStt = pStart->GetContentIndex();
386
387 rDoc.SortText(rPam, *m_pOpt);
388
389 pPam->DeleteMark();
390 pPam->GetPoint()->Assign( aPrevIdx.GetNode(), SwNodeOffset(+1) );
391 SwContentNode* pCNd = pPam->GetPointContentNode();
392 sal_Int32 nLen = pCNd->Len();
393 if( nLen > nCntStt )
394 nLen = nCntStt;
395 pPam->GetPoint()->SetContent( nLen );
396 pPam->SetMark();
397
398 pPam->GetPoint()->Adjust(nOffsetTemp);
399 pCNd = pPam->GetPointContentNode();
400 pPam->GetPoint()->SetContent( pCNd->Len() );
401
402 SetValues( rPam );
403
404 SetPaM( rPam );
406}
407
409{
410 rContext.GetDoc().SortText( rContext.GetRepeatPaM(), *m_pOpt );
411}
412
414{
415 const SwPosition& rPos = *rRange.End();
418}
419
422{
423}
424
426{
427 rDoc.getIDocumentRedlineAccess().AcceptRedline(rPam, false);
428}
429
431{
432 rContext.GetDoc().getIDocumentRedlineAccess().AcceptRedline(rContext.GetRepeatPaM(), true);
433}
434
437{
438}
439
441{
442 rDoc.getIDocumentRedlineAccess().RejectRedline(rPam, false);
443}
444
446{
447 rContext.GetDoc().getIDocumentRedlineAccess().RejectRedline(rContext.GetRepeatPaM(), true);
448}
449
450SwUndoCompDoc::SwUndoCompDoc( const SwPaM& rRg, bool bIns )
451 : SwUndo( SwUndoId::COMPAREDOC, &rRg.GetDoc() ), SwUndRng( rRg ),
452 m_bInsert( bIns )
453{
454 SwDoc& rDoc = rRg.GetDoc();
456 {
457 RedlineType eTyp = m_bInsert ? RedlineType::Insert : RedlineType::Delete;
460 }
461}
462
464 : SwUndo( SwUndoId::COMPAREDOC, &rRedl.GetDoc() ), SwUndRng( rRedl ),
465 // for MergeDoc the corresponding inverse is needed
466 m_bInsert( RedlineType::Delete == rRedl.GetType() )
467{
468 SwDoc& rDoc = rRedl.GetDoc();
470 {
471 m_pRedlineData.reset( new SwRedlineData( rRedl.GetRedlineData() ) );
473 }
474
476 if( !FillSaveData( rRedl, *m_pRedlineSaveDatas, false ))
477 {
478 m_pRedlineSaveDatas.reset();
479 }
480}
481
483{
484 m_pRedlineData.reset();
485 m_pUndoDelete.reset();
486 m_pUndoDelete2.reset();
487 m_pRedlineSaveDatas.reset();
488}
489
491{
492 SwDoc& rDoc = rContext.GetDoc();
493 SwPaM& rPam(AddUndoRedoPaM(rContext));
494
495 if( !m_bInsert )
496 {
497 // delete Redlines
500
501 rDoc.getIDocumentRedlineAccess().DeleteRedline(rPam, true, RedlineType::Any);
502
504
505 // per definition Point is end (in SwUndRng!)
506 SwContentNode* pCSttNd = rPam.GetMarkContentNode();
507 SwContentNode* pCEndNd = rPam.GetPointContentNode();
508
509 // if start- and end-content is zero, then the doc-compare moves
510 // complete nodes into the current doc. And then the selection
511 // must be from end to start, so the delete join into the right
512 // direction.
514 rPam.Exchange();
515
516 bool bJoinText, bJoinPrev;
517 sw_GetJoinFlags(rPam, bJoinText, bJoinPrev);
518
519 m_pUndoDelete.reset(new SwUndoDelete(rPam, SwDeleteFlags::Default, false));
520
521 if( bJoinText )
522 sw_JoinText(rPam, bJoinPrev);
523
524 if( pCSttNd && !pCEndNd)
525 {
526 // #112139# Do not step behind the end of content.
527 SwNode & rTmp = rPam.GetPointNode();
528 SwNode * pEnd = rDoc.GetNodes().DocumentSectionEndNode(&rTmp);
529
530 if (&rTmp != pEnd)
531 {
532 rPam.SetMark();
533 rPam.GetPoint()->Adjust(SwNodeOffset(1));
534 m_pUndoDelete2.reset(new SwUndoDelete(rPam, SwDeleteFlags::Default, true));
535 }
536 }
537 rPam.DeleteMark();
538 }
539 else
540 {
542 {
543 rDoc.getIDocumentRedlineAccess().DeleteRedline(rPam, true, RedlineType::Any);
544
547 }
548 SetPaM(rPam, true);
549 }
550}
551
553{
554 SwDoc& rDoc = rContext.GetDoc();
555
556 if( m_bInsert )
557 {
558 SwPaM& rPam(AddUndoRedoPaM(rContext));
560 {
561 SwRangeRedline* pTmp = new SwRangeRedline(*m_pRedlineData, rPam);
564 }
565 else if( !( RedlineFlags::Ignore & GetRedlineFlags() ) &&
567 {
569 }
570 SetPaM(rPam, true);
571 }
572 else
573 {
574 if( m_pUndoDelete2 )
575 {
576 m_pUndoDelete2->UndoImpl(rContext);
577 m_pUndoDelete2.reset();
578 }
579 m_pUndoDelete->UndoImpl(rContext);
580 m_pUndoDelete.reset();
581
582 // note: don't call SetPaM before executing Undo of members
583 SwPaM& rPam(AddUndoRedoPaM(rContext));
584
585 SwRangeRedline* pTmp = new SwRangeRedline(*m_pRedlineData, rPam);
588
589 SetPaM(rPam, true);
590 }
591}
592
593/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
@ ArtificialSelection
keyboard delete, artificial selection, avoid deleting flys
@ ShowDelete
show all deletes
@ On
RedlineFlags on.
@ Ignore
ignore Redlines
@ UndoArg1
Definition: SwRewriter.hxx:29
OUString DenoteSpecialCharacters(const OUString &rStr, bool bQuoted=true)
Denotes special characters in a string.
Definition: undel.cxx:719
const int nUndoStringLength
Definition: UndoCore.hxx:243
OUString ShortenString(const OUString &rStr, sal_Int32 nLength, const OUString &rFillStr)
Shortens a string to a maximum length.
Definition: undobj.cxx:1538
bool isLetterNumeric(const OUString &rStr, sal_Int32 nPos) const
virtual bool DelFullPara(SwPaM &)=0
Delete full paragraphs.
virtual bool IsRedlineOn() const =0
Query if redlining is on.
virtual bool DeleteRedline(const SwPaM &rPam, bool bSaveInUndo, RedlineType nDelType)=0
static bool IsRedlineOn(const RedlineFlags eM)
virtual bool RejectRedline(SwRedlineTable::size_type nPos, bool bCallDelete)=0
virtual std::size_t GetRedlineAuthor()=0
virtual bool SplitRedline(const SwPaM &rPam)=0
virtual SwRedlineTable::size_type GetRedlinePos(const SwNode &rNode, RedlineType nType) const =0
virtual void SetRedlineFlags_intern(RedlineFlags eMode)=0
Set a new redline mode.
virtual const SwRedlineTable & GetRedlineTable() const =0
virtual AppendResult AppendRedline(SwRangeRedline *pNewRedl, bool bCallDelete)=0
Append a new redline.
virtual RedlineFlags GetRedlineFlags() const =0
Query the currently set redline mode.
virtual bool AcceptRedline(SwRedlineTable::size_type nPos, bool bCallDelete)=0
virtual sal_Int32 Len() const
Definition: node.cxx:1257
Definition: doc.hxx:192
bool SortText(const SwPaM &, const SwSortOptions &)
Sort Text in the Document.
Definition: docsort.cxx:283
IDocumentContentOperations const & getIDocumentContentOperations() const
Definition: doc.cxx:316
SwNodes & GetNodes()
Definition: doc.hxx:413
IDocumentRedlineAccess const & getIDocumentRedlineAccess() const
Definition: doc.cxx:336
Marks a node in the document model.
Definition: ndindex.hxx:31
SwNode & GetNode() const
Definition: ndindex.hxx:136
Base class of the Writer document model elements.
Definition: node.hxx:84
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
Definition: ndtxt.hxx:877
SwNodeOffset GetIndex() const
Definition: node.hxx:296
SwNode * DocumentSectionEndNode(SwNode *pNode) const
Definition: nodes.cxx:2526
SwNode & GetEndOfExtras() const
This is the last EndNode of a special section.
Definition: ndarr.hxx:163
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:187
const SwPosition * GetMark() const
Definition: pam.hxx:263
SwNode & GetPointNode() const
Definition: pam.hxx:283
virtual void SetMark()
Unless this is called, the getter method of Mark will return Point.
Definition: pam.cxx:642
void Exchange()
Definition: pam.cxx:656
void Normalize(bool bPointFirst=true)
Normalizes PaM, i.e.
Definition: pam.cxx:700
std::pair< const SwPosition *, const SwPosition * > StartEnd() const
Because sometimes the cost of the operator<= can add up.
Definition: pam.hxx:277
SwContentNode * GetPointContentNode() const
Definition: pam.hxx:287
const SwPosition * End() const
Definition: pam.hxx:271
SwContentNode * GetMarkContentNode() const
Definition: pam.hxx:288
SwDoc & GetDoc() const
Definition: pam.hxx:299
OUString GetText() const
Definition: pam.cxx:1278
void DeleteMark()
Definition: pam.hxx:231
const SwPosition * GetPoint() const
Definition: pam.hxx:261
bool HasMark() const
A PaM marks a selection if Point and Mark are distinct positions.
Definition: pam.hxx:259
sal_uInt32 GetId() const
Definition: redline.hxx:188
void Show(sal_uInt16 nLoop, size_t nMyPos, bool bForced=false)
Definition: docredln.cxx:1249
void InvalidateRange(Invalidation)
Initiate the layout.
Definition: docredln.cxx:1382
bool IsVisible() const
Definition: redline.hxx:194
const SwRedlineData & GetRedlineData(sal_uInt16 nPos=0) const
Definition: docredln.cxx:1957
bool empty() const
Definition: docary.hxx:266
bool Insert(SwRangeRedline *&p)
Definition: docredln.cxx:413
static constexpr size_type npos
Definition: docary.hxx:223
size_type size() const
Definition: docary.hxx:267
vector_type::size_type size_type
Definition: docary.hxx:222
size_type GetPos(const SwRangeRedline *p) const
Definition: docredln.cxx:619
void AddRule(SwUndoArg eWhat, const OUString &rWith)
Definition: SwRewriter.cxx:25
OUString Apply(const OUString &rStr) const
Definition: SwRewriter.cxx:39
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:89
const OUString & GetText() const
Definition: ndtxt.hxx:227
SwPaM & AddUndoRedoPaM(::sw::UndoRedoContext &, bool const bCorrToContent=false) const
Definition: undobj.cxx:100
void SetPaM(SwPaM &, bool bCorrToContent=false) const
Definition: undobj.cxx:80
sal_Int32 m_nSttContent
Definition: undobj.hxx:232
SwNodeOffset m_nSttNode
Definition: undobj.hxx:231
SwNodeOffset m_nEndNode
Definition: undobj.hxx:231
sal_Int32 m_nEndContent
Definition: undobj.hxx:232
void SetValues(const SwPaM &rPam)
Definition: undobj.cxx:60
Undo for Edit -> track changes -> accept.
virtual void RepeatImpl(::sw::RepeatContext &) override
Definition: unredln.cxx:430
virtual void RedoRedlineImpl(SwDoc &rDoc, SwPaM &rPam) override
Definition: unredln.cxx:425
SwUndoAcceptRedline(const SwPaM &rRange)
Definition: unredln.cxx:420
std::unique_ptr< SwRedlineSaveDatas > m_pRedlineSaveDatas
virtual void RedoImpl(::sw::UndoRedoContext &) override
Definition: unredln.cxx:552
std::unique_ptr< SwUndoDelete > m_pUndoDelete
std::unique_ptr< SwUndoDelete > m_pUndoDelete2
SwUndoCompDoc(const SwPaM &rRg, bool bIns)
Definition: unredln.cxx:450
virtual ~SwUndoCompDoc() override
Definition: unredln.cxx:482
virtual void UndoImpl(::sw::UndoRedoContext &) override
Definition: unredln.cxx:490
std::unique_ptr< SwRedlineData > m_pRedlineData
bool CanGrouping(const SwUndoRedlineDelete &rPrev)
Definition: unredln.cxx:285
std::unique_ptr< SwHistory > m_pHistory
for moved fly anchors
Definition: UndoRedline.hxx:57
void InitHistory(SwPaM const &rRange)
Definition: unredln.cxx:230
virtual void RedoRedlineImpl(SwDoc &rDoc, SwPaM &rPam) override
Definition: unredln.cxx:271
virtual void UndoRedlineImpl(SwDoc &rDoc, SwPaM &rPam) override
Definition: unredln.cxx:262
void SetRedlineText(const OUString &rText)
Definition: unredln.cxx:257
virtual SwRewriter GetRewriter() const override
Returns the rewriter for this object.
Definition: unredln.cxx:245
SwUndoRedlineDelete(const SwPaM &rRange, SwUndoId nUserId, SwDeleteFlags flags=SwDeleteFlags::Default)
Definition: unredln.cxx:202
sal_Int32 m_nSaveEndContent
Definition: UndoRedline.hxx:87
virtual void RedoRedlineImpl(SwDoc &rDoc, SwPaM &rPam) override
Definition: unredln.cxx:378
void SetSaveRange(const SwPaM &rRange)
Definition: unredln.cxx:413
std::unique_ptr< SwSortOptions > m_pOpt
Definition: UndoRedline.hxx:85
virtual void RepeatImpl(::sw::RepeatContext &) override
Definition: unredln.cxx:408
virtual void UndoRedlineImpl(SwDoc &rDoc, SwPaM &rPam) override
Definition: unredln.cxx:331
SwNodeOffset m_nSaveEndNode
Definition: UndoRedline.hxx:86
virtual ~SwUndoRedlineSort() override
Definition: unredln.cxx:327
SwUndoRedlineSort(const SwPaM &rRange, const SwSortOptions &rOpt)
Definition: unredln.cxx:319
virtual ~SwUndoRedline() override
Definition: unredln.cxx:80
SwUndoId mnUserId
Definition: UndoRedline.hxx:37
virtual void UndoImpl(::sw::UndoRedoContext &) override
Definition: unredln.cxx:91
std::unique_ptr< SwRedlineSaveDatas > mpRedlSaveData
Definition: UndoRedline.hxx:36
bool mbHiddenRedlines
Definition: UndoRedline.hxx:38
std::unique_ptr< SwRedlineData > mpRedlData
Definition: UndoRedline.hxx:35
virtual void RedoRedlineImpl(SwDoc &rDoc, SwPaM &rPam)
Definition: unredln.cxx:197
virtual void RedoImpl(::sw::UndoRedoContext &) override
Definition: unredln.cxx:169
sal_uInt16 GetRedlSaveCount() const
Definition: unredln.cxx:86
virtual void UndoRedlineImpl(SwDoc &rDoc, SwPaM &rPam)
Definition: unredln.cxx:192
SwUndoRedline(SwUndoId nUserId, const SwPaM &rRange)
Definition: unredln.cxx:40
virtual void RedoRedlineImpl(SwDoc &rDoc, SwPaM &rPam) override
Definition: unredln.cxx:440
SwUndoRejectRedline(const SwPaM &rRange)
Definition: unredln.cxx:435
virtual void RepeatImpl(::sw::RepeatContext &) override
Definition: unredln.cxx:445
void SetRedlineFlags(RedlineFlags eMode)
Definition: undobj.hxx:121
RedlineFlags GetRedlineFlags() const
Definition: undobj.hxx:120
static bool FillSaveData(const SwPaM &rRange, SwRedlineSaveDatas &rSData, bool bDelRange=true, bool bCopyNext=true)
Definition: undobj.cxx:1414
static bool HasHiddenRedlines(const SwRedlineSaveDatas &rSData)
Definition: undobj.cxx:1498
static void SetSaveData(SwDoc &rDoc, SwRedlineSaveDatas &rSData)
Definition: undobj.cxx:1478
static bool CanRedlineGroup(SwRedlineSaveDatas &rCurr, const SwRedlineSaveDatas &rCheck, bool bCurrIsEnd)
Definition: undobj.cxx:1506
bool m_bCacheComment
Definition: undobj.hxx:62
SwDoc & GetDoc() const
Definition: UndoCore.hxx:132
SwPaM & GetRepeatPaM()
Definition: UndoCore.hxx:134
SwDoc & GetDoc() const
Definition: UndoCore.hxx:95
RedlineType
bool sw_JoinText(SwPaM &rPam, bool bJoinPrev)
Definition: docedt.cxx:357
void sw_GetJoinFlags(SwPaM &rPam, bool &rJoinText, bool &rJoinPrev)
Definition: docedt.cxx:326
void SaveFlyInRange(const SwNodeRange &rRg, SaveFlyArr &rArr)
Definition: docedt.cxx:106
void RestFlyInRange(SaveFlyArr &rArr, const SwPosition &rStartPos, const SwNode *pInsertPos, bool const isForceToStartPos)
Definition: docedt.cxx:53
#define CH_TXTATR_INWORD
Definition: hintids.hxx:171
#define CH_TXTATR_BREAKWORD
Definition: hintids.hxx:170
CharClass & GetAppCharClass()
Definition: init.cxx:705
sal_Int64 n
aStr
std::deque< SaveFly > SaveFlyArr
Definition: mvsave.hxx:117
constexpr OUStringLiteral EMPTY
void UpdateFramesForRemoveDeleteRedline(SwDoc &rDoc, SwPaM const &rPam)
void UpdateFramesForAddDeleteRedline(SwDoc &rDoc, SwPaM const &rPam)
o3tl::strong_int< sal_Int32, struct Tag_SwNodeOffset > SwNodeOffset
Definition: nodeoffset.hxx:16
Marks a position in the document model.
Definition: pam.hxx:37
void Adjust(SwNodeOffset nDelta)
Adjust node position, and resets content position to zero.
Definition: pam.cxx:256
SwNode & GetNode() const
Definition: pam.hxx:80
void Assign(const SwNode &rNd, SwNodeOffset nDelta, sal_Int32 nContentOffset=0)
These all set both nNode and nContent.
Definition: pam.cxx:230
void SetContent(sal_Int32 nContentIndex)
Set content index, only valid to call this if the position points to a SwContentNode subclass.
Definition: pam.cxx:266
SwNodeOffset GetNodeIndex() const
Definition: pam.hxx:77
sal_Int32 GetContentIndex() const
Definition: pam.hxx:84
OUString SwResId(TranslateId aId)
Definition: swmodule.cxx:164
SwUndoId
Definition: swundo.hxx:30
@ REJECT_REDLINE
@ ACCEPT_REDLINE
sal_uInt16 sal_Unicode
#define SAL_MAX_UINT32