LibreOffice Module sw (master)  1
docredln.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 <libxml/xmlwriter.h>
21 #include <boost/property_tree/json_parser.hpp>
22 
23 #include <osl/diagnose.h>
24 #include <sal/log.hxx>
25 #include <tools/datetimeutils.hxx>
26 #include <hintids.hxx>
27 #include <svl/itemiter.hxx>
28 #include <comphelper/lok.hxx>
29 #include <comphelper/string.hxx>
30 #include <LibreOfficeKit/LibreOfficeKitEnums.h>
31 #include <unotools/datetime.hxx>
32 #include <sfx2/viewsh.hxx>
33 #include <o3tl/string_view.hxx>
34 #include <swmodule.hxx>
35 #include <doc.hxx>
36 #include <docredln.hxx>
37 #include <IDocumentUndoRedo.hxx>
40 #include <IDocumentState.hxx>
43 #include <docary.hxx>
44 #include <ndtxt.hxx>
45 #include <redline.hxx>
46 #include <UndoCore.hxx>
47 #include <hints.hxx>
48 #include <pamtyp.hxx>
49 #include <poolfmt.hxx>
50 #include <view.hxx>
51 #include <viewopt.hxx>
52 #include <usrpref.hxx>
53 #include <viewsh.hxx>
54 #include <viscrs.hxx>
55 #include <rootfrm.hxx>
56 #include <strings.hrc>
57 #include <swtypes.hxx>
58 #include <wrtsh.hxx>
59 #include <txtfld.hxx>
60 
61 #include <flowfrm.hxx>
62 #include <txtfrm.hxx>
63 
64 using namespace com::sun::star;
65 
66 #ifdef DBG_UTIL
67 
68  void sw_DebugRedline( const SwDoc* pDoc )
69  {
70  static SwRedlineTable::size_type nWatch = 0; // loplugin:constvars:ignore
72  for( SwRedlineTable::size_type n = 0; n < rTable.size(); ++n )
73  {
74  volatile SwRedlineTable::size_type nDummy = 0;
75  const SwRangeRedline* pCurrent = rTable[ n ];
76  const SwRangeRedline* pNext = n+1 < rTable.size() ? rTable[ n+1 ] : nullptr;
77  if( pCurrent == pNext )
78  (void) nDummy;
79  if( n == nWatch )
80  (void) nDummy; // Possible debugger breakpoint
81  }
82  }
83 
84 #endif
85 
86 
88 {
89  DeleteAndDestroyAll();
90 }
91 
93 {
94  (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SwExtraRedlineTable"));
95  (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("ptr"), "%p", this);
96 
97  for (sal_uInt16 nCurExtraRedlinePos = 0; nCurExtraRedlinePos < GetSize(); ++nCurExtraRedlinePos)
98  {
99  const SwExtraRedline* pExtraRedline = GetRedline(nCurExtraRedlinePos);
100  (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SwExtraRedline"));
101  (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("ptr"), "%p", this);
102  (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("symbol"), "%s", BAD_CAST(typeid(*pExtraRedline).name()));
103  (void)xmlTextWriterEndElement(pWriter);
104  }
105  (void)xmlTextWriterEndElement(pWriter);
106 }
107 
108 #if OSL_DEBUG_LEVEL > 0
109 static bool CheckPosition( const SwPosition* pStt, const SwPosition* pEnd )
110 {
111  int nError = 0;
112  SwNode* pSttNode = &pStt->nNode.GetNode();
113  SwNode* pEndNode = &pEnd->nNode.GetNode();
114  SwNode* pSttTab = pSttNode->StartOfSectionNode()->FindTableNode();
115  SwNode* pEndTab = pEndNode->StartOfSectionNode()->FindTableNode();
116  SwNode* pSttStart = pSttNode;
117  while( pSttStart && (!pSttStart->IsStartNode() || pSttStart->IsSectionNode() ||
118  pSttStart->IsTableNode() ) )
119  pSttStart = pSttStart->StartOfSectionNode();
120  SwNode* pEndStart = pEndNode;
121  while( pEndStart && (!pEndStart->IsStartNode() || pEndStart->IsSectionNode() ||
122  pEndStart->IsTableNode() ) )
123  pEndStart = pEndStart->StartOfSectionNode();
124  assert(pSttTab == pEndTab);
125  if( pSttTab != pEndTab )
126  nError = 1;
127  assert(pSttTab || pSttStart == pEndStart);
128  if( !pSttTab && pSttStart != pEndStart )
129  nError |= 2;
130  if( nError )
131  nError += 10;
132  return nError != 0;
133 }
134 #endif
135 
136 bool SwExtraRedlineTable::DeleteAllTableRedlines( SwDoc& rDoc, const SwTable& rTable, bool bSaveInUndo, RedlineType nRedlineTypeToDelete )
137 {
138  bool bChg = false;
139 
140  if (bSaveInUndo && rDoc.GetIDocumentUndoRedo().DoesUndo())
141  {
142  // #TODO - Add 'Undo' support for deleting 'Table Cell' redlines
143  /*
144  SwUndoRedline* pUndo = new SwUndoRedline( SwUndoId::REDLINE, rRange );
145  if( pUndo->GetRedlSaveCount() )
146  {
147  GetIDocumentUndoRedo().AppendUndo(pUndo);
148  }
149  else
150  delete pUndo;
151  */
152  }
153 
154  for (sal_uInt16 nCurRedlinePos = 0; nCurRedlinePos < GetSize(); )
155  {
156  SwExtraRedline* pExtraRedline = GetRedline(nCurRedlinePos);
157  const SwTableCellRedline* pTableCellRedline = dynamic_cast<const SwTableCellRedline*>(pExtraRedline);
158  if (pTableCellRedline)
159  {
160  const SwTableBox *pRedTabBox = &pTableCellRedline->GetTableBox();
161  const SwTable& rRedTable = pRedTabBox->GetSttNd()->FindTableNode()->GetTable();
162  if ( &rRedTable == &rTable )
163  {
164  // Redline for this table
165  const SwRedlineData& aRedlineData = pTableCellRedline->GetRedlineData();
166  const RedlineType nRedlineType = aRedlineData.GetType();
167 
168  // Check if this redline object type should be deleted
169  if (RedlineType::Any == nRedlineTypeToDelete || nRedlineTypeToDelete == nRedlineType)
170  {
171 
172  DeleteAndDestroy( nCurRedlinePos );
173  bChg = true;
174  continue; // don't increment position after delete
175  }
176  }
177  }
178  ++nCurRedlinePos;
179  }
180 
181  if( bChg )
183 
184  return bChg;
185 }
186 
187 bool SwExtraRedlineTable::DeleteTableRowRedline( SwDoc* pDoc, const SwTableLine& rTableLine, bool bSaveInUndo, RedlineType nRedlineTypeToDelete )
188 {
189  bool bChg = false;
190 
191  if (bSaveInUndo && pDoc->GetIDocumentUndoRedo().DoesUndo())
192  {
193  // #TODO - Add 'Undo' support for deleting 'Table Cell' redlines
194  /*
195  SwUndoRedline* pUndo = new SwUndoRedline( SwUndoId::REDLINE, rRange );
196  if( pUndo->GetRedlSaveCount() )
197  {
198  GetIDocumentUndoRedo().AppendUndo(pUndo);
199  }
200  else
201  delete pUndo;
202  */
203  }
204 
205  for(sal_uInt16 nCurRedlinePos = 0; nCurRedlinePos < GetSize(); ++nCurRedlinePos )
206  {
207  SwExtraRedline* pExtraRedline = GetRedline(nCurRedlinePos);
208  const SwTableRowRedline* pTableRowRedline = dynamic_cast<const SwTableRowRedline*>(pExtraRedline);
209  const SwTableLine *pRedTabLine = pTableRowRedline ? &pTableRowRedline->GetTableLine() : nullptr;
210  if ( pRedTabLine == &rTableLine )
211  {
212  // Redline for this table row
213  const SwRedlineData& aRedlineData = pTableRowRedline->GetRedlineData();
214  const RedlineType nRedlineType = aRedlineData.GetType();
215 
216  // Check if this redline object type should be deleted
217  if( RedlineType::Any != nRedlineTypeToDelete && nRedlineTypeToDelete != nRedlineType )
218  continue;
219 
220  DeleteAndDestroy( nCurRedlinePos );
221  bChg = true;
222  }
223  }
224 
225  if( bChg )
226  pDoc->getIDocumentState().SetModified();
227 
228  return bChg;
229 }
230 
231 bool SwExtraRedlineTable::DeleteTableCellRedline( SwDoc* pDoc, const SwTableBox& rTableBox, bool bSaveInUndo, RedlineType nRedlineTypeToDelete )
232 {
233  bool bChg = false;
234 
235  if (bSaveInUndo && pDoc->GetIDocumentUndoRedo().DoesUndo())
236  {
237  // #TODO - Add 'Undo' support for deleting 'Table Cell' redlines
238  /*
239  SwUndoRedline* pUndo = new SwUndoRedline( SwUndoId::REDLINE, rRange );
240  if( pUndo->GetRedlSaveCount() )
241  {
242  GetIDocumentUndoRedo().AppendUndo(pUndo);
243  }
244  else
245  delete pUndo;
246  */
247  }
248 
249  for(sal_uInt16 nCurRedlinePos = 0; nCurRedlinePos < GetSize(); ++nCurRedlinePos )
250  {
251  SwExtraRedline* pExtraRedline = GetRedline(nCurRedlinePos);
252  const SwTableCellRedline* pTableCellRedline = dynamic_cast<const SwTableCellRedline*>(pExtraRedline);
253  const SwTableBox *pRedTabBox = pTableCellRedline ? &pTableCellRedline->GetTableBox() : nullptr;
254  if ( pRedTabBox == &rTableBox )
255  {
256  // Redline for this table cell
257  const SwRedlineData& aRedlineData = pTableCellRedline->GetRedlineData();
258  const RedlineType nRedlineType = aRedlineData.GetType();
259 
260  // Check if this redline object type should be deleted
261  if( RedlineType::Any != nRedlineTypeToDelete && nRedlineTypeToDelete != nRedlineType )
262  continue;
263 
264  DeleteAndDestroy( nCurRedlinePos );
265  bChg = true;
266  }
267  }
268 
269  if( bChg )
270  pDoc->getIDocumentState().SetModified();
271 
272  return bChg;
273 }
274 
275 namespace
276 {
277 
278 void lcl_LOKInvalidateFrames(const sw::BroadcastingModify& rMod, const SwRootFrame* pLayout,
279  SwFrameType const nFrameType, const Point* pPoint)
280 {
282 
283  for (SwFrame* pTmpFrame = aIter.First(); pTmpFrame; pTmpFrame = aIter.Next() )
284  {
285  if ((pTmpFrame->GetType() & nFrameType) &&
286  (!pLayout || pLayout == pTmpFrame->getRootFrame()) &&
287  (!pTmpFrame->IsFlowFrame() || !SwFlowFrame::CastFlowFrame( pTmpFrame )->IsFollow()))
288  {
289  if (pPoint)
290  {
291  pTmpFrame->InvalidateSize();
292 
293  // Also empty the text portion cache, so it gets rebuilt, taking the new redlines
294  // into account.
295  if (pTmpFrame->IsTextFrame())
296  {
297  auto pTextFrame = static_cast<SwTextFrame*>(pTmpFrame);
298  pTextFrame->ClearPara();
299  }
300  }
301  }
302  }
303 }
304 
305 void lcl_LOKInvalidateStartEndFrames(SwShellCursor& rCursor)
306 {
307  if (!(rCursor.HasMark() &&
308  rCursor.GetPoint()->nNode.GetNode().IsContentNode() &&
309  rCursor.GetPoint()->nNode.GetNode().GetContentNode()->getLayoutFrame(rCursor.GetShell()->GetLayout()) &&
310  (rCursor.GetMark()->nNode == rCursor.GetPoint()->nNode ||
311  (rCursor.GetMark()->nNode.GetNode().IsContentNode() &&
312  rCursor.GetMark()->nNode.GetNode().GetContentNode()->getLayoutFrame(rCursor.GetShell()->GetLayout())))))
313  {
314  return;
315  }
316 
317 
318  SwPosition *pStartPos = rCursor.Start(),
319  *pEndPos = rCursor.End();
320 
321 
322  lcl_LOKInvalidateFrames(*(pStartPos->nNode.GetNode().GetContentNode()),
323  rCursor.GetShell()->GetLayout(),
324  FRM_CNTNT, &rCursor.GetSttPos());
325 
326  lcl_LOKInvalidateFrames(*(pEndPos->nNode.GetNode().GetContentNode()),
327  rCursor.GetShell()->GetLayout(),
328  FRM_CNTNT, &rCursor.GetEndPos());
329 }
330 
331 bool lcl_LOKRedlineNotificationEnabled()
332 {
333  static bool bDisableRedlineComments = getenv("DISABLE_REDLINE") != nullptr;
334  if (comphelper::LibreOfficeKit::isActive() && !bDisableRedlineComments)
335  return true;
336 
337  return false;
338 }
339 
340 } // anonymous namespace
341 
344 {
345  // Disable since usability is very low beyond some small number of changes.
346  if (!lcl_LOKRedlineNotificationEnabled())
347  return;
348 
349  boost::property_tree::ptree aRedline;
350  aRedline.put("action", (nType == RedlineNotification::Add ? "Add" :
351  (nType == RedlineNotification::Remove ? "Remove" :
352  (nType == RedlineNotification::Modify ? "Modify" : "???"))));
353  aRedline.put("index", pRedline->GetId());
354  aRedline.put("author", pRedline->GetAuthorString(1).toUtf8().getStr());
355  aRedline.put("type", SwRedlineTypeToOUString(pRedline->GetRedlineData().GetType()).toUtf8().getStr());
356  aRedline.put("comment", pRedline->GetRedlineData().GetComment().toUtf8().getStr());
357  aRedline.put("description", pRedline->GetDescr().toUtf8().getStr());
358  OUString sDateTime = utl::toISO8601(pRedline->GetRedlineData().GetTimeStamp().GetUNODateTime());
359  aRedline.put("dateTime", sDateTime.toUtf8().getStr());
360 
361  SwPosition* pStartPos = pRedline->Start();
362  SwPosition* pEndPos = pRedline->End();
363  SwContentNode* pContentNd = pRedline->GetContentNode();
364  SwView* pView = dynamic_cast<SwView*>(SfxViewShell::Current());
365  if (pView && pContentNd)
366  {
367  SwShellCursor aCursor(pView->GetWrtShell(), *pStartPos);
368  aCursor.SetMark();
369  aCursor.GetMark()->nNode = pEndPos->nNode;
370  aCursor.GetMark()->nContent = pEndPos->nContent;
371 
372  aCursor.FillRects();
373 
374  SwRects* pRects(&aCursor);
375  std::vector<OString> aRects;
376  for(const SwRect& rNextRect : *pRects)
377  aRects.push_back(rNextRect.SVRect().toString());
378 
379  const OString sRects = comphelper::string::join("; ", aRects);
380  aRedline.put("textRange", sRects.getStr());
381 
382  lcl_LOKInvalidateStartEndFrames(aCursor);
383 
384  // When this notify method is called text invalidation is not done yet
385  // Calling FillRects updates the text area so invalidation will not run on the correct rects
386  // So we need to do an own invalidation here. It invalidates text frames containing the redlining
387  SwDoc& rDoc = pRedline->GetDoc();
388  SwViewShell* pSh;
389  if( !rDoc.IsInDtor() )
390  {
392  if( pSh )
393  for(SwNodeIndex nIdx = pStartPos->nNode; nIdx <= pEndPos->nNode; ++nIdx)
394  {
395  SwContentNode* pContentNode = nIdx.GetNode().GetContentNode();
396  if (pContentNode)
397  pSh->InvalidateWindows(pContentNode->FindLayoutRect());
398  }
399  }
400  }
401 
402  boost::property_tree::ptree aTree;
403  aTree.add_child("redline", aRedline);
404  std::stringstream aStream;
405  boost::property_tree::write_json(aStream, aTree);
406  std::string aPayload = aStream.str();
407 
408  SfxViewShell* pViewShell = SfxViewShell::GetFirst();
409  while (pViewShell)
410  {
411  if (pView && pView->GetDocId() == pViewShell->GetDocId())
412  pViewShell->libreOfficeKitViewCallback(nType == RedlineNotification::Modify ? LOK_CALLBACK_REDLINE_TABLE_ENTRY_MODIFIED : LOK_CALLBACK_REDLINE_TABLE_SIZE_CHANGED, aPayload.c_str());
413  pViewShell = SfxViewShell::GetNext(*pViewShell);
414  }
415 }
416 
418 {
419  if( p->HasValidRange() )
420  {
421  std::pair<vector_type::const_iterator, bool> rv = maVector.insert( p );
422  size_type nP = rv.first - begin();
423  LOKRedlineNotification(RedlineNotification::Add, p);
424 
425  // detect text moving by checking nearby redlines, except during Undo
426  // (apply isMoved() during OpenDocument and DOCX import, too, to fix
427  // missing text moving handling in ODF and e.g. web version of MSO)
428  if ( p->GetDoc().GetIDocumentUndoRedo().DoesUndo() ||
430  p->GetDoc().IsInXMLImport() )
431  {
432  isMoved(nP);
433  }
434 
435  p->CallDisplayFunc(nP);
436  if (rv.second)
437  CheckOverlapping(rv.first);
438  return rv.second;
439  }
440  return InsertWithValidRanges( p );
441 }
442 
444 {
445  if (m_bHasOverlappingElements)
446  return;
447  if (maVector.size() <= 1) // a single element cannot be overlapping
448  return;
449  auto pCurr = *it;
450  auto itNext = it + 1;
451  if (itNext != maVector.end())
452  {
453  auto pNext = *itNext;
454  if (pCurr->End()->nNode.GetIndex() >= pNext->Start()->nNode.GetIndex())
455  {
456  m_bHasOverlappingElements = true;
457  return;
458  }
459  }
460  if (it != maVector.begin())
461  {
462  auto pPrev = *(it - 1);
463  if (pPrev->End()->nNode.GetIndex() >= pCurr->Start()->nNode.GetIndex())
464  m_bHasOverlappingElements = true;
465  }
466 }
467 
469 {
470  if( p->HasValidRange() )
471  {
472  std::pair<vector_type::const_iterator, bool> rv = maVector.insert( p );
473  rP = rv.first - begin();
474  p->CallDisplayFunc(rP);
475  if (rv.second)
476  CheckOverlapping(rv.first);
477  return rv.second;
478  }
479  return InsertWithValidRanges( p, &rP );
480 }
481 
482 namespace sw {
483 
484 std::vector<SwRangeRedline*> GetAllValidRanges(std::unique_ptr<SwRangeRedline> p)
485 {
486  std::vector<SwRangeRedline*> ret;
487  // Create valid "sub-ranges" from the Selection
488  SwPosition* pStt = p->Start(),
489  * pEnd = p->End();
490  SwPosition aNewStt( *pStt );
491  SwNodes& rNds = aNewStt.nNode.GetNodes();
492  SwContentNode* pC;
493 
494  if( !aNewStt.nNode.GetNode().IsContentNode() )
495  {
496  pC = rNds.GoNext( &aNewStt.nNode );
497  if( pC )
498  aNewStt.nContent.Assign( pC, 0 );
499  else
500  aNewStt.nNode = rNds.GetEndOfContent();
501  }
502 
503  SwRangeRedline* pNew = nullptr;
504 
505  if( aNewStt < *pEnd )
506  do {
507  if( !pNew )
508  pNew = new SwRangeRedline( p->GetRedlineData(), aNewStt );
509  else
510  {
511  pNew->DeleteMark();
512  *pNew->GetPoint() = aNewStt;
513  }
514 
515  pNew->SetMark();
516  GoEndSection( pNew->GetPoint() );
517  // i60396: If the redlines starts before a table but the table is the last member
518  // of the section, the GoEndSection will end inside the table.
519  // This will result in an incorrect redline, so we've to go back
521  // We end in a table when pTab != 0
522  if( pTab && !pNew->GetMark()->nNode.GetNode().StartOfSectionNode()->FindTableNode() )
523  { // but our Mark was outside the table => Correction
524  do
525  {
526  // We want to be before the table
527  *pNew->GetPoint() = SwPosition(*pTab);
528  pC = GoPreviousNds( &pNew->GetPoint()->nNode, false ); // here we are.
529  if( pC )
530  pNew->GetPoint()->nContent.Assign( pC, 0 );
531  pTab = pNew->GetPoint()->nNode.GetNode().StartOfSectionNode()->FindTableNode();
532  } while( pTab ); // If there is another table we have to repeat our step backwards
533  }
534 
535  if( *pNew->GetPoint() > *pEnd )
536  {
537  pC = nullptr;
538  if( aNewStt.nNode != pEnd->nNode )
539  do {
540  SwNode& rCurNd = aNewStt.nNode.GetNode();
541  if( rCurNd.IsStartNode() )
542  {
543  if( rCurNd.EndOfSectionIndex() < pEnd->nNode.GetIndex() )
544  aNewStt.nNode = *rCurNd.EndOfSectionNode();
545  else
546  break;
547  }
548  else if( rCurNd.IsContentNode() )
549  pC = rCurNd.GetContentNode();
550  ++aNewStt.nNode;
551  } while( aNewStt.nNode.GetIndex() < pEnd->nNode.GetIndex() );
552 
553  if( aNewStt.nNode == pEnd->nNode )
554  aNewStt.nContent = pEnd->nContent;
555  else if( pC )
556  {
557  aNewStt.nNode = *pC;
558  aNewStt.nContent.Assign( pC, pC->Len() );
559  }
560 
561  if( aNewStt <= *pEnd )
562  *pNew->GetPoint() = aNewStt;
563  }
564  else
565  aNewStt = *pNew->GetPoint();
566 #if OSL_DEBUG_LEVEL > 0
567  CheckPosition( pNew->GetPoint(), pNew->GetMark() );
568 #endif
569 
570  if( *pNew->GetPoint() != *pNew->GetMark() &&
571  pNew->HasValidRange())
572  {
573  ret.push_back(pNew);
574  pNew = nullptr;
575  }
576 
577  if( aNewStt >= *pEnd )
578  break;
579  pC = rNds.GoNext( &aNewStt.nNode );
580  if( !pC )
581  break;
582 
583  aNewStt.nContent.Assign( pC, 0 );
584 
585  } while( aNewStt < *pEnd );
586 
587  delete pNew;
588  p.reset();
589  return ret;
590 }
591 
592 } // namespace sw
593 
595 {
596  bool bAnyIns = false;
597  std::vector<SwRangeRedline*> const redlines(
598  GetAllValidRanges(std::unique_ptr<SwRangeRedline>(p)));
599  for (SwRangeRedline * pRedline : redlines)
600  {
601  assert(pRedline->HasValidRange());
602  size_type nInsPos;
603  if (Insert(pRedline, nInsPos))
604  {
605  pRedline->CallDisplayFunc(nInsPos);
606  bAnyIns = true;
607  if (pInsPos && *pInsPos < nInsPos)
608  {
609  *pInsPos = nInsPos;
610  }
611  }
612  }
613  p = nullptr;
614  return bAnyIns;
615 }
616 
618 {
619  return *lhs < *rhs;
620 }
621 
623 {
624  maVector.DeleteAndDestroyAll();
625 }
626 
628 {
629  vector_type::const_iterator it = maVector.find(const_cast<SwRangeRedline*>(p));
630  if( it == maVector.end() )
631  return npos;
632  return it - maVector.begin();
633 }
634 
636 {
637  const size_type nPos = GetPos(p);
638  if (nPos == npos)
639  return;
640  Remove(nPos);
641 }
642 
644 {
645  LOKRedlineNotification(RedlineNotification::Remove, maVector[nP]);
646  SwDoc* pDoc = nullptr;
647  if( !nP && 1 == size() )
648  pDoc = &maVector.front()->GetDoc();
649 
650  maVector.erase( maVector.begin() + nP );
651 
652  if( pDoc && !pDoc->IsInDtor() )
653  {
655  if( pSh )
657  }
658 }
659 
661 {
662  while (!maVector.empty())
663  {
664  auto const pRedline = maVector.back();
665  maVector.erase_at(maVector.size() - 1);
666  LOKRedlineNotification(RedlineNotification::Remove, pRedline);
667  delete pRedline;
668  }
669  m_bHasOverlappingElements = false;
670 }
671 
673 {
674  auto const pRedline = maVector[nP];
675  maVector.erase(maVector.begin() + nP);
676  LOKRedlineNotification(RedlineNotification::Remove, pRedline);
677  delete pRedline;
678 }
679 
681 {
682  return nSttPos + 1 < size()
683  ? FindNextSeqNo( operator[]( nSttPos )->GetSeqNo(), nSttPos+1 )
684  : npos;
685 }
686 
688 {
689  return nSttPos ? FindPrevSeqNo( operator[]( nSttPos )->GetSeqNo(), nSttPos-1 )
690  : npos;
691 }
692 
696 {
697  auto constexpr nLookahead = 20;
698  size_type nRet = npos;
699  if( nSeqNo && nSttPos < size() )
700  {
701  size_type nEnd = size();
702  const size_type nTmp = nSttPos + nLookahead;
703  if (nTmp < nEnd)
704  {
705  nEnd = nTmp;
706  }
707 
708  for( ; nSttPos < nEnd; ++nSttPos )
709  if( nSeqNo == operator[]( nSttPos )->GetSeqNo() )
710  {
711  nRet = nSttPos;
712  break;
713  }
714  }
715  return nRet;
716 }
717 
719 {
720  auto constexpr nLookahead = 20;
721  size_type nRet = npos;
722  if( nSeqNo && nSttPos < size() )
723  {
724  size_type nEnd = 0;
725  if( nSttPos > nLookahead )
726  nEnd = nSttPos - nLookahead;
727 
728  ++nSttPos;
729  while( nSttPos > nEnd )
730  if( nSeqNo == operator[]( --nSttPos )->GetSeqNo() )
731  {
732  nRet = nSttPos;
733  break;
734  }
735  }
736  return nRet;
737 }
738 
740  size_type& rPos,
741  bool bNext ) const
742 {
743  const SwRangeRedline* pFnd = nullptr;
744  for( ; rPos < maVector.size() ; ++rPos )
745  {
746  const SwRangeRedline* pTmp = (*this)[ rPos ];
747  if( pTmp->HasMark() && pTmp->IsVisible() )
748  {
749  const SwPosition* pRStt = pTmp->Start(),
750  * pREnd = pTmp->End();
751  if( bNext ? *pRStt <= rSttPos : *pRStt < rSttPos )
752  {
753  if( bNext ? *pREnd > rSttPos : *pREnd >= rSttPos )
754  {
755  pFnd = pTmp;
756  break;
757  }
758  }
759  else
760  break;
761  }
762  }
763  return pFnd;
764 }
765 
767 {
768  bool bRet = false;
769  auto constexpr nLookahead = 20;
770  SwRangeRedline* pRedline = (*this)[ rPos ];
771 
772  // set redline type of the searched pair
773  RedlineType nPairType = pRedline->GetType();
774  if ( RedlineType::Delete == nPairType )
775  nPairType = RedlineType::Insert;
776  else if ( RedlineType::Insert == nPairType )
777  nPairType = RedlineType::Delete;
778  else
779  // only deleted or inserted text can be moved
780  return false;
781 
782  bool bDeletePaM = false;
783  SwPaM* pPaM;
784 
785  // if this redline is visible the content is in this PaM
786  if ( nullptr == pRedline->GetContentIdx() )
787  {
788  pPaM = pRedline;
789  }
790  else // otherwise it is saved in pContentSect, e.g. during ODT import
791  {
792  SwNodeIndex aTmpIdx( *pRedline->GetContentIdx()->GetNode().EndOfSectionNode() );
793  pPaM = new SwPaM(*pRedline->GetContentIdx(), aTmpIdx );
794  bDeletePaM = true;
795  }
796 
797  const OUString sTrimmed = pPaM->GetText().trim();
798  if ( sTrimmed.getLength() < 2 )
799  {
800  if ( bDeletePaM )
801  delete pPaM;
802  return false;
803  }
804 
805  // search pair around the actual redline
806  size_type nEnd = rPos + nLookahead < size()
807  ? rPos + nLookahead
808  : size();
809  rPos = rPos > nLookahead ? rPos - nLookahead : 0;
810  for ( ; rPos < nEnd && !bRet ; ++rPos )
811  {
812  SwRangeRedline* pPair = (*this)[ rPos ];
813 
814  // redline must be the requested type and from the same author
815  if ( nPairType != pPair->GetType() ||
816  pRedline->GetAuthor() != pPair->GetAuthor() )
817  {
818  continue;
819  }
820 
821  bool bDeletePairPaM = false;
822  SwPaM* pPairPaM;
823 
824  // if this redline is visible the content is in this PaM
825  if ( nullptr == pPair->GetContentIdx() )
826  {
827  pPairPaM = pPair;
828  }
829  else // otherwise it is saved in pContentSect, e.g. during ODT import
830  {
831  // saved in pContentSect, e.g. during ODT import
832  SwNodeIndex aTmpIdx( *pPair->GetContentIdx()->GetNode().EndOfSectionNode() );
833  pPairPaM = new SwPaM(*pPair->GetContentIdx(), aTmpIdx );
834  bDeletePairPaM = true;
835  }
836 
837  // pair at tracked moving: same text by trimming trailing white spaces
838  if ( abs(pPaM->GetText().getLength() - pPairPaM->GetText().getLength()) <= 2 &&
839  sTrimmed == o3tl::trim(pPairPaM->GetText()) )
840  {
841  pRedline->SetMoved();
842  pPair->SetMoved();
844  bRet = true;
845  }
846 
847  if ( bDeletePairPaM )
848  delete pPairPaM;
849  }
850 
851  if ( bDeletePaM )
852  delete pPaM;
853 
854  return bRet;
855 }
856 
858 {
859  (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SwRedlineTable"));
860  (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("ptr"), "%p", this);
861 
862  for (SwRedlineTable::size_type nCurRedlinePos = 0; nCurRedlinePos < size(); ++nCurRedlinePos)
863  operator[](nCurRedlinePos)->dumpAsXml(pWriter);
864 
865  (void)xmlTextWriterEndElement(pWriter);
866 }
867 
869 {
870 }
871 
873 {
874 }
875 
877 {
878  return false;
879 }
880 
882  sal_uInt16 nPoolFormatId,
883  const SfxItemSet* pItemSet,
884  bool bFormatAll )
885  : m_sFormatNm(rColl), m_nPoolId(nPoolFormatId), m_bFormatAll(bFormatAll)
886 {
887  if( pItemSet && pItemSet->Count() )
888  m_pSet.reset( new SfxItemSet( *pItemSet ) );
889 }
890 
892 {
893 }
894 
896 {
898 }
899 
901 {
902  SwDoc& rDoc = rPam.GetDoc();
903 
904  // What about Undo? Is it turned off?
905  SwTextFormatColl* pColl = USHRT_MAX == m_nPoolId
908 
911 
912  SwPaM aPam( *rPam.GetMark(), *rPam.GetPoint() );
913 
914  const SwPosition* pEnd = rPam.End();
915 
916  if ( !m_bFormatAll || pEnd->nContent == 0 )
917  {
918  // don't reject the format of the next paragraph (that is handled by the next redline)
919  if (aPam.GetPoint()->nNode > aPam.GetMark()->nNode)
920  {
921  aPam.GetPoint()->nNode--;
922  SwContentNode* pNode = aPam.GetPoint()->nNode.GetNode().GetContentNode();
923  aPam.GetPoint()->nContent.Assign( pNode, pNode->Len() );
924  }
925  else if (aPam.GetPoint()->nNode < aPam.GetMark()->nNode)
926  {
927  aPam.GetMark()->nNode--;
928  SwContentNode* pNode = aPam.GetMark()->nNode.GetNode().GetContentNode();
929  aPam.GetMark()->nContent.Assign( pNode, pNode->Len() );
930  }
931  }
932 
933  if( pColl )
934  rDoc.SetTextFormatColl( aPam, pColl, false );
935 
936  if( m_pSet )
938 
940 }
941 
943 {
944  const SwRedlineExtraData_FormatColl& rCmp = static_cast<const SwRedlineExtraData_FormatColl&>(r);
945  return m_sFormatNm == rCmp.m_sFormatNm && m_nPoolId == rCmp.m_nPoolId &&
946  m_bFormatAll == rCmp.m_bFormatAll &&
947  ( ( !m_pSet && !rCmp.m_pSet ) ||
948  ( m_pSet && rCmp.m_pSet && *m_pSet == *rCmp.m_pSet ) );
949 }
950 
952 {
953  if( rSet.Count() )
954  m_pSet.reset( new SfxItemSet( rSet ) );
955  else
956  m_pSet.reset();
957 }
958 
960 {
961  SfxItemIter aIter( rSet );
962  for (const SfxPoolItem* pItem = aIter.GetCurItem(); pItem; pItem = aIter.NextItem())
963  {
964  m_aWhichIds.push_back( pItem->Which() );
965  }
966 }
967 
969  const SwRedlineExtraData_Format& rCpy )
971 {
972  m_aWhichIds.insert( m_aWhichIds.begin(), rCpy.m_aWhichIds.begin(), rCpy.m_aWhichIds.end() );
973 }
974 
976 {
977 }
978 
980 {
981  return new SwRedlineExtraData_Format( *this );
982 }
983 
985 {
986  SwDoc& rDoc = rPam.GetDoc();
987 
990 
991  // Actually we need to reset the Attribute here!
992  for( const auto& rWhichId : m_aWhichIds )
993  {
994  rDoc.getIDocumentContentOperations().InsertPoolItem( rPam, *GetDfltAttr( rWhichId ),
996  }
997 
999 }
1000 
1002 {
1003  const size_t nEnd = m_aWhichIds.size();
1004  if( nEnd != static_cast<const SwRedlineExtraData_Format&>(rCmp).m_aWhichIds.size() )
1005  return false;
1006 
1007  for( size_t n = 0; n < nEnd; ++n )
1008  {
1009  if( static_cast<const SwRedlineExtraData_Format&>(rCmp).m_aWhichIds[n] != m_aWhichIds[n])
1010  {
1011  return false;
1012  }
1013  }
1014  return true;
1015 }
1016 
1018  : m_pNext( nullptr ), m_pExtraData( nullptr ),
1019  m_aStamp( DateTime::SYSTEM ),
1020  m_nAuthor( nAut ), m_eType( eT ), m_nSeqNo( 0 ), m_bAutoFormat(false), m_bMoved(false)
1021 {
1022  m_aStamp.SetNanoSec( 0 );
1023 }
1024 
1026  const SwRedlineData& rCpy,
1027  bool bCpyNext )
1028  : m_pNext( ( bCpyNext && rCpy.m_pNext ) ? new SwRedlineData( *rCpy.m_pNext ) : nullptr )
1029  , m_pExtraData( rCpy.m_pExtraData ? rCpy.m_pExtraData->CreateNew() : nullptr )
1030  , m_sComment( rCpy.m_sComment )
1031  , m_aStamp( rCpy.m_aStamp )
1032  , m_nAuthor( rCpy.m_nAuthor )
1033  , m_eType( rCpy.m_eType )
1034  , m_nSeqNo( rCpy.m_nSeqNo )
1035  , m_bAutoFormat(false)
1036  , m_bMoved( rCpy.m_bMoved )
1037 {
1038 }
1039 
1040 // For sw3io: We now own pNext!
1041 SwRedlineData::SwRedlineData(RedlineType eT, std::size_t nAut, const DateTime& rDT,
1042  const OUString& rCmnt, SwRedlineData *pNxt)
1043  : m_pNext(pNxt), m_pExtraData(nullptr), m_sComment(rCmnt), m_aStamp(rDT),
1044  m_nAuthor(nAut), m_eType(eT), m_nSeqNo(0), m_bAutoFormat(false), m_bMoved(false)
1045 {
1046 }
1047 
1049 {
1050  delete m_pExtraData;
1051  delete m_pNext;
1052 }
1053 
1055 {
1056  DateTime aTime = GetTimeStamp();
1057  aTime.SetSec(0);
1058  DateTime aCompareTime = rCmp.GetTimeStamp();
1059  aCompareTime.SetSec(0);
1060  return m_nAuthor == rCmp.m_nAuthor &&
1061  m_eType == rCmp.m_eType &&
1062  m_sComment == rCmp.m_sComment &&
1063  aTime == aCompareTime &&
1064  m_bMoved == rCmp.m_bMoved &&
1065  (( !m_pNext && !rCmp.m_pNext ) ||
1066  ( m_pNext && rCmp.m_pNext &&
1067  m_pNext->CanCombine( *rCmp.m_pNext ))) &&
1068  (( !m_pExtraData && !rCmp.m_pExtraData ) ||
1069  ( m_pExtraData && rCmp.m_pExtraData &&
1070  *m_pExtraData == *rCmp.m_pExtraData ));
1071 }
1072 
1076 {
1077  delete m_pExtraData;
1078 
1079  // Check if there is data - and if so - delete it
1080  if( pData )
1081  m_pExtraData = pData->CreateNew();
1082  else
1083  m_pExtraData = nullptr;
1084 }
1085 
1087 {
1088  STR_UNDO_REDLINE_INSERT,
1089  STR_UNDO_REDLINE_DELETE,
1090  STR_UNDO_REDLINE_FORMAT,
1091  STR_UNDO_REDLINE_TABLE,
1092  STR_UNDO_REDLINE_FMTCOLL,
1093  STR_UNDO_REDLINE_PARAGRAPH_FORMAT,
1094  STR_UNDO_REDLINE_TABLE_ROW_INSERT,
1095  STR_UNDO_REDLINE_TABLE_ROW_DELETE,
1096  STR_UNDO_REDLINE_TABLE_CELL_INSERT,
1097  STR_UNDO_REDLINE_TABLE_CELL_DELETE
1098 };
1099 
1100 OUString SwRedlineData::GetDescr() const
1101 {
1102  return SwResId(STR_REDLINE_ARY[static_cast<int>(GetType())]);
1103 }
1104 
1105 sal_uInt32 SwRangeRedline::s_nLastId = 1;
1106 
1108  : SwPaM( *rPam.GetMark(), *rPam.GetPoint() ),
1109  m_pRedlineData( new SwRedlineData( eTyp, GetDoc().getIDocumentRedlineAccess().GetRedlineAuthor() ) ),
1110  m_pContentSect( nullptr ),
1111  m_nId( s_nLastId++ )
1112 {
1113  m_bDelLastPara = false;
1114  m_bIsVisible = true;
1115  if( !rPam.HasMark() )
1116  DeleteMark();
1117 
1118  // set default comment for single annotations added or deleted
1119  if ( IsAnnotation() )
1120  {
1121  SetComment( RedlineType::Delete == eTyp
1122  ? SwResId(STR_REDLINE_COMMENT_DELETED)
1123  : SwResId(STR_REDLINE_COMMENT_ADDED) );
1124  }
1125 }
1126 
1128  : SwPaM( *rPam.GetMark(), *rPam.GetPoint() ),
1129  m_pRedlineData( new SwRedlineData( rData )),
1130  m_pContentSect( nullptr ),
1131  m_nId( s_nLastId++ )
1132 {
1133  m_bDelLastPara = false;
1134  m_bIsVisible = true;
1135  if( !rPam.HasMark() )
1136  DeleteMark();
1137 }
1138 
1140  : SwPaM( rPos ),
1141  m_pRedlineData( new SwRedlineData( rData )),
1142  m_pContentSect( nullptr ),
1143  m_nId( s_nLastId++ )
1144 {
1145  m_bDelLastPara = false;
1146  m_bIsVisible = true;
1147 }
1148 
1150  : SwPaM( *rCpy.GetMark(), *rCpy.GetPoint() ),
1151  m_pRedlineData( new SwRedlineData( *rCpy.m_pRedlineData )),
1152  m_pContentSect( nullptr ),
1153  m_nId( s_nLastId++ )
1154 {
1155  m_bDelLastPara = false;
1156  m_bIsVisible = true;
1157  if( !rCpy.HasMark() )
1158  DeleteMark();
1159 }
1160 
1162 {
1163  if( m_pContentSect )
1164  {
1165  // delete the ContentSection
1166  if( !GetDoc().IsInDtor() )
1168  delete m_pContentSect;
1169  }
1170  delete m_pRedlineData;
1171 }
1172 
1174 {
1175  if (!lcl_LOKRedlineNotificationEnabled())
1176  return;
1177 
1178  const SwRedlineTable& rRedTable = rDoc.getIDocumentRedlineAccess().GetRedlineTable();
1179  for (SwRedlineTable::size_type i = 0; i < rRedTable.size(); ++i)
1180  {
1181  if (rRedTable[i] == &rRedline)
1182  {
1184  break;
1185  }
1186  }
1187 }
1188 
1190 {
1191  if (!lcl_LOKRedlineNotificationEnabled())
1192  return;
1193 
1194  if(!m_oLOKLastNodeTop || *m_oLOKLastNodeTop != nTop)
1195  {
1196  m_oLOKLastNodeTop = nTop;
1198  }
1199 }
1200 
1201 void SwRangeRedline::SetStart( const SwPosition& rPos, SwPosition* pSttPtr )
1202 {
1203  if( !pSttPtr ) pSttPtr = Start();
1204  *pSttPtr = rPos;
1205 
1207 }
1208 
1209 void SwRangeRedline::SetEnd( const SwPosition& rPos, SwPosition* pEndPtr )
1210 {
1211  if( !pEndPtr ) pEndPtr = End();
1212  *pEndPtr = rPos;
1213 
1215 }
1216 
1219 {
1220  const SwNode* pPtNd = &GetPoint()->nNode.GetNode(),
1221  * pMkNd = &GetMark()->nNode.GetNode();
1222  if( pPtNd->StartOfSectionNode() == pMkNd->StartOfSectionNode() &&
1223  !pPtNd->StartOfSectionNode()->IsTableNode() &&
1224  // invalid if points on the end of content
1225  // end-of-content only invalid if no content index exists
1226  ( pPtNd != pMkNd || GetContentIdx() != nullptr ||
1227  pPtNd != &pPtNd->GetNodes().GetEndOfContent() )
1228  )
1229  return true;
1230  return false;
1231 }
1232 
1234 {
1237  Show(0, nMyPos);
1238  else if (eShow == RedlineFlags::ShowInsert)
1239  Hide(0, nMyPos);
1240  else if (eShow == RedlineFlags::ShowDelete)
1241  ShowOriginal(0, nMyPos);
1242 }
1243 
1244 void SwRangeRedline::Show(sal_uInt16 nLoop, size_t nMyPos, bool bForced)
1245 {
1246  SwDoc& rDoc = GetDoc();
1247 
1248  bool bIsShowChangesInMargin = false;
1249  if ( !bForced )
1250  {
1252  if (pSh)
1253  bIsShowChangesInMargin = pSh->GetViewOptions()->IsShowChangesInMargin();
1254  else
1255  bIsShowChangesInMargin = SW_MOD()->GetUsrPref(false)->IsShowChangesInMargin();
1256  }
1257 
1258  if( 1 > nLoop && !bIsShowChangesInMargin )
1259  return;
1260 
1263  ::sw::UndoGuard const undoGuard(rDoc.GetIDocumentUndoRedo());
1264 
1265  switch( GetType() )
1266  {
1267  case RedlineType::Insert: // Content has been inserted
1268  m_bIsVisible = true;
1269  MoveFromSection(nMyPos);
1270  break;
1271 
1272  case RedlineType::Delete: // Content has been deleted
1273  m_bIsVisible = !bIsShowChangesInMargin;
1274 
1275  if (m_bIsVisible)
1276  MoveFromSection(nMyPos);
1277  else
1278  {
1279  switch( nLoop )
1280  {
1281  case 0: MoveToSection(); break;
1282  case 1: CopyToSection(); break;
1283  case 2: DelCopyOfSection(nMyPos); break;
1284  }
1285  }
1286  break;
1287 
1288  case RedlineType::Format: // Attributes have been applied
1289  case RedlineType::Table: // Table structure has been modified
1291  break;
1292  default:
1293  break;
1294  }
1296 }
1297 
1298 void SwRangeRedline::Hide(sal_uInt16 nLoop, size_t nMyPos, bool /*bForced*/)
1299 {
1300  SwDoc& rDoc = GetDoc();
1303  ::sw::UndoGuard const undoGuard(rDoc.GetIDocumentUndoRedo());
1304 
1305  switch( GetType() )
1306  {
1307  case RedlineType::Insert: // Content has been inserted
1308  m_bIsVisible = true;
1309  if( 1 <= nLoop )
1310  MoveFromSection(nMyPos);
1311  break;
1312 
1313  case RedlineType::Delete: // Content has been deleted
1314  m_bIsVisible = false;
1315  switch( nLoop )
1316  {
1317  case 0: MoveToSection(); break;
1318  case 1: CopyToSection(); break;
1319  case 2: DelCopyOfSection(nMyPos); break;
1320  }
1321  break;
1322 
1323  case RedlineType::Format: // Attributes have been applied
1324  case RedlineType::Table: // Table structure has been modified
1325  if( 1 <= nLoop )
1327  break;
1328  default:
1329  break;
1330  }
1332 }
1333 
1334 void SwRangeRedline::ShowOriginal(sal_uInt16 nLoop, size_t nMyPos, bool /*bForced*/)
1335 {
1336  SwDoc& rDoc = GetDoc();
1338  SwRedlineData* pCur;
1339 
1341  ::sw::UndoGuard const undoGuard(rDoc.GetIDocumentUndoRedo());
1342 
1343  // Determine the Type, it's the first on Stack
1344  for( pCur = m_pRedlineData; pCur->m_pNext; )
1345  pCur = pCur->m_pNext;
1346 
1347  switch( pCur->m_eType )
1348  {
1349  case RedlineType::Insert: // Content has been inserted
1350  m_bIsVisible = false;
1351  switch( nLoop )
1352  {
1353  case 0: MoveToSection(); break;
1354  case 1: CopyToSection(); break;
1355  case 2: DelCopyOfSection(nMyPos); break;
1356  }
1357  break;
1358 
1359  case RedlineType::Delete: // Content has been deleted
1360  m_bIsVisible = true;
1361  if( 1 <= nLoop )
1362  MoveFromSection(nMyPos);
1363  break;
1364 
1365  case RedlineType::Format: // Attributes have been applied
1366  case RedlineType::Table: // Table structure has been modified
1367  if( 1 <= nLoop )
1369  break;
1370  default:
1371  break;
1372  }
1374 }
1375 
1376 // trigger the Layout
1378 {
1379  SwNodeOffset nSttNd = Start()->nNode.GetIndex(),
1380  nEndNd = End()->nNode.GetIndex();
1381  sal_Int32 nSttCnt = Start()->nContent.GetIndex();
1382  sal_Int32 nEndCnt = End()->nContent.GetIndex();
1383 
1384  SwNodes& rNds = GetDoc().GetNodes();
1385  for (SwNodeOffset n(nSttNd); n <= nEndNd; ++n)
1386  {
1387  SwNode* pNode = rNds[n];
1388 
1389  if (pNode && pNode->IsTextNode())
1390  {
1391  SwTextNode* pNd = pNode->GetTextNode();
1392 
1393  SwUpdateAttr aHt(
1394  n == nSttNd ? nSttCnt : 0,
1395  n == nEndNd ? nEndCnt : pNd->GetText().getLength(),
1396  RES_FMT_CHG);
1397 
1398  pNd->TriggerNodeUpdate(sw::LegacyModifyHint(&aHt, &aHt));
1399 
1400  // SwUpdateAttr must be handled first, otherwise indexes are off
1401  if (GetType() == RedlineType::Delete)
1402  {
1403  sal_Int32 const nStart(n == nSttNd ? nSttCnt : 0);
1404  sal_Int32 const nLen((n == nEndNd ? nEndCnt : pNd->GetText().getLength()) - nStart);
1405  if (eWhy == Invalidation::Add)
1406  {
1407  sw::RedlineDelText const hint(nStart, nLen);
1408  pNd->CallSwClientNotify(hint);
1409  }
1410  else
1411  {
1412  sw::RedlineUnDelText const hint(nStart, nLen);
1413  pNd->CallSwClientNotify(hint);
1414  }
1415  }
1416  }
1417  }
1418 }
1419 
1422 void SwRangeRedline::CalcStartEnd( SwNodeOffset nNdIdx, sal_Int32& rStart, sal_Int32& rEnd ) const
1423 {
1424  const SwPosition *pRStt = Start(), *pREnd = End();
1425  if( pRStt->nNode < nNdIdx )
1426  {
1427  if( pREnd->nNode > nNdIdx )
1428  {
1429  rStart = 0; // Paragraph is completely enclosed
1430  rEnd = COMPLETE_STRING;
1431  }
1432  else if (pREnd->nNode == nNdIdx)
1433  {
1434  rStart = 0; // Paragraph is overlapped in the beginning
1435  rEnd = pREnd->nContent.GetIndex();
1436  }
1437  else // redline ends before paragraph
1438  {
1439  rStart = COMPLETE_STRING;
1440  rEnd = COMPLETE_STRING;
1441  }
1442  }
1443  else if( pRStt->nNode == nNdIdx )
1444  {
1445  rStart = pRStt->nContent.GetIndex();
1446  if( pREnd->nNode == nNdIdx )
1447  rEnd = pREnd->nContent.GetIndex(); // Within the Paragraph
1448  else
1449  rEnd = COMPLETE_STRING; // Paragraph is overlapped in the end
1450  }
1451  else
1452  {
1453  rStart = COMPLETE_STRING;
1454  rEnd = COMPLETE_STRING;
1455  }
1456 }
1457 
1458 static void lcl_storeAnnotationMarks(SwDoc& rDoc, const SwPosition* pStt, const SwPosition* pEnd)
1459 {
1460  // tdf#115815 keep original start position of collapsed annotation ranges
1461  // as temporary bookmarks (removed after file saving and file loading)
1463  for (auto iter = rDMA.getAnnotationMarksBegin();
1464  iter != rDMA.getAnnotationMarksEnd(); )
1465  {
1466  SwPosition const& rStartPos((**iter).GetMarkStart());
1467  if ( *pStt <= rStartPos && rStartPos < *pEnd )
1468  {
1470  rDMA.findAnnotationBookmark((**iter).GetName());
1471  if ( pOldMark == rDMA.getBookmarksEnd() )
1472  {
1473  // at start of redlines use a 1-character length bookmark range
1474  // instead of a 0-character length bookmark position to avoid its losing
1475  sal_Int32 nLen = (*pStt == rStartPos) ? 1 : 0;
1476  SwPaM aPam( rStartPos.nNode, rStartPos.nContent.GetIndex(),
1477  rStartPos.nNode, rStartPos.nContent.GetIndex() + nLen);
1478  ::sw::mark::IMark* pMark = rDMA.makeAnnotationBookmark(
1479  aPam,
1480  (**iter).GetName(),
1482  ::sw::mark::IBookmark* pBookmark = dynamic_cast< ::sw::mark::IBookmark* >(pMark);
1483  if (pBookmark)
1484  {
1485  pBookmark->SetKeyCode(vcl::KeyCode());
1486  pBookmark->SetShortName(OUString());
1487  }
1488  }
1489  }
1490  ++iter;
1491  }
1492 }
1493 
1495 {
1496  if( !m_pContentSect )
1497  {
1498  const SwPosition* pStt = Start(),
1499  * pEnd = End();
1500 
1501  SwDoc& rDoc = GetDoc();
1502  SwPaM aPam( *pStt, *pEnd );
1503  SwContentNode* pCSttNd = pStt->nNode.GetNode().GetContentNode();
1504  SwContentNode* pCEndNd = pEnd->nNode.GetNode().GetContentNode();
1505 
1506  if( !pCSttNd )
1507  {
1508  // In order to not move other Redlines' indices, we set them
1509  // to the end (is exclusive)
1510  const SwRedlineTable& rTable = rDoc.getIDocumentRedlineAccess().GetRedlineTable();
1511  for(SwRangeRedline* pRedl : rTable)
1512  {
1513  if( pRedl->GetBound() == *pStt )
1514  pRedl->GetBound() = *pEnd;
1515  if( pRedl->GetBound(false) == *pStt )
1516  pRedl->GetBound(false) = *pEnd;
1517  }
1518  }
1519 
1520  SwStartNode* pSttNd;
1521  SwNodes& rNds = rDoc.GetNodes();
1522  if( pCSttNd || pCEndNd )
1523  {
1524  SwTextFormatColl* pColl = (pCSttNd && pCSttNd->IsTextNode() )
1525  ? pCSttNd->GetTextNode()->GetTextColl()
1526  : (pCEndNd && pCEndNd->IsTextNode() )
1527  ? pCEndNd->GetTextNode()->GetTextColl()
1529 
1530  pSttNd = rNds.MakeTextSection( SwNodeIndex( rNds.GetEndOfRedlines() ),
1531  SwNormalStartNode, pColl );
1532  SwTextNode* pTextNd = rNds[ pSttNd->GetIndex() + 1 ]->GetTextNode();
1533 
1534  SwNodeIndex aNdIdx( *pTextNd );
1535  SwPosition aPos( aNdIdx, SwIndex( pTextNd ));
1536  if( pCSttNd && pCEndNd )
1537  {
1538  // tdf#140982 keep annotation ranges in deletions in margin mode
1539  lcl_storeAnnotationMarks( rDoc, pStt, pEnd );
1540  rDoc.getIDocumentContentOperations().MoveAndJoin( aPam, aPos );
1541  }
1542  else
1543  {
1544  if( pCSttNd && !pCEndNd )
1545  m_bDelLastPara = true;
1546  rDoc.getIDocumentContentOperations().MoveRange( aPam, aPos,
1548  }
1549  }
1550  else
1551  {
1553 
1554  SwPosition aPos( *pSttNd->EndOfSectionNode() );
1555  rDoc.getIDocumentContentOperations().MoveRange( aPam, aPos,
1557  }
1558  m_pContentSect = new SwNodeIndex( *pSttNd );
1559 
1560  if( pStt == GetPoint() )
1561  Exchange();
1562 
1563  DeleteMark();
1564  }
1565  else
1567 }
1568 
1570 {
1571  if( m_pContentSect )
1572  return;
1573 
1574  const SwPosition* pStt = Start(),
1575  * pEnd = End();
1576 
1577  SwContentNode* pCSttNd = pStt->nNode.GetNode().GetContentNode();
1578  SwContentNode* pCEndNd = pEnd->nNode.GetNode().GetContentNode();
1579 
1580  SwStartNode* pSttNd;
1581  SwDoc& rDoc = GetDoc();
1582  SwNodes& rNds = rDoc.GetNodes();
1583 
1584  bool bSaveCopyFlag = rDoc.IsCopyIsMove(),
1585  bSaveRdlMoveFlg = rDoc.getIDocumentRedlineAccess().IsRedlineMove();
1586  rDoc.SetCopyIsMove( true );
1587 
1588  // The IsRedlineMove() flag causes the behaviour of the
1589  // DocumentContentOperationsManager::CopyFlyInFlyImpl() method to change,
1590  // which will eventually be called by the CopyRange() below.
1592 
1593  if( pCSttNd )
1594  {
1595  SwTextFormatColl* pColl = pCSttNd->IsTextNode()
1596  ? pCSttNd->GetTextNode()->GetTextColl()
1598 
1599  pSttNd = rNds.MakeTextSection( SwNodeIndex( rNds.GetEndOfRedlines() ),
1600  SwNormalStartNode, pColl );
1601 
1602  SwNodeIndex aNdIdx( *pSttNd, 1 );
1603  SwTextNode* pTextNd = aNdIdx.GetNode().GetTextNode();
1604  SwPosition aPos( aNdIdx, SwIndex( pTextNd ));
1605 
1606  // tdf#115815 keep original start position of collapsed annotation ranges
1607  // as temporary bookmarks (removed after file saving and file loading)
1608  lcl_storeAnnotationMarks( rDoc, pStt, pEnd );
1610 
1611  // Take over the style from the EndNode if needed
1612  // We don't want this in Doc::Copy
1613  if( pCEndNd && pCEndNd != pCSttNd )
1614  {
1615  SwContentNode* pDestNd = aPos.nNode.GetNode().GetContentNode();
1616  if( pDestNd )
1617  {
1618  if( pDestNd->IsTextNode() && pCEndNd->IsTextNode() )
1619  pCEndNd->GetTextNode()->CopyCollFormat(*pDestNd->GetTextNode());
1620  else
1621  pDestNd->ChgFormatColl( pCEndNd->GetFormatColl() );
1622  }
1623  }
1624  }
1625  else
1626  {
1628 
1629  if( pCEndNd )
1630  {
1631  SwPosition aPos( *pSttNd->EndOfSectionNode() );
1633  }
1634  else
1635  {
1636  SwNodeIndex aInsPos( *pSttNd->EndOfSectionNode() );
1637  SwNodeRange aRg( pStt->nNode, SwNodeOffset(0), pEnd->nNode, SwNodeOffset(1) );
1639  }
1640  }
1641  m_pContentSect = new SwNodeIndex( *pSttNd );
1642 
1643  rDoc.SetCopyIsMove( bSaveCopyFlag );
1644  rDoc.getIDocumentRedlineAccess().SetRedlineMove( bSaveRdlMoveFlg );
1645 }
1646 
1648 {
1649  if( !m_pContentSect )
1650  return;
1651 
1652  const SwPosition* pStt = Start(),
1653  * pEnd = End();
1654 
1655  SwDoc& rDoc = GetDoc();
1656  SwPaM aPam( *pStt, *pEnd );
1657  SwContentNode* pCSttNd = pStt->nNode.GetNode().GetContentNode();
1658  SwContentNode* pCEndNd = pEnd->nNode.GetNode().GetContentNode();
1659 
1660  if( !pCSttNd )
1661  {
1662  // In order to not move other Redlines' indices, we set them
1663  // to the end (is exclusive)
1664  const SwRedlineTable& rTable = rDoc.getIDocumentRedlineAccess().GetRedlineTable();
1665  for(SwRangeRedline* pRedl : rTable)
1666  {
1667  if( pRedl->GetBound() == *pStt )
1668  pRedl->GetBound() = *pEnd;
1669  if( pRedl->GetBound(false) == *pStt )
1670  pRedl->GetBound(false) = *pEnd;
1671  }
1672  }
1673 
1674  if( pCSttNd && pCEndNd )
1675  {
1676  // #i100466# - force a <join next> on <delete and join> operation
1677  // tdf#125319 - rather not?
1678  rDoc.getIDocumentContentOperations().DeleteAndJoin(aPam/*, true*/);
1679  }
1680  else if( pCSttNd || pCEndNd )
1681  {
1682  if( pCSttNd && !pCEndNd )
1683  m_bDelLastPara = true;
1685 
1686  if( m_bDelLastPara )
1687  {
1688  // To prevent dangling references to the paragraph to
1689  // be deleted, redline that point into this paragraph should be
1690  // moved to the new end position. Since redlines in the redline
1691  // table are sorted and the pEnd position is an endnode (see
1692  // bDelLastPara condition above), only redlines before the
1693  // current ones can be affected.
1694  const SwRedlineTable& rTable = rDoc.getIDocumentRedlineAccess().GetRedlineTable();
1695  size_t n = nMyPos;
1696  for( bool bBreak = false; !bBreak && n > 0; )
1697  {
1698  --n;
1699  bBreak = true;
1700  if( rTable[ n ]->GetBound() == *aPam.GetPoint() )
1701  {
1702  rTable[ n ]->GetBound() = *pEnd;
1703  bBreak = false;
1704  }
1705  if( rTable[ n ]->GetBound(false) == *aPam.GetPoint() )
1706  {
1707  rTable[ n ]->GetBound(false) = *pEnd;
1708  bBreak = false;
1709  }
1710  }
1711 
1712  *GetPoint() = *pEnd;
1713  *GetMark() = *pEnd;
1714  DeleteMark();
1715 
1716  aPam.GetBound().nContent.Assign( nullptr, 0 );
1717  aPam.GetBound( false ).nContent.Assign( nullptr, 0 );
1718  aPam.DeleteMark();
1720  }
1721  }
1722  else
1723  {
1725  }
1726 
1727  if( pStt == GetPoint() )
1728  Exchange();
1729 
1730  DeleteMark();
1731 }
1732 
1734 {
1735  if( m_pContentSect )
1736  {
1737  SwDoc& rDoc = GetDoc();
1738  const SwRedlineTable& rTable = rDoc.getIDocumentRedlineAccess().GetRedlineTable();
1739  std::vector<SwPosition*> aBeforeArr, aBehindArr;
1740  bool bBreak = false;
1742 
1743  for( n = nMyPos+1; !bBreak && n < rTable.size(); ++n )
1744  {
1745  bBreak = true;
1746  if( rTable[ n ]->GetBound() == *GetPoint() )
1747  {
1748  SwRangeRedline* pRedl = rTable[n];
1749  aBehindArr.push_back(&pRedl->GetBound());
1750  bBreak = false;
1751  }
1752  if( rTable[ n ]->GetBound(false) == *GetPoint() )
1753  {
1754  SwRangeRedline* pRedl = rTable[n];
1755  aBehindArr.push_back(&pRedl->GetBound(false));
1756  bBreak = false;
1757  }
1758  }
1759  for( bBreak = false, n = nMyPos; !bBreak && n ; )
1760  {
1761  --n;
1762  bBreak = true;
1763  if( rTable[ n ]->GetBound() == *GetPoint() )
1764  {
1765  SwRangeRedline* pRedl = rTable[n];
1766  aBeforeArr.push_back(&pRedl->GetBound());
1767  bBreak = false;
1768  }
1769  if( rTable[ n ]->GetBound(false) == *GetPoint() )
1770  {
1771  SwRangeRedline* pRedl = rTable[n];
1772  aBeforeArr.push_back(&pRedl->GetBound(false));
1773  bBreak = false;
1774  }
1775  }
1776 
1777  const SwNode* pKeptContentSectNode( &m_pContentSect->GetNode() ); // #i95711#
1778  {
1779  SwPaM aPam( m_pContentSect->GetNode(),
1781  SwNodeOffset( m_bDelLastPara ? -2 : -1 ) );
1782  SwContentNode* pCNd = aPam.GetContentNode();
1783  if( pCNd )
1784  aPam.GetPoint()->nContent.Assign( pCNd, pCNd->Len() );
1785  else
1786  ++aPam.GetPoint()->nNode;
1787 
1788  SwFormatColl* pColl = pCNd && pCNd->Len() && aPam.GetPoint()->nNode !=
1789  aPam.GetMark()->nNode
1790  ? pCNd->GetFormatColl() : nullptr;
1791 
1792  SwNodeIndex aNdIdx( GetPoint()->nNode, -1 );
1793  const sal_Int32 nPos = GetPoint()->nContent.GetIndex();
1794 
1795  SwPosition aPos( *GetPoint() );
1796  if( m_bDelLastPara && *aPam.GetPoint() == *aPam.GetMark() )
1797  {
1798  --aPos.nNode;
1799 
1801  }
1802  else
1803  {
1804  rDoc.getIDocumentContentOperations().MoveRange( aPam, aPos,
1806  }
1807 
1808  SetMark();
1809  *GetPoint() = aPos;
1810  GetMark()->nNode = aNdIdx.GetIndex() + 1;
1811  pCNd = GetMark()->nNode.GetNode().GetContentNode();
1812  GetMark()->nContent.Assign( pCNd, nPos );
1813 
1814  if( m_bDelLastPara )
1815  {
1816  ++GetPoint()->nNode;
1817  pCNd = GetContentNode();
1818  GetPoint()->nContent.Assign( pCNd, 0 );
1819  m_bDelLastPara = false;
1820  }
1821  else if( pColl )
1822  pCNd = GetContentNode();
1823 
1824  if( pColl && pCNd )
1825  pCNd->ChgFormatColl( pColl );
1826  }
1827 
1828  // #i95771#
1829  // Under certain conditions the previous <SwDoc::Move(..)> has already
1830  // removed the change tracking section of this <SwRangeRedline> instance from
1831  // the change tracking nodes area.
1832  // Thus, check if <pContentSect> still points to the change tracking section
1833  // by comparing it with the "indexed" <SwNode> instance copied before
1834  // perform the intrinsic move.
1835  // Note: Such condition is e.g. a "delete" change tracking only containing a table.
1836  if ( &m_pContentSect->GetNode() == pKeptContentSectNode )
1837  {
1839  }
1840  delete m_pContentSect;
1841  m_pContentSect = nullptr;
1842 
1843  // adjustment of redline table positions must take start and
1844  // end into account, not point and mark.
1845  for( auto& pItem : aBeforeArr )
1846  *pItem = *Start();
1847  for( auto& pItem : aBehindArr )
1848  *pItem = *End();
1849  }
1850  else
1852 }
1853 
1854 // for Undo
1856 {
1857  if( pIdx && !m_pContentSect )
1858  {
1859  m_pContentSect = new SwNodeIndex( *pIdx );
1860  m_bIsVisible = false;
1861  }
1862  else if( !pIdx && m_pContentSect )
1863  {
1864  delete m_pContentSect;
1865  m_pContentSect = nullptr;
1866  m_bIsVisible = false;
1867  }
1868  else
1869  {
1870  OSL_FAIL("SwRangeRedline::SetContentIdx: invalid state");
1871  }
1872 }
1873 
1874 bool SwRangeRedline::CanCombine( const SwRangeRedline& rRedl ) const
1875 {
1876  return IsVisible() && rRedl.IsVisible() &&
1878 }
1879 
1880 void SwRangeRedline::PushData( const SwRangeRedline& rRedl, bool bOwnAsNext )
1881 {
1882  SwRedlineData* pNew = new SwRedlineData( *rRedl.m_pRedlineData, false );
1883  if( bOwnAsNext )
1884  {
1885  pNew->m_pNext = m_pRedlineData;
1886  m_pRedlineData = pNew;
1887  }
1888  else
1889  {
1890  pNew->m_pNext = m_pRedlineData->m_pNext;
1891  m_pRedlineData->m_pNext = pNew;
1892  }
1893 }
1894 
1896 {
1897  if( !m_pRedlineData->m_pNext )
1898  return false;
1899  SwRedlineData* pCur = m_pRedlineData;
1900  m_pRedlineData = pCur->m_pNext;
1901  pCur->m_pNext = nullptr;
1902  delete pCur;
1903  return true;
1904 }
1905 
1907 {
1908  sal_uInt16 nRet = 1;
1909  for( SwRedlineData* pCur = m_pRedlineData; pCur->m_pNext; pCur = pCur->m_pNext )
1910  ++nRet;
1911  return nRet;
1912 }
1913 
1914 std::size_t SwRangeRedline::GetAuthor( sal_uInt16 nPos ) const
1915 {
1916  return GetRedlineData(nPos).m_nAuthor;
1917 }
1918 
1919 OUString const & SwRangeRedline::GetAuthorString( sal_uInt16 nPos ) const
1920 {
1921  return SW_MOD()->GetRedlineAuthor(GetRedlineData(nPos).m_nAuthor);
1922 }
1923 
1924 const DateTime& SwRangeRedline::GetTimeStamp( sal_uInt16 nPos ) const
1925 {
1926  return GetRedlineData(nPos).m_aStamp;
1927 }
1928 
1929 RedlineType SwRangeRedline::GetType( sal_uInt16 nPos ) const
1930 {
1931  return GetRedlineData(nPos).m_eType;
1932 }
1933 
1935 {
1936  return GetText().getLength() == 1 && GetText()[0] == CH_TXTATR_INWORD;
1937 }
1938 
1939 const OUString& SwRangeRedline::GetComment( sal_uInt16 nPos ) const
1940 {
1941  return GetRedlineData(nPos).m_sComment;
1942 }
1943 
1945 {
1946  if (*Start() < *rCmp.Start())
1947  return true;
1948 
1949  return *Start() == *rCmp.Start() && *End() < *rCmp.End();
1950 }
1951 
1952 const SwRedlineData & SwRangeRedline::GetRedlineData(const sal_uInt16 nPos) const
1953 {
1954  SwRedlineData * pCur = m_pRedlineData;
1955 
1956  sal_uInt16 nP = nPos;
1957 
1958  while (nP > 0 && nullptr != pCur->m_pNext)
1959  {
1960  pCur = pCur->m_pNext;
1961 
1962  nP--;
1963  }
1964 
1965  SAL_WARN_IF( nP != 0, "sw.core", "Pos " << nPos << " is " << nP << " too big");
1966 
1967  return *pCur;
1968 }
1969 
1970 OUString SwRangeRedline::GetDescr(bool bSimplified)
1971 {
1972  // get description of redline data (e.g.: "insert $1")
1973  OUString aResult = GetRedlineData().GetDescr();
1974 
1975  SwPaM * pPaM = nullptr;
1976  bool bDeletePaM = false;
1977 
1978  // if this redline is visible the content is in this PaM
1979  if (nullptr == m_pContentSect)
1980  {
1981  pPaM = this;
1982  }
1983  else // otherwise it is saved in pContentSect
1984  {
1986  pPaM = new SwPaM(*m_pContentSect, aTmpIdx );
1987  bDeletePaM = true;
1988  }
1989 
1990  OUString sDescr = DenoteSpecialCharacters(pPaM->GetText().replace('\n', ' '), /*bQuoted=*/!bSimplified);
1991  if (const SwTextNode *pTextNode = pPaM->GetNode().GetTextNode())
1992  {
1993  if (const SwTextAttr* pTextAttr = pTextNode->GetFieldTextAttrAt(pPaM->GetPoint()->nContent.GetIndex() - 1, true ))
1994  {
1995  sDescr = ( bSimplified ? "" : SwResId(STR_START_QUOTE) )
1996  + pTextAttr->GetFormatField().GetField()->GetFieldName()
1997  + ( bSimplified ? "" : SwResId(STR_END_QUOTE) );
1998  }
1999  }
2000 
2001  // replace $1 in description by description of the redlines text
2002  const OUString aTmpStr = ShortenString(sDescr, nUndoStringLength, SwResId(STR_LDOTS));
2003 
2004  if (!bSimplified)
2005  {
2006  SwRewriter aRewriter;
2007  aRewriter.AddRule(UndoArg1, aTmpStr);
2008 
2009  aResult = aRewriter.Apply(aResult);
2010  }
2011  else
2012  {
2013  aResult = aTmpStr;
2014  // more shortening
2015  sal_Int32 nPos = aTmpStr.indexOf(SwResId(STR_LDOTS));
2016  if (nPos > 5)
2017  aResult = aTmpStr.copy(0, nPos + SwResId(STR_LDOTS).getLength());
2018  }
2019 
2020  if (bDeletePaM)
2021  delete pPaM;
2022 
2023  return aResult;
2024 }
2025 
2027 {
2028  (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SwRangeRedline"));
2029 
2030  (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("ptr"), "%p", this);
2031  (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("id"), BAD_CAST(OString::number(GetSeqNo()).getStr()));
2032  (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("author"), BAD_CAST(SW_MOD()->GetRedlineAuthor(GetAuthor()).toUtf8().getStr()));
2033  (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("date"), BAD_CAST(DateTimeToOString(GetTimeStamp()).getStr()));
2034  (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("descr"), BAD_CAST(const_cast<SwRangeRedline*>(this)->GetDescr().toUtf8().getStr()));
2035 
2036  OString sRedlineType;
2037  switch (GetType())
2038  {
2039  case RedlineType::Insert:
2040  sRedlineType = "REDLINE_INSERT";
2041  break;
2042  case RedlineType::Delete:
2043  sRedlineType = "REDLINE_DELETE";
2044  break;
2045  case RedlineType::Format:
2046  sRedlineType = "REDLINE_FORMAT";
2047  break;
2048  default:
2049  sRedlineType = "UNKNOWN";
2050  break;
2051  }
2052  (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("type"), BAD_CAST(sRedlineType.getStr()));
2053 
2054  SwPaM::dumpAsXml(pWriter);
2055 
2056  (void)xmlTextWriterEndElement(pWriter);
2057 }
2058 
2060 {
2061  m_aExtraRedlines.push_back( p );
2062  //p->CallDisplayFunc();
2063 }
2064 
2065 void SwExtraRedlineTable::DeleteAndDestroy(sal_uInt16 const nPos)
2066 {
2067  /*
2068  SwDoc* pDoc = 0;
2069  if( !nP && nL && nL == size() )
2070  pDoc = front()->GetDoc();
2071  */
2072 
2073  delete m_aExtraRedlines[nPos];
2074  m_aExtraRedlines.erase(m_aExtraRedlines.begin() + nPos);
2075 
2076  /*
2077  SwViewShell* pSh;
2078  if( pDoc && !pDoc->IsInDtor() &&
2079  0 != ( pSh = pDoc->getIDocumentLayoutAccess().GetCurrentViewShell() ) )
2080  pSh->InvalidateWindows( SwRect( 0, 0, SAL_MAX_INT32, SAL_MAX_INT32 ) );
2081  */
2082 }
2083 
2085 {
2086  while (!m_aExtraRedlines.empty())
2087  {
2088  auto const pRedline = m_aExtraRedlines.back();
2089  m_aExtraRedlines.pop_back();
2090  delete pRedline;
2091  }
2092 }
2093 
2095 {
2096 }
2097 
2099  : m_aRedlineData(rData)
2100  , m_rTableLine(rTableLine)
2101 {
2102 }
2103 
2105 {
2106 }
2107 
2109  : m_aRedlineData(rData)
2110  , m_rTableBox(rTableBox)
2111 {
2112 }
2113 
2115 {
2116 }
2117 
2118 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual ~SwRedlineExtraData_FormatColl() override
Definition: docredln.cxx:891
void SetCopyIsMove(bool bFlag)
Definition: doc.hxx:1372
const SwEndNode * EndOfSectionNode() const
Definition: node.hxx:692
Starts a section of nodes in the document model.
Definition: node.hxx:313
Base class of the Writer layout elements.
Definition: frame.hxx:314
Represents the visualization of a paragraph.
Definition: txtfrm.hxx:162
virtual sal_Int32 Len() const
Definition: node.cxx:1243
void DeleteMark()
Definition: pam.hxx:178
bool CanCombine(const SwRangeRedline &rRedl) const
Definition: docredln.cxx:1874
SwRedlineData(RedlineType eT, std::size_t nAut)
Definition: docredln.cxx:1017
SwNode & GetNode(bool bPoint=true) const
Definition: pam.hxx:224
bool InsertWithValidRanges(SwRangeRedline *&p, size_type *pInsPos=nullptr)
Definition: docredln.cxx:594
void Show(sal_uInt16 nLoop, size_t nMyPos, bool bForced=false)
Definition: docredln.cxx:1244
bool IsFollow() const
Definition: flowfrm.hxx:166
sal_uInt16 GetSeqNo() const
Definition: redline.hxx:228
void Insert(SwExtraRedline *p)
Definition: docredln.cxx:2059
SwNodeOffset EndOfSectionIndex() const
Definition: node.hxx:687
Represents the style of a paragraph.
Definition: fmtcol.hxx:56
Marks a position in the document model.
Definition: pam.hxx:36
bool IsSectionNode() const
Definition: node.hxx:654
SwNodeIndex * m_pContentSect
Definition: redline.hxx:159
static void lcl_storeAnnotationMarks(SwDoc &rDoc, const SwPosition *pStt, const SwPosition *pEnd)
Definition: docredln.cxx:1458
void SetContentIdx(const SwNodeIndex *)
Definition: docredln.cxx:1855
OUString const & GetAuthorString(sal_uInt16 nPos=0) const
Definition: docredln.cxx:1919
virtual ~SwRangeRedline() override
Definition: docredln.cxx:1161
const OUString & GetText() const
Definition: ndtxt.hxx:218
void SetSec(sal_uInt16 nNewSec)
OUString toISO8601(const css::util::DateTime &rDateTime)
SwRedlineData * m_pNext
Definition: redline.hxx:89
constexpr TypedWhichId< SwFormatChg > RES_FMT_CHG(162)
SwRect FindLayoutRect(const bool bPrtArea=false, const Point *pPoint=nullptr) const
Definition: node.cxx:1218
void MaybeNotifyRedlinePositionModification(tools::Long nTop)
Definition: docredln.cxx:1189
virtual void SetRedlineFlags_intern(RedlineFlags eMode)=0
Set a new redline mode.
void TriggerNodeUpdate(const sw::LegacyModifyHint &)
for hanging TextFormatCollections somewhere else (Outline-Numbering!)
Definition: ndtxt.cxx:5259
virtual ~SwExtraRedline()
Definition: docredln.cxx:2094
SwNodeIndex nNode
Definition: pam.hxx:38
virtual void InsertItemSet(const SwPaM &rRg, const SfxItemSet &, const SetAttrMode nFlags=SetAttrMode::DEFAULT, SwRootFrame const *pLayout=nullptr)=0
SwTextFormatColl * FindTextFormatCollByName(const OUString &rName) const
Definition: doc.hxx:798
wrapper iterator: wraps iterator of implementation while hiding MarkBase class; only IMark instances ...
virtual void SetModified()=0
Must be called manually at changes of format.
#define FRM_CNTNT
Definition: frame.hxx:103
long Long
size_type FindPrevOfSeqNo(size_type nSttPos) const
Definition: docredln.cxx:687
const SwPosition * GetMark() const
Definition: pam.hxx:210
void CallDisplayFunc(size_t nMyPos)
Definition: docredln.cxx:1233
SwContentFrame * getLayoutFrame(const SwRootFrame *, const SwPosition *pPos=nullptr, std::pair< Point, bool > const *pViewPosAndCalcFrame=nullptr) const
Definition: node.cxx:1210
sal_Int64 n
void Remove(size_type nPos)
Definition: docredln.cxx:643
Provides access to the marks of a document.
virtual void SetMark() override
Unless this is called, the getter method of Mark will return Point.
Definition: viscrs.cxx:868
ViewShellDocId GetDocId() const override
Definition: doc.hxx:187
void CalcStartEnd(SwNodeOffset nNdIdx, sal_Int32 &rStart, sal_Int32 &rEnd) const
Calculates the intersection with text node number nNdIdx.
Definition: docredln.cxx:1422
const SwRedlineData & GetRedlineData() const
Definition: redline.hxx:327
void SetEnd(const SwPosition &rPos, SwPosition *pEndPtr=nullptr)
Definition: docredln.cxx:1209
virtual bool operator==(const SwRedlineExtraData &) const
Definition: docredln.cxx:876
const Point & GetSttPos() const
Definition: viscrs.hxx:157
virtual void DeleteRange(SwPaM &)=0
Delete a range SwFlyFrameFormat.
SwTableLine is one table row in the document model.
Definition: swtable.hxx:357
SwNode & GetNode() const
Definition: ndindex.hxx:128
const SwRedlineData & GetRedlineData() const
Definition: redline.hxx:306
virtual bool MoveRange(SwPaM &, SwPosition &, SwMoveFlags)=0
SwTableCellRedline(const SwRedlineData &rData, const SwTableBox &rTableBox)
Definition: docredln.cxx:2108
SwPosition & GetBound(bool bOne=true)
Definition: pam.hxx:246
IDocumentMarkAccess * getIDocumentMarkAccess()
Definition: docbm.cxx:1792
const SwTableBox & GetTableBox() const
Definition: redline.hxx:325
Dialog to specify the properties of date form field.
IDocumentUndoRedo & GetIDocumentUndoRedo()
Definition: doc.cxx:144
virtual bool InsertPoolItem(const SwPaM &rRg, const SfxPoolItem &, const SetAttrMode nFlags=SetAttrMode::DEFAULT, SwRootFrame const *pLayout=nullptr, SwTextAttr **ppNewTextAttr=nullptr)=0
Insert an attribute.
bool m_bIsVisible
Definition: redline.hxx:161
Of course Writer needs its own rectangles.
Definition: swrect.hxx:34
static bool CheckPosition(const SwPosition *pStt, const SwPosition *pEnd)
Definition: docredln.cxx:109
SwNodeOffset abs(const SwNodeOffset &a)
Definition: nodeoffset.hxx:34
static SwFlowFrame * CastFlowFrame(SwFrame *pFrame)
Definition: flowfrm.cxx:2709
bool IsAnnotation() const
Definition: docredln.cxx:1934
IDocumentContentOperations const & getIDocumentContentOperations() const
Definition: doc.cxx:315
bool m_bMoved
Definition: redline.hxx:98
The root element of a Writer document layout.
Definition: rootfrm.hxx:81
bool CanCombine(const SwRedlineData &rCmp) const
Definition: docredln.cxx:1054
void dumpAsXml(xmlTextWriterPtr pWriter) const
Definition: pam.cxx:1149
virtual SwRedlineExtraData * CreateNew() const override
Definition: docredln.cxx:979
bool HasValidRange() const
Do we have a valid selection?
Definition: docredln.cxx:1218
SwWrtShell & GetWrtShell() const
Definition: view.hxx:413
show all inserts
size_type size() const
Definition: docary.hxx:267
static sal_uInt32 s_nLastId
Definition: redline.hxx:172
SwContentNode * GetContentNode(bool bPoint=true) const
Definition: pam.hxx:230
OUString SwResId(TranslateId aId)
Definition: swmodule.cxx:164
const SfxPoolItem * NextItem()
RedlineType GetType() const
Definition: redline.hxx:126
#define CH_TXTATR_INWORD
Definition: hintids.hxx:174
virtual void Reject(SwPaM &rPam) const
Definition: docredln.cxx:872
new delete redline is created
Definition: hints.hxx:121
void GoEndSection(SwPosition *pPos)
go to the end of the current base section
Definition: pam.cxx:933
virtual SwRedlineExtraData * CreateNew() const override
Definition: docredln.cxx:895
SwIndex nContent
Definition: pam.hxx:39
enumrange< T >::Iterator begin(enumrange< T >)
OUString GetDescr() const
Definition: docredln.cxx:1100
OString join(std::string_view rSeparator, const std::vector< OString > &rSequence)
bool SetTextFormatColl(const SwPaM &rRg, SwTextFormatColl *pFormat, const bool bReset=true, const bool bResetListAttrs=false, SwRootFrame const *pLayout=nullptr)
Add 4th optional parameter .
Definition: docfmt.cxx:1083
A wrapper around SfxPoolItem to store the start position of (usually) a text portion, with an optional end.
Definition: txatbase.hxx:43
virtual void MoveAndJoin(SwPaM &, SwPosition &)=0
Move a range.
IDocumentStylePoolAccess const & getIDocumentStylePoolAccess() const
Definition: doc.cxx:426
check if target position is in fly anchored at source range
const DateTime & GetTimeStamp(sal_uInt16 nPos=0) const
Definition: docredln.cxx:1924
static SfxViewShell * GetNext(const SfxViewShell &rPrev, bool bOnlyVisible=true, const std::function< bool(const SfxViewShell *)> &isViewShell=nullptr)
static SfxViewShell * Current()
static void LOKRedlineNotification(RedlineNotification eType, SwRangeRedline *pRedline)
Emits LOK notification about one addition / removal of a redline item.
Definition: docredln.cxx:343
virtual ~SwRedlineExtraData()
Definition: docredln.cxx:868
virtual void libreOfficeKitViewCallback(int nType, const char *pPayload) const override
bool IsStartNode() const
Definition: node.hxx:634
void DeleteAndDestroy(sal_uInt16 nPos)
Definition: docredln.cxx:2065
void MoveFromSection(size_t nMyPos)
Definition: docredln.cxx:1733
const SwTable & GetTable() const
Definition: node.hxx:506
virtual void DeleteSection(SwNode *pNode)=0
Delete section containing the node.
virtual bool IsRedlineMove() const =0
const SfxPoolItem * GetDfltAttr(sal_uInt16 nWhich)
Get the default attribute from corresponding default attribute table.
Definition: hints.cxx:156
void ShowOriginal(sal_uInt16 nLoop, size_t nMyPos, bool bForced=false)
Definition: docredln.cxx:1334
SwNodeOffset GetIndex() const
Definition: ndindex.hxx:161
RedlineFlags on.
virtual bool DoesUndo() const =0
Is Undo enabled?
sal_uInt16 GetStackCount() const
Definition: docredln.cxx:1906
virtual void SetKeyCode(const vcl::KeyCode &)=0
std::vector< sal_uInt16 > m_aWhichIds
Definition: redline.hxx:74
Redline that holds information about a table-cell that had some change.
Definition: redline.hxx:311
void dumpAsXml(xmlTextWriterPtr pWriter) const
Definition: docredln.cxx:2026
const SwRedlineData & GetRedlineData(sal_uInt16 nPos=0) const
Definition: docredln.cxx:1952
virtual void SetShortName(const OUString &)=0
virtual bool operator==(const SwRedlineExtraData &) const override
Definition: docredln.cxx:942
OUString GetDescr(bool bSimplified=false)
Returns textual description of a redline data element of this redline.
Definition: docredln.cxx:1970
SwNode & GetEndOfContent() const
Regular ContentSection (i.e. the BodyText).
Definition: ndarr.hxx:162
virtual void Reject(SwPaM &rPam) const override
Definition: docredln.cxx:984
SwStartNode * MakeTextSection(const SwNodeIndex &rWhere, SwStartNodeType eSttNdTyp, SwTextFormatColl *pColl)
Definition: nodes.cxx:1896
css::util::DateTime GetUNODateTime() const
void InvalidateRange(Invalidation)
Initiate the layout.
Definition: docredln.cxx:1377
virtual ~SwTableRowRedline() override
Definition: docredln.cxx:2104
void DelCopyOfSection(size_t nMyPos)
Definition: docredln.cxx:1647
bool IsContentNode() const
Definition: node.hxx:638
OUString GetText() const
Definition: pam.cxx:1074
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:137
size_type FindPrevSeqNo(sal_uInt16 nSeqNo, size_type nSttPos) const
Definition: docredln.cxx:718
void SetExtraData(const SwRedlineExtraData *pData)
ExtraData is copied.
Definition: docredln.cxx:1075
size_type GetPos(const SwRangeRedline *p) const
Definition: docredln.cxx:627
delete redline is removed
Definition: hints.hxx:131
SwPaM(SwPaM const &rPaM)=delete
#define SW_MOD()
Definition: swmodule.hxx:255
#define SAL_MAX_INT32
virtual void Reject(SwPaM &rPam) const override
Definition: docredln.cxx:900
const SwCursorShell * GetShell() const
Definition: viscrs.hxx:118
std::vector< SwRangeRedline * > GetAllValidRanges(std::unique_ptr< SwRangeRedline > p)
Definition: docredln.cxx:484
int i
const SwStartNode * StartOfSectionNode() const
Definition: node.hxx:133
void DeleteAndDestroy(size_type nPos)
Definition: docredln.cxx:672
const SwPosition * GetPoint() const
Definition: pam.hxx:208
SwTableRowRedline(const SwRedlineData &rData, const SwTableLine &rTableLine)
Definition: docredln.cxx:2098
virtual bool CopyRange(SwPaM &rPam, SwPosition &rPos, SwCopyFlags flags) const =0
Copy a selected content range to a position.
void SetItemSet(const SfxItemSet &rSet)
Definition: docredln.cxx:951
SwFrameType
Definition: frame.hxx:74
OUString DenoteSpecialCharacters(const OUString &rStr, bool bQuoted=true)
Denotes special characters in a string.
Definition: undel.cxx:717
SwIndex & Assign(SwIndexReg *, sal_Int32)
Definition: index.cxx:206
OUString Apply(const OUString &rStr) const
Definition: SwRewriter.cxx:39
OUString SwRedlineTypeToOUString(RedlineType eType)
::sw::DocumentContentOperationsManager const & GetDocumentContentOperationsManager() const
Definition: doc.cxx:325
void DeleteAndDestroyAll()
Definition: docredln.cxx:660
void Exchange()
Definition: pam.cxx:490
virtual ~SwRedlineExtraData_Format() override
Definition: docredln.cxx:975
SwContentNode * GetContentNode()
Definition: node.hxx:625
SwNodeOffset GetIndex() const
Definition: node.hxx:292
vector_type::size_type size_type
Definition: docary.hxx:222
void CopyToSection()
Definition: docredln.cxx:1569
sal_uInt16 Count() const
bool IsShowChangesInMargin() const
Definition: viewopt.hxx:294
bool HasMark() const
A PaM marks a selection if Point and Mark are distinct positions.
Definition: pam.hxx:206
bool DeleteTableRowRedline(SwDoc *pDoc, const SwTableLine &rTableLine, bool bSaveInUndo, RedlineType nRedlineTypeToDelete)
Definition: docredln.cxx:187
void Hide(sal_uInt16 nLoop, size_t nMyPos, bool bForced=false)
Definition: docredln.cxx:1298
Marks a character position inside a document model node.
Definition: index.hxx:33
void AddRule(SwUndoArg eWhat, const OUString &rWith)
Definition: SwRewriter.cxx:25
std::optional< tools::Long > m_oLOKLastNodeTop
Definition: redline.hxx:164
const DateTime & GetTimeStamp() const
Definition: redline.hxx:130
void dumpAsXml(xmlTextWriterPtr pWriter) const
Definition: docredln.cxx:857
IDocumentState const & getIDocumentState() const
Definition: doc.cxx:394
const SwRangeRedline * FindAtPosition(const SwPosition &startPosition, size_type &tableIndex, bool next=true) const
Find the redline at the given position.
Definition: docredln.cxx:739
size
Marks a node in the document model.
Definition: ndindex.hxx:30
SwNodes & GetNodes()
Node is in which nodes-array/doc?
Definition: node.hxx:703
virtual SwFormatColl * ChgFormatColl(SwFormatColl *)
Definition: node.cxx:1245
Base object for 'Redlines' that are not of 'Ranged' type (like table row insert)
Definition: redline.hxx:279
static SfxViewShell * GetFirst(bool bOnlyVisible=true, const std::function< bool(const SfxViewShell *)> &isViewShell=nullptr)
SW_DLLPUBLIC bool DeleteAllTableRedlines(SwDoc &rDoc, const SwTable &rTable, bool bSaveInUndo, RedlineType nRedlineTypeToDelete)
Definition: docredln.cxx:136
sal_uInt32 GetId() const
Definition: redline.hxx:186
Redline that holds information about a table-row that had some change.
Definition: redline.hxx:290
show all deletes
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
Definition: doc.cxx:405
void InvalidateWindows(const SwRect &rRect)
Definition: viewsh.cxx:556
SwTable is one table in the document model, containing rows (which contain cells).
Definition: swtable.hxx:112
const SwPosition * Start() const
Definition: pam.hxx:213
bool IsVisible() const
Definition: redline.hxx:191
virtual void SetRedlineMove(bool bFlag)=0
const TranslateId STR_REDLINE_ARY[]
Definition: docredln.cxx:1086
const OUString & GetComment(sal_uInt16 nPos=0) const
Definition: docredln.cxx:1939
void SetComment(const OUString &rS)
Definition: redline.hxx:216
ignore Redlines
SwRedlineExtraData_FormatColl(const OUString &rColl, sal_uInt16 nPoolFormatId, const SfxItemSet *pSet=nullptr, bool bFormatAll=true)
Definition: docredln.cxx:881
const SwTableLine & GetTableLine() const
Definition: redline.hxx:304
size_type FindNextOfSeqNo(size_type nSttPos) const
Definition: docredln.cxx:680
const OUString & GetComment() const
Definition: redline.hxx:129
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:79
std::unique_ptr< SfxItemSet > m_pSet
Definition: redline.hxx:55
bool isMoved(size_type tableIndex) const
Definition: docredln.cxx:766
std::vector< SwRect > SwRects
Definition: swregion.hxx:26
OUString m_sComment
Definition: redline.hxx:92
IDocumentRedlineAccess const & getIDocumentRedlineAccess() const
Definition: doc.cxx:335
SwRedlineExtraData * m_pExtraData
Definition: redline.hxx:90
const SwStartNode * GetSttNd() const
Definition: swtable.hxx:471
virtual SwRedlineExtraData * CreateNew() const =0
void sw_DebugRedline(const SwDoc *pDoc)
Definition: docredln.cxx:68
bool operator<(const SwRangeRedline &) const
Definition: docredln.cxx:1944
std::size_t GetAuthor(sal_uInt16 nPos=0) const
Definition: docredln.cxx:1914
#define SAL_WARN_IF(condition, area, stream)
RedlineType m_eType
Definition: redline.hxx:95
void dumpAsXml(xmlTextWriterPtr pWriter) const
Definition: docredln.cxx:92
virtual const SwViewShell * GetCurrentViewShell() const =0
Returns the layout set at the document.
void CopyWithFlyInFly(const SwNodeRange &rRg, const SwNodeIndex &rInsPos, const std::pair< const SwPaM &, const SwPosition & > *pCopiedPaM=nullptr, bool bMakeNewFrames=true, bool bDelRedlines=true, bool bCopyFlyAtFly=false, SwCopyFlags flags=SwCopyFlags::Default) const
note: rRg/rInsPos exclude a partially selected start text node; pCopiedPaM includes a partially selec...
virtual bool operator==(const SwRedlineExtraData &) const override
Definition: docredln.cxx:1001
const SwNodes & GetNodes() const
Definition: ndindex.hxx:165
OUString ShortenString(const OUString &rStr, sal_Int32 nLength, const OUString &rFillStr)
Shortens a string to a maximum length.
Definition: undobj.cxx:1534
void ClearPara()
Removes the Line information from the Cache but retains the entry itself.
Definition: txtcache.cxx:104
const SwViewOption * GetViewOptions() const
Definition: viewsh.hxx:428
void PushData(const SwRangeRedline &rRedl, bool bOwnAsNext=true)
Definition: docredln.cxx:1880
bool IsCopyIsMove() const
Definition: doc.hxx:1371
virtual bool DelFullPara(SwPaM &)=0
Delete full paragraphs.
sal_Int32 GetIndex() const
Definition: index.hxx:91
OString DateTimeToOString(const DateTime &rDateTime)
SwNodes & GetNodes()
Definition: doc.hxx:408
virtual SwTextFormatColl * GetTextCollFromPool(sal_uInt16 nId, bool bRegardLanguage=true)=0
Return "Auto-Collection with ID.
void SetMoved()
Definition: redline.hxx:272
std::u16string_view trim(std::u16string_view str)
const SwPosition * End() const
Definition: pam.hxx:218
RedlineType GetType(sal_uInt16 nPos=0) const
Definition: docredln.cxx:1929
SwTableBox is one table cell in the document model.
Definition: swtable.hxx:418
void MoveToSection()
Definition: docredln.cxx:1494
void SetNanoSec(sal_uInt32 nNewNanoSec)
o3tl::strong_int< sal_Int32, struct Tag_SwNodeOffset > SwNodeOffset
Definition: nodeoffset.hxx:16
double getLength(const B2DPolygon &rCandidate)
size_type FindNextSeqNo(sal_uInt16 nSeqNo, size_type nSttPos) const
Search next or previous Redline with the same Seq.
Definition: docredln.cxx:695
virtual bool AppendTextNode(SwPosition &rPos)=0
RedlineNotification
Definition: docary.hxx:215
virtual void CallSwClientNotify(const SfxHint &rHint) const override
Definition: calbck.cxx:325
virtual ~SwTableCellRedline() override
Definition: docredln.cxx:2114
SwTableNode * FindTableNode()
Search table node, in which it is.
Definition: node.cxx:358
constexpr sal_Int32 COMPLETE_STRING
Definition: swtypes.hxx:57
void CopyCollFormat(SwTextNode &rDestNd, bool bUndoForChgFormatColl=true)
Copy collection with all auto formats to dest-node.
Definition: ndcopy.cxx:336
void DeleteAndDestroyAll()
Definition: docredln.cxx:2084
const Point & GetEndPos() const
Definition: viscrs.hxx:159
bool IsInDtor() const
Definition: doc.hxx:403
virtual RedlineFlags GetRedlineFlags() const =0
Query the currently set redline mode.
SwContentNode * GoPreviousNds(SwNodeIndex *pIdx, bool bChk)
Definition: pam.cxx:318
bool IsTableNode() const
Definition: node.hxx:650
SwFormatColl * GetFormatColl() const
Definition: node.hxx:461
struct _xmlTextWriter * xmlTextWriterPtr
SwDoc & GetDoc() const
Definition: pam.hxx:244
RedlineType
const EnumerationType m_eType
bool DeleteTableCellRedline(SwDoc *pDoc, const SwTableBox &rTableBox, bool bSaveInUndo, RedlineType nRedlineTypeToDelete)
Definition: docredln.cxx:231
virtual void SetMark()
Unless this is called, the getter method of Mark will return Point.
Definition: pam.cxx:476
virtual const SwRedlineTable & GetRedlineTable() const =0
bool Insert(SwRangeRedline *&p)
Definition: docredln.cxx:417
SwNode & GetEndOfRedlines() const
Section for all Redlines.
Definition: ndarr.hxx:157
void MaybeNotifyRedlineModification(SwRangeRedline &rRedline, SwDoc &rDoc)
Definition: docredln.cxx:1173
void CheckOverlapping(vector_type::const_iterator it)
Definition: docredln.cxx:443
SwRootFrame * GetLayout() const
Definition: viewsh.cxx:2172
virtual bool DeleteAndJoin(SwPaM &)=0
complete delete of a given PaM
virtual void Insert(SotClipboardFormatId nFormat, const OUString &rFormatName) override
bool IsTextNode() const
Definition: node.hxx:646
SwRedlineData * m_pRedlineData
Definition: redline.hxx:158
SwRangeRedline(RedlineType eType, const SwPaM &rPam)
Definition: docredln.cxx:1107
bool m_bDelLastPara
Definition: redline.hxx:160
bool operator()(SwRangeRedline *const &lhs, SwRangeRedline *const &rhs) const
Definition: docredln.cxx:617
SwContentNode * GoNext(SwNodeIndex *) const
Definition: nodes.cxx:1300
SwNodeIndex * GetContentIdx() const
Definition: redline.hxx:187
SwRootFrame * getRootFrame()
Definition: frame.hxx:679
Definition: view.hxx:144
const int nUndoStringLength
Definition: UndoCore.hxx:243
void SetStart(const SwPosition &rPos, SwPosition *pSttPtr=nullptr)
Definition: docredln.cxx:1201
sal_uInt16 nPos
bool IsInWriterfilterImport() const
Definition: doc.hxx:971
bool IsInXMLImport() const
Definition: doc.hxx:969
const SfxPoolItem * GetCurItem() const
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
Definition: ndtxt.hxx:864
bool m_bDetectedRangeSegmentation false
DateTime m_aStamp
Definition: redline.hxx:93
static SwStartNode * MakeEmptySection(const SwNodeIndex &rIdx, SwStartNodeType=SwNormalStartNode)
Create an empty section of Start- and EndNote.
Definition: nodes.cxx:1888
SwRedlineExtraData_Format(const SwRedlineExtraData_Format &rCpy)
Definition: docredln.cxx:968
Base class of the Writer document model elements.
Definition: node.hxx:81
SwTextFormatColl * GetTextColl() const
Definition: ndtxt.hxx:858
std::size_t m_nAuthor
Definition: redline.hxx:94
std::vector< SwExtraRedline * > m_aExtraRedlines
Definition: docary.hxx:284
typedef void(CALLTYPE *GetFuncDataPtr)(sal_uInt16 &nNo