LibreOffice Module sw (master)  1
untblk.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 
22 #include <fmtanchr.hxx>
23 #include <frmfmt.hxx>
24 #include <doc.hxx>
26 #include <IShellCursorSupplier.hxx>
27 #include <docary.hxx>
28 #include <swundo.hxx>
29 #include <pam.hxx>
30 #include <mvsave.hxx>
31 #include <ndtxt.hxx>
32 #include <UndoCore.hxx>
33 #include <rolbck.hxx>
34 #include <redline.hxx>
35 #include <frameformats.hxx>
36 
37 namespace sw {
38 
39 std::unique_ptr<std::vector<SwFrameFormat*>>
40 GetFlysAnchoredAt(SwDoc & rDoc, sal_uLong const nSttNode)
41 {
42  std::unique_ptr<std::vector<SwFrameFormat*>> pFrameFormats;
43  const size_t nArrLen = rDoc.GetSpzFrameFormats()->size();
44  for (size_t n = 0; n < nArrLen; ++n)
45  {
46  SwFrameFormat *const pFormat = (*rDoc.GetSpzFrameFormats())[n];
47  SwFormatAnchor const*const pAnchor = &pFormat->GetAnchor();
48  SwPosition const*const pAPos = pAnchor->GetContentAnchor();
49  if (pAPos
50  && nSttNode == pAPos->nNode.GetIndex()
51  && ((pAnchor->GetAnchorId() == RndStdIds::FLY_AT_PARA)
52  || (pAnchor->GetAnchorId() == RndStdIds::FLY_AT_CHAR)))
53  {
54  if (!pFrameFormats)
55  pFrameFormats.reset( new std::vector<SwFrameFormat*> );
56  pFrameFormats->push_back( pFormat );
57  }
58  }
59  return pFrameFormats;
60 }
61 
62 } // namespace sw
63 
64 //note: parameter is SwPam just so we can init SwUndRng, the End is ignored!
66  : SwUndo( nUndoId, rPam.GetDoc() )
67  , SwUndRng( rPam )
68  , m_pTextFormatColl(nullptr)
69  , m_pLastNodeColl(nullptr)
70  , m_nDeleteTextNodes(1)
71  , m_nNodeDiff(0)
72  , m_nSetPos(0)
73 {
74  m_pHistory.reset( new SwHistory );
75  SwDoc* pDoc = rPam.GetDoc();
76 
77  SwTextNode* pTextNd = rPam.GetPoint()->nNode.GetNode().GetTextNode();
78  if( pTextNd )
79  {
80  m_pTextFormatColl = pTextNd->GetTextColl();
82  m_pHistory->CopyAttr( pTextNd->GetpSwpHints(), m_nSttNode,
83  0, pTextNd->GetText().getLength(), false );
84  if( pTextNd->HasSwAttrSet() )
85  m_pHistory->CopyFormatAttr( *pTextNd->GetpSwAttrSet(), m_nSttNode );
86 
87  // We may have some flys anchored to paragraph where we inserting.
88  // These flys will be saved in pFrameFormats array (only flys which exist BEFORE insertion!)
89  // Then in SwUndoInserts::SetInsertRange the flys saved in pFrameFormats will NOT create Undos.
90  // m_FlyUndos will only be filled with newly inserted flys.
92  }
93  // consider Redline
95  {
96  m_pRedlineData.reset( new SwRedlineData( RedlineType::Insert, pDoc->getIDocumentRedlineAccess().GetRedlineAuthor() ) );
98  }
99 }
100 
101 // This method does two things:
102 // 1. Adjusts SwUndoRng members, required for Undo.
103 // Members are:
104 // SwUndoRng::nSttNode - all nodes starting from this node will be deleted during Undo (in SwUndoInserts::UndoImpl)
105 // SwUndoRng::nSttContent - corresponding content index in SwUndoRng::nSttNode
106 // SwUndoRng::nEndNode - end node for deletion
107 // SwUndoRng::nEndContent - end content index
108 // All these members are filled in during construction of SwUndoInserts instance, and can be adjusted using this method
109 //
110 // 2. Fills in m_FlyUndos array with flys anchored ONLY to first and last paragraphs (first == rPam.Start(), last == rPam.End())
111 // Flys, anchored to any paragraph, but not first and last, are handled by DelContentIndex (see SwUndoInserts::UndoImpl) and are not stored in m_FlyUndos.
112 
113 void SwUndoInserts::SetInsertRange( const SwPaM& rPam, bool bScanFlys,
114  int const nDeleteTextNodes)
115 {
116  const SwPosition* pTmpPos = rPam.End();
117  m_nEndNode = pTmpPos->nNode.GetIndex();
118  m_nEndContent = pTmpPos->nContent.GetIndex();
119  if( rPam.HasMark() )
120  {
121  if( pTmpPos == rPam.GetPoint() )
122  pTmpPos = rPam.GetMark();
123  else
124  pTmpPos = rPam.GetPoint();
125 
126  m_nSttNode = pTmpPos->nNode.GetIndex();
127  m_nSttContent = pTmpPos->nContent.GetIndex();
128 
129  if (m_nDeleteTextNodes == 0) // if a table selection is added...
130  {
131  ++m_nSttNode; // ... then the CopyPam is not fully correct
132  }
133  m_nDeleteTextNodes = nDeleteTextNodes;
134  }
135 
136  // Fill m_FlyUndos with flys anchored to first and last paragraphs
137 
138  if( !bScanFlys)
139  return;
140 
141  // than collect all new Flys
142  SwDoc* pDoc = rPam.GetDoc();
143  const size_t nArrLen = pDoc->GetSpzFrameFormats()->size();
144  for( size_t n = 0; n < nArrLen; ++n )
145  {
146  SwFrameFormat* pFormat = (*pDoc->GetSpzFrameFormats())[n];
147  SwFormatAnchor const*const pAnchor = &pFormat->GetAnchor();
149  {
150  std::vector<SwFrameFormat*>::iterator it;
151  if( !m_pFrameFormats ||
152  m_pFrameFormats->end() == ( it = std::find( m_pFrameFormats->begin(), m_pFrameFormats->end(), pFormat ) ) )
153  {
154  std::shared_ptr<SwUndoInsLayFormat> const pFlyUndo =
155  std::make_shared<SwUndoInsLayFormat>(pFormat, 0, 0);
156  m_FlyUndos.push_back(pFlyUndo);
157  }
158  else
159  m_pFrameFormats->erase( it );
160  }
161  }
162  m_pFrameFormats.reset();
163 }
164 
174  sal_uLong const nStartNode, sal_uLong const nEndNode)
175 {
176  assert(nStartNode <= nEndNode);
177 
178  // check all at-char flys at the start/end nodes:
179  // ExcludeFlyAtStartEnd will exclude them!
180  SwPosition const*const pAnchorPos = rAnchor.GetContentAnchor();
181  return pAnchorPos != nullptr
182  && ( rAnchor.GetAnchorId() == RndStdIds::FLY_AT_PARA
183  || rAnchor.GetAnchorId() == RndStdIds::FLY_AT_CHAR)
184  && ( nStartNode == pAnchorPos->nNode.GetIndex()
185  || nEndNode == pAnchorPos->nNode.GetIndex());
186 }
187 
189 {
190  xmlTextWriterStartElement(pWriter, BAD_CAST("SwUndoInserts"));
191  xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("ptr"), "%p", this);
192  xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("symbol"), "%s",
193  BAD_CAST(typeid(*this).name()));
194 
195  SwUndo::dumpAsXml(pWriter);
197 
198  if (m_pFrameFormats)
199  {
200  xmlTextWriterStartElement(pWriter, BAD_CAST("m_pFrameFormats"));
201  for (const auto& pFormat : *m_pFrameFormats)
202  {
203  pFormat->dumpAsXml(pWriter);
204  }
205  xmlTextWriterEndElement(pWriter);
206  }
207 
208  if (!m_FlyUndos.empty())
209  {
210  xmlTextWriterStartElement(pWriter, BAD_CAST("m_FlyUndos"));
211  for (const auto& pFly : m_FlyUndos)
212  {
213  pFly->dumpAsXml(pWriter);
214  }
215  xmlTextWriterEndElement(pWriter);
216  }
217 
218  xmlTextWriterEndElement(pWriter);
219 }
220 
222 {
223  if (m_pUndoNodeIndex) // delete also the section from UndoNodes array
224  {
225  // Insert saves content in IconSection
226  SwNodes& rUNds = m_pUndoNodeIndex->GetNodes();
227  rUNds.Delete(*m_pUndoNodeIndex,
228  rUNds.GetEndOfExtras().GetIndex() - m_pUndoNodeIndex->GetIndex());
229  m_pUndoNodeIndex.reset();
230  }
231  m_pFrameFormats.reset();
232  m_pRedlineData.reset();
233 }
234 
235 // Undo Insert operation
236 // It's important to note that Undo stores absolute node indexes. I.e. if during insertion, you insert nodes 31 to 33,
237 // during Undo nodes with indices from 31 to 33 will be deleted. Undo doesn't check that nodes 31 to 33 are the same nodes which were inserted.
238 // It just deletes them.
239 // This may seem as bad programming practice, but Undo actions are strongly ordered. If you change your document in some way, a new Undo action is added.
240 // During Undo most recent actions will be executed first. So during execution of particular Undo action indices will be correct.
241 // But storing absolute indices leads to crashes if some action in Undo fails to roll back some modifications.
242 
243 // Has following main steps:
244 // 1. m_FlyUndos removes flys anchored to first and last paragraph in Undo range.
245 // This array may be empty.
246 // 2. DelContentIndex to delete footnotes, flys, bookmarks (see comment for this function)
247 // Deleted flys are stored in pHistory array.
248 // First and last paragraphs flys are not deleted by DelContentIndex!
249 // For flys anchored to last paragraph, DelContentIndex re-anchors them to
250 // the last paragraph that will remain after Undo.
251 // 3. MoveToUndoNds moves nodes to Undo nodes array and removes them from document.
252 // 4. Lastly (starting from if(pTextNode)), text from last paragraph is joined to last remaining paragraph and FormatColl for last paragraph is restored.
253 // Format coll for last paragraph is removed during execution of UndoImpl
254 
256 {
257  SwDoc& rDoc = rContext.GetDoc();
258  SwPaM& rPam = AddUndoRedoPaM(rContext);
259 
260  m_nNodeDiff = 0;
261 
263  rDoc.getIDocumentRedlineAccess().DeleteRedline(rPam, true, RedlineType::Any);
264 
265  // if Point and Mark are different text nodes so a JoinNext has to be done
266  bool bJoinNext = m_nSttNode != m_nEndNode &&
267  rPam.GetMark()->nNode.GetNode().GetTextNode() &&
268  rPam.GetPoint()->nNode.GetNode().GetTextNode();
269 
270  // Is there any content? (loading from template does not have content)
272  {
273  if( m_nSttNode != m_nEndNode )
274  {
275  SwTextNode* pTextNd = rDoc.GetNodes()[ m_nEndNode ]->GetTextNode();
276  if (pTextNd && pTextNd->GetText().getLength() == m_nEndContent)
277  m_pLastNodeColl = pTextNd->GetTextColl();
278  }
279 
280  // tdf#128739 correct cursors but do not delete bookmarks yet
281  ::PaMCorrAbs(rPam, *rPam.End());
282 
283  SetPaM(rPam);
284  }
285 
286  // ... for consistency with the Insert File code in shellio.cxx, which
287  // creates separate SwUndoInsLayFormat for mysterious reasons, do this
288  // *before* anything else:
289  // after SetPaM but before MoveToUndoNds and DelContentIndex.
290  // note: there isn't an order dep wrt. initial Copy action because Undo
291  // overwrites the indexes but there is wrt. Redo because that uses the
292  // indexes
293  if (!m_FlyUndos.empty())
294  {
295  sal_uLong nTmp = rPam.GetPoint()->nNode.GetIndex();
296  for (size_t n = m_FlyUndos.size(); 0 < n; --n)
297  {
298  m_FlyUndos[ n-1 ]->UndoImpl(rContext);
299  }
300  m_nNodeDiff += nTmp - rPam.GetPoint()->nNode.GetIndex();
301  }
302 
304  {
305  // are there Footnotes or ContentFlyFrames in text?
306  m_nSetPos = m_pHistory->Count();
307  sal_uLong nTmp = rPam.GetMark()->nNode.GetIndex();
308  DelContentIndex(*rPam.GetMark(), *rPam.GetPoint(),
310  m_nNodeDiff += nTmp - rPam.GetMark()->nNode.GetIndex();
311  if( *rPam.GetPoint() != *rPam.GetMark() )
312  {
313  m_pUndoNodeIndex.reset(
314  new SwNodeIndex(rDoc.GetNodes().GetEndOfContent()));
315  MoveToUndoNds(rPam, m_pUndoNodeIndex.get());
316 
317  if (m_nDeleteTextNodes == 0)
318  {
320  }
321  }
322  }
323 
324  SwNodeIndex& rIdx = rPam.GetPoint()->nNode;
325  SwTextNode* pTextNode = rIdx.GetNode().GetTextNode();
326  if( !pTextNode )
327  return;
328 
329  if( !m_pTextFormatColl ) // if 0 than it's no TextNode -> delete
330  {
331  SwNodeIndex aDelIdx( rIdx );
333  for (int i = 0; i < m_nDeleteTextNodes; ++i)
334  {
335  rPam.Move(fnMoveForward, GoInNode);
336  }
337  rPam.DeleteMark();
338 
339  for (int i = 0; i < m_nDeleteTextNodes; ++i)
340  {
341  RemoveIdxRel(aDelIdx.GetIndex() + i, *rPam.GetPoint());
342  }
343 
344  rDoc.GetNodes().Delete( aDelIdx, m_nDeleteTextNodes );
345  }
346  else
347  {
348  if( bJoinNext && pTextNode->CanJoinNext())
349  {
350  {
351  RemoveIdxRel( rIdx.GetIndex()+1, SwPosition( rIdx,
352  SwIndex( pTextNode, pTextNode->GetText().getLength() )));
353  }
354  pTextNode->JoinNext();
355  }
356  // reset all text attributes in the paragraph!
357  pTextNode->RstTextAttr( SwIndex(pTextNode, 0), pTextNode->Len(), 0, nullptr, true );
358 
359  pTextNode->ResetAllAttr();
360 
362  m_pTextFormatColl = static_cast<SwTextFormatColl*>(pTextNode->ChgFormatColl( m_pTextFormatColl )) ;
363 
364  m_pHistory->SetTmpEnd( m_nSetPos );
365  m_pHistory->TmpRollback(&rDoc, 0, false);
366  }
367 }
368 
369 // See SwUndoInserts::UndoImpl comments
370 // All actions here should be done in reverse order to what is done in SwUndoInserts::UndoImpl!
371 
373 {
374  // position cursor onto REDO section
375  SwPaM& rPam(rContext.GetCursorSupplier().CreateNewShellCursor());
376  SwDoc* pDoc = rPam.GetDoc();
377  rPam.DeleteMark();
378  rPam.GetPoint()->nNode = m_nSttNode - m_nNodeDiff;
379  SwContentNode* pCNd = rPam.GetContentNode();
380  rPam.GetPoint()->nContent.Assign( pCNd, m_nSttContent );
381 
382  SwTextFormatColl* pSavTextFormatColl = m_pTextFormatColl;
383  if( m_pTextFormatColl && pCNd && pCNd->IsTextNode() )
384  pSavTextFormatColl = static_cast<SwTextNode*>(pCNd)->GetTextColl();
385 
386  m_pHistory->SetTmpEnd( m_nSetPos );
387 
388  // retrieve start position for rollback
390  {
391  auto const pFlysAtInsPos(sw::GetFlysAnchoredAt(*pDoc,
392  rPam.GetPoint()->nNode.GetIndex()));
393 
394  const bool bMvBkwrd = MovePtBackward(rPam);
395 
396  // re-insert content again (first detach m_pUndoNodeIndex!)
397  sal_uLong const nMvNd = m_pUndoNodeIndex->GetIndex();
398  m_pUndoNodeIndex.reset();
399  MoveFromUndoNds(*pDoc, nMvNd, *rPam.GetMark());
400  if (m_nDeleteTextNodes != 0)
401  {
402  MovePtForward(rPam, bMvBkwrd);
403  }
404  rPam.Exchange();
405 
406  // at-char anchors post SplitNode are on index 0 of 2nd node and will
407  // remain there - move them back to the start (end would also work?)
408  if (pFlysAtInsPos)
409  {
410  for (SwFrameFormat * pFly : *pFlysAtInsPos)
411  {
412  SwFormatAnchor const*const pAnchor = &pFly->GetAnchor();
413  if (pAnchor->GetAnchorId() == RndStdIds::FLY_AT_CHAR)
414  {
415  SwFormatAnchor anchor(*pAnchor);
416  anchor.SetAnchor( rPam.GetMark() );
417  pFly->SetFormatAttr(anchor);
418  }
419  }
420  }
421  }
422 
423  if (pDoc->GetTextFormatColls()->IsAlive(m_pTextFormatColl))
424  {
425  SwTextNode* pTextNd = rPam.GetMark()->nNode.GetNode().GetTextNode();
426  if( pTextNd )
427  pTextNd->ChgFormatColl( m_pTextFormatColl );
428  }
429  m_pTextFormatColl = pSavTextFormatColl;
430 
431  if (m_pLastNodeColl && pDoc->GetTextFormatColls()->IsAlive(m_pLastNodeColl)
432  && rPam.GetPoint()->nNode != rPam.GetMark()->nNode)
433  {
434  SwTextNode* pTextNd = rPam.GetPoint()->nNode.GetNode().GetTextNode();
435  if( pTextNd )
436  pTextNd->ChgFormatColl( m_pLastNodeColl );
437  }
438 
439  // tdf#108124 the SwHistoryChangeFlyAnchor/SwHistoryFlyCnt must run before
440  // m_FlyUndos as they were created by DelContentIndex()
441  m_pHistory->Rollback( pDoc, m_nSetPos );
442 
443  // tdf#108124 (10/25/2017)
444  // During UNDO we call SwUndoInsLayFormat::UndoImpl in reverse order,
445  // firstly for m_FlyUndos[ m_FlyUndos.size()-1 ], etc.
446  // As absolute node index of fly stored in SwUndoFlyBase::nNdPgPos we
447  // should recover from Undo in direct order (last should be recovered first)
448  // During REDO we should recover Flys (Images) in direct order,
449  // firstly m_FlyUndos[0], then with m_FlyUndos[1] index, etc.
450 
451  for (size_t n = 0; m_FlyUndos.size() > n; ++n)
452  {
453  m_FlyUndos[n]->RedoImpl(rContext);
454  }
455 
457  {
458  RedlineFlags eOld = pDoc->getIDocumentRedlineAccess().GetRedlineFlags();
459  pDoc->getIDocumentRedlineAccess().SetRedlineFlags_intern( eOld & ~RedlineFlags::Ignore );
460  pDoc->getIDocumentRedlineAccess().AppendRedline( new SwRangeRedline( *m_pRedlineData, rPam ), true);
461  pDoc->getIDocumentRedlineAccess().SetRedlineFlags_intern( eOld );
462  }
463  else if( !( RedlineFlags::Ignore & GetRedlineFlags() ) &&
464  !pDoc->getIDocumentRedlineAccess().GetRedlineTable().empty() )
465  pDoc->getIDocumentRedlineAccess().SplitRedline(rPam);
466 }
467 
469 {
470  SwPaM aPam( rContext.GetDoc().GetNodes().GetEndOfContent() );
471  SetPaM( aPam );
472  SwPaM & rRepeatPaM( rContext.GetRepeatPaM() );
473  aPam.GetDoc()->getIDocumentContentOperations().CopyRange( aPam, *rRepeatPaM.GetPoint(), SwCopyFlags::CheckPosInFly);
474 }
475 
478 {
479 }
480 
482  : SwUndoInserts( SwUndoId::COPY, rPam )
483 {
484 }
485 
486 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::vector< std::shared_ptr< SwUndoInsLayFormat > > m_FlyUndos
Definition: undobj.hxx:255
SwPaM & AddUndoRedoPaM(::sw::UndoRedoContext &, bool const bCorrToContent=false) const
Definition: undobj.cxx:108
void DeleteMark()
Definition: pam.hxx:177
sal_uLong GetIndex() const
Definition: node.hxx:282
anchor
bool GoInContent(SwPaM &rPam, SwMoveFnCollection const &fnMove)
Definition: pam.cxx:963
Represents the style of a paragraph.
Definition: fmtcol.hxx:55
Marks a position in the document model.
Definition: pam.hxx:35
std::unique_ptr< SwHistory > m_pHistory
Definition: undobj.hxx:166
std::unique_ptr< SwRedlineData > m_pRedlineData
Definition: undobj.hxx:256
virtual ~SwUndoInserts() override
Definition: untblk.cxx:221
const OUString & GetText() const
Definition: ndtxt.hxx:211
SwUndoId
Definition: swundo.hxx:29
virtual sal_uInt16 ResetAllAttr() override
Definition: ndtxt.cxx:5164
SwpHints * GetpSwpHints()
Definition: ndtxt.hxx:219
virtual SwPaM & CreateNewShellCursor()=0
SwNodeIndex nNode
Definition: pam.hxx:37
virtual sal_Int32 Len() const override
Definition: ndtxt.cxx:275
sal_uIntPtr sal_uLong
SwPaM & GetRepeatPaM()
Definition: UndoCore.hxx:128
const SwPosition * GetMark() const
Definition: pam.hxx:209
sal_uLong m_nEndNode
Definition: undobj.hxx:229
sal_Int64 n
Definition: doc.hxx:184
void SetRedlineFlags(RedlineFlags eMode)
Definition: undobj.hxx:120
SwNode & GetNode() const
Definition: ndindex.hxx:119
Dialog to specify the properties of date form field.
std::unique_ptr< std::vector< SwFrameFormat * > > m_pFrameFormats
Definition: undobj.hxx:254
IDocumentContentOperations const & getIDocumentContentOperations() const
Definition: doc.cxx:315
bool CanJoinNext(SwNodeIndex *pIdx=nullptr) const
Is it possible to join two nodes? In pIdx the second position can be returned.
Definition: node.cxx:1844
virtual SwContentNode * JoinNext() override
Definition: ndtxt.cxx:943
const SwFrameFormats * GetSpzFrameFormats() const
Definition: doc.hxx:739
IShellCursorSupplier & GetCursorSupplier()
Definition: UndoCore.hxx:96
SwUndoInserts(SwUndoId nUndoId, const SwPaM &)
Definition: untblk.cxx:65
virtual void dumpAsXml(xmlTextWriterPtr pWriter) const
Definition: undobj.cxx:707
void Delete(const SwNodeIndex &rPos, sal_uLong nNodes=1)
delete nodes
Definition: nodes.cxx:1076
SwIndex nContent
Definition: pam.hxx:38
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
check if target position is in fly anchored at source range
static bool IsRedlineOn(const RedlineFlags eM)
SwDoc & GetDoc() const
Definition: UndoCore.hxx:126
sal_uLong GetIndex() const
Definition: ndindex.hxx:152
static void MoveToUndoNds(SwPaM &rPam, SwNodeIndex *pNodeIdx, sal_uLong *pEndNdIdx=nullptr)
Definition: undobj.cxx:728
SwDoc & GetDoc() const
Definition: UndoCore.hxx:94
void dumpAsXml(xmlTextWriterPtr pWriter) const override
Definition: untblk.cxx:188
virtual void UndoImpl(::sw::UndoRedoContext &) override
Definition: untblk.cxx:255
RedlineFlags GetRedlineFlags() const
Definition: undobj.hxx:119
SwUndoCpyDoc(const SwPaM &)
Definition: untblk.cxx:481
bool IsAlive(typename std::remove_pointer< Value >::type const *const p) const
check that given format is still alive (i.e. contained here)
Definition: docary.hxx:137
SwNode & GetEndOfContent() const
Regular ContentSection (i.e. the BodyText).
Definition: ndarr.hxx:163
virtual std::size_t GetRedlineAuthor()=0
SwUndoInsDoc(const SwPaM &)
Definition: untblk.cxx:476
static void MovePtForward(SwPaM &rPam, bool bMvBkwrd)
Definition: undobj.cxx:837
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:136
struct _xmlTextWriter * xmlTextWriterPtr
const SwAttrSet * GetpSwAttrSet() const
Definition: node.hxx:443
bool Move(SwMoveFnCollection const &fnMove=fnMoveForward, SwGoInDoc fnGo=GoInContent)
Movement of cursor.
Definition: pam.cxx:501
void RstTextAttr(const SwIndex &rIdx, const sal_Int32 nLen, const sal_uInt16 nWhich=0, const SfxItemSet *pSet=nullptr, const bool bInclRefToxMark=false, const bool bExactRange=false)
delete all attributes.
Definition: txtedt.cxx:357
Style of a layout element.
Definition: frmfmt.hxx:57
const SwFormatAnchor & GetAnchor(bool=true) const
Definition: fmtanchr.hxx:81
int i
bool GoInNode(SwPaM &rPam, SwMoveFnCollection const &fnMove)
Definition: pam.cxx:954
const SwPosition * GetPoint() const
Definition: pam.hxx:207
virtual bool CopyRange(SwPaM &rPam, SwPosition &rPos, SwCopyFlags flags) const =0
Copy a selected content range to a position.
void DelContentIndex(const SwPosition &pMark, const SwPosition &pPoint, DelContentType nDelContentType=DelContentType::AllMask)
Definition: undobj.cxx:862
RndStdIds GetAnchorId() const
Definition: fmtanchr.hxx:65
const SwPosition * GetContentAnchor() const
Definition: fmtanchr.hxx:67
virtual bool DeleteRedline(const SwPaM &rPam, bool bSaveInUndo, RedlineType nDelType)=0
SwContentNode * GetContentNode()
Definition: node.hxx:615
FlyAnchors.
Definition: fmtanchr.hxx:34
bool HasMark() const
A PaM marks a selection if Point and Mark are distinct positions.
Definition: pam.hxx:205
sal_Int32 m_nEndContent
Definition: undobj.hxx:230
SwDoc * GetDoc() const
Definition: pam.hxx:243
Marks a character position inside a document model node.
Definition: index.hxx:33
virtual SwFormatColl * ChgFormatColl(SwFormatColl *) override
Definition: ndtxt.cxx:3924
Marks a node in the document model.
Definition: ndindex.hxx:31
static bool MovePtBackward(SwPaM &rPam)
Definition: undobj.cxx:824
bool HasSwAttrSet() const
Definition: node.hxx:444
sal_uLong m_nNodeDiff
Definition: undobj.hxx:260
virtual void dumpAsXml(xmlTextWriterPtr pWriter) const
sal_uLong m_nSttNode
Definition: undobj.hxx:229
SwTextFormatColl * m_pLastNodeColl
Definition: undobj.hxx:253
ignore Redlines
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:80
virtual void RedoImpl(::sw::UndoRedoContext &) override
Definition: untblk.cxx:372
IDocumentRedlineAccess const & getIDocumentRedlineAccess() const
Definition: doc.cxx:335
void SetPaM(SwPaM &, bool bCorrToContent=false) const
Definition: undobj.cxx:80
static void MoveFromUndoNds(SwDoc &rDoc, sal_uLong nNodeIdx, SwPosition &rInsPos, const sal_uLong *pEndNdIdx=nullptr, bool bForceCreateFrames=false)
Definition: undobj.cxx:765
int m_nDeleteTextNodes
Definition: undobj.hxx:257
const SwTextFormatColls * GetTextFormatColls() const
Definition: doc.hxx:775
SwMoveFnCollection const & fnMoveForward
SwPam::Move()/Find() default argument.
Definition: paminit.cxx:59
sal_Int32 GetIndex() const
Definition: index.hxx:91
SwTextFormatColl * m_pTextFormatColl
Definition: undobj.hxx:253
virtual bool IsRedlineOn() const =0
Query if redlining is on.
SwNodes & GetNodes()
Definition: doc.hxx:403
const SwPosition * End() const
Definition: pam.hxx:217
void PaMCorrAbs(const SwPaM &rRange, const SwPosition &rNewPos)
Function declarations so that everything below the CursorShell can move the Cursor once in a while...
Definition: doccorr.cxx:85
static void RemoveIdxRel(sal_uLong, const SwPosition &)
Definition: undobj.cxx:153
SwMoveFnCollection const & fnMoveBackward
Definition: paminit.cxx:58
std::unique_ptr< std::vector< SwFrameFormat * > > GetFlysAnchoredAt(SwDoc &rDoc, sal_uLong const nSttNode)
Definition: untblk.cxx:40
const short COPY
virtual RedlineFlags GetRedlineFlags() const =0
Query the currently set redline mode.
size_t size() const
static bool IsCreateUndoForNewFly(SwFormatAnchor const &rAnchor, sal_uLong const nStartNode, sal_uLong const nEndNode)
This is not the same as IsDestroyFrameAnchoredAtChar() and intentionally so: because the SwUndoInsert...
Definition: untblk.cxx:173
SwNode & GetEndOfExtras() const
This is the last EndNode of a special section.
Definition: ndarr.hxx:161
void SetInsertRange(const SwPaM &, bool bScanFlys=true, int nDeleteTextNodes=1)
Definition: untblk.cxx:113
bool IsTextNode() const
Definition: node.hxx:636
sal_uInt16 m_nSetPos
Definition: undobj.hxx:263
virtual void RepeatImpl(::sw::RepeatContext &) override
Definition: untblk.cxx:468
sal_Int32 m_nSttContent
Definition: undobj.hxx:230
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
Definition: ndtxt.hxx:844
void SetAnchor(const SwPosition *pPos)
Definition: atrfrm.cxx:1516
std::unique_ptr< SwNodeIndex > m_pUndoNodeIndex
start of Content in UndoNodes for Redo
Definition: undobj.hxx:262
SwTextFormatColl * GetTextColl() const
Definition: ndtxt.hxx:838