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 <hintids.hxx>
21 #include <fmtanchr.hxx>
22 #include <frmfmt.hxx>
23 #include <doc.hxx>
24 #include <IDocumentUndoRedo.hxx>
26 #include <IShellCursorSupplier.hxx>
27 #include <docary.hxx>
28 #include <swundo.hxx>
29 #include <pam.hxx>
30 #include <ndtxt.hxx>
31 #include <UndoCore.hxx>
32 #include <rolbck.hxx>
33 #include <redline.hxx>
34 
35 namespace sw {
36 
37 std::unique_ptr<std::vector<SwFrameFormat*>>
38 GetFlysAnchoredAt(SwDoc & rDoc, sal_uLong const nSttNode)
39 {
40  std::unique_ptr<std::vector<SwFrameFormat*>> pFrameFormats;
41  const size_t nArrLen = rDoc.GetSpzFrameFormats()->size();
42  for (size_t n = 0; n < nArrLen; ++n)
43  {
44  SwFrameFormat *const pFormat = (*rDoc.GetSpzFrameFormats())[n];
45  SwFormatAnchor const*const pAnchor = &pFormat->GetAnchor();
46  SwPosition const*const pAPos = pAnchor->GetContentAnchor();
47  if (pAPos
48  && nSttNode == pAPos->nNode.GetIndex()
49  && ((pAnchor->GetAnchorId() == RndStdIds::FLY_AT_PARA)
50  || (pAnchor->GetAnchorId() == RndStdIds::FLY_AT_CHAR)))
51  {
52  if (!pFrameFormats)
53  pFrameFormats.reset( new std::vector<SwFrameFormat*> );
54  pFrameFormats->push_back( pFormat );
55  }
56  }
57  return pFrameFormats;
58 }
59 
60 } // namespace sw
61 
62 //note: parameter is SwPam just so we can init SwUndRng, the End is ignored!
64  : SwUndo( nUndoId, rPam.GetDoc() ), SwUndRng( rPam ),
65  m_pTextFormatColl( nullptr ), m_pLastNodeColl(nullptr),
66  m_bStartWasTextNode( true ), m_nNodeDiff( 0 ), m_nSetPos( 0 )
67 {
68  pHistory.reset( new SwHistory );
69  SwDoc* pDoc = rPam.GetDoc();
70 
71  SwTextNode* pTextNd = rPam.GetPoint()->nNode.GetNode().GetTextNode();
72  if( pTextNd )
73  {
74  m_pTextFormatColl = pTextNd->GetTextColl();
75  pHistory->CopyAttr( pTextNd->GetpSwpHints(), m_nSttNode,
76  0, pTextNd->GetText().getLength(), false );
77  if( pTextNd->HasSwAttrSet() )
78  pHistory->CopyFormatAttr( *pTextNd->GetpSwAttrSet(), m_nSttNode );
79 
80  // We may have some flys anchored to paragraph where we inserting.
81  // These flys will be saved in pFrameFormats array (only flys which exist BEFORE insertion!)
82  // Then in SwUndoInserts::SetInsertRange the flys saved in pFrameFormats will NOT create Undos.
83  // m_FlyUndos will only be filled with newly inserted flys.
85  }
86  // consider Redline
88  {
91  }
92 }
93 
94 // This method does two things:
95 // 1. Adjusts SwUndoRng members, required for Undo.
96 // Members are:
97 // SwUndoRng::nSttNode - all nodes starting from this node will be deleted during Undo (in SwUndoInserts::UndoImpl)
98 // SwUndoRng::nSttContent - corresponding content index in SwUndoRng::nSttNode
99 // SwUndoRng::nEndNode - end node for deletion
100 // SwUndoRng::nEndContent - end content index
101 // All these members are filled in during construction of SwUndoInserts instance, and can be adjusted using this method
102 //
103 // 2. Fills in m_FlyUndos array with flys anchored ONLY to first and last paragraphs (first == rPam.Start(), last == rPam.End())
104 // Flys, anchored to any paragraph, but not first and last, are handled by DelContentIndex (see SwUndoInserts::UndoImpl) and are not stored in m_FlyUndos.
105 
106 void SwUndoInserts::SetInsertRange( const SwPaM& rPam, bool bScanFlys,
107  bool bSttIsTextNd )
108 {
109  const SwPosition* pTmpPos = rPam.End();
110  m_nEndNode = pTmpPos->nNode.GetIndex();
111  m_nEndContent = pTmpPos->nContent.GetIndex();
112  if( rPam.HasMark() )
113  {
114  if( pTmpPos == rPam.GetPoint() )
115  pTmpPos = rPam.GetMark();
116  else
117  pTmpPos = rPam.GetPoint();
118 
119  m_nSttNode = pTmpPos->nNode.GetIndex();
120  m_nSttContent = pTmpPos->nContent.GetIndex();
121 
122  if( !bSttIsTextNd ) // if a table selection is added...
123  {
124  ++m_nSttNode; // ... then the CopyPam is not fully correct
125  m_bStartWasTextNode = false;
126  }
127  }
128 
129  // Fill m_FlyUndos with flys anchored to first and last paragraphs
130 
131  if( bScanFlys)
132  {
133  // than collect all new Flys
134  SwDoc* pDoc = rPam.GetDoc();
135  const size_t nArrLen = pDoc->GetSpzFrameFormats()->size();
136  for( size_t n = 0; n < nArrLen; ++n )
137  {
138  SwFrameFormat* pFormat = (*pDoc->GetSpzFrameFormats())[n];
139  SwFormatAnchor const*const pAnchor = &pFormat->GetAnchor();
141  {
142  std::vector<SwFrameFormat*>::iterator it;
143  if( !m_pFrameFormats ||
144  m_pFrameFormats->end() == ( it = std::find( m_pFrameFormats->begin(), m_pFrameFormats->end(), pFormat ) ) )
145  {
146  std::shared_ptr<SwUndoInsLayFormat> const pFlyUndo(
147  new SwUndoInsLayFormat(pFormat, 0, 0));
148  m_FlyUndos.push_back(pFlyUndo);
149  }
150  else
151  m_pFrameFormats->erase( it );
152  }
153  }
154  m_pFrameFormats.reset();
155  }
156 }
157 
167  sal_uLong const nStartNode, sal_uLong const nEndNode)
168 {
169  assert(nStartNode <= nEndNode);
170 
171  // check all at-char flys at the start/end nodes:
172  // ExcludeAtCharFlyAtStartEnd will exclude them!
173  SwPosition const*const pAnchorPos = rAnchor.GetContentAnchor();
174  return pAnchorPos != nullptr
175  && ( rAnchor.GetAnchorId() == RndStdIds::FLY_AT_PARA
176  || rAnchor.GetAnchorId() == RndStdIds::FLY_AT_CHAR)
177  && ( nStartNode == pAnchorPos->nNode.GetIndex()
178  || nEndNode == pAnchorPos->nNode.GetIndex());
179 }
180 
182 {
183  if (m_pUndoNodeIndex) // delete also the section from UndoNodes array
184  {
185  // Insert saves content in IconSection
186  SwNodes& rUNds = m_pUndoNodeIndex->GetNodes();
187  rUNds.Delete(*m_pUndoNodeIndex,
188  rUNds.GetEndOfExtras().GetIndex() - m_pUndoNodeIndex->GetIndex());
189  m_pUndoNodeIndex.reset();
190  }
191  m_pFrameFormats.reset();
192  m_pRedlineData.reset();
193 }
194 
195 // Undo Insert operation
196 // It's important to note that Undo stores absolute node indexes. I.e. if during insertion, you insert nodes 31 to 33,
197 // 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.
198 // It just deletes them.
199 // 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.
200 // During Undo most recent actions will be executed first. So during execution of particular Undo action indices will be correct.
201 // But storing absolute indices leads to crashes if some action in Undo fails to roll back some modifications.
202 
203 // Has following main steps:
204 // 1. DelContentIndex to delete footnotes, flys, bookmarks (see comment for this function)
205 // Deleted flys are stored in pHistory array.
206 // First and last paragraphs flys are handled later in this function! They are not deleted by DelContentIndex!
207 // For flys anchored to last paragraph, DelContentIndex re-anchors them to the last paragraph that will remain after Undo.
208 // This is not fully correct, as everything between nSttNode and nEndNode should be deleted (these nodes marks range of inserted nodes).
209 // But due to bug in paste (probably there), during paste all flys are anchored to last paragraph (see https://bugs.documentfoundation.org/show_bug.cgi?id=94225#c38).
210 // So they should be re-anchored.
211 // 2. MoveToUndoNds moves nodes to Undo nodes array and removes them from document.
212 // 3. m_FlyUndos removes flys anchored to first and last paragraph in Undo range. This array may be empty.
213 // 4. Lastly (starting from if(pTextNode)), text from last paragraph is joined to last remaining paragraph and FormatColl for last paragraph is restored.
214 // Format coll for last paragraph is removed during execution of UndoImpl
215 
217 {
218  SwDoc& rDoc = rContext.GetDoc();
219  SwPaM& rPam = AddUndoRedoPaM(rContext);
220 
221  m_nNodeDiff = 0;
222 
225 
226  // if Point and Mark are different text nodes so a JoinNext has to be done
227  bool bJoinNext = m_nSttNode != m_nEndNode &&
228  rPam.GetMark()->nNode.GetNode().GetTextNode() &&
229  rPam.GetPoint()->nNode.GetNode().GetTextNode();
230 
231  // Is there any content? (loading from template does not have content)
233  {
234  if( m_nSttNode != m_nEndNode )
235  {
236  SwTextNode* pTextNd = rDoc.GetNodes()[ m_nEndNode ]->GetTextNode();
237  if (pTextNd && pTextNd->GetText().getLength() == m_nEndContent)
238  m_pLastNodeColl = pTextNd->GetTextColl();
239  }
240 
241  RemoveIdxFromRange(rPam, false);
242 
243  SetPaM(rPam);
244  }
245 
246  // ... for consistency with the Insert File code in shellio.cxx, which
247  // creates separate SwUndoInsLayFormat for mysterious reasons, do this
248  // *before* anything else:
249  // after SetPaM but before MoveToUndoNds and DelContentIndex.
250  // note: there isn't an order dep wrt. initial Copy action because Undo
251  // overwrites the indexes but there is wrt. Redo because that uses the
252  // indexes
253  if (!m_FlyUndos.empty())
254  {
255  sal_uLong nTmp = rPam.GetPoint()->nNode.GetIndex();
256  for (size_t n = m_FlyUndos.size(); 0 < n; --n)
257  {
258  m_FlyUndos[ n-1 ]->UndoImpl(rContext);
259  }
260  m_nNodeDiff += nTmp - rPam.GetPoint()->nNode.GetIndex();
261  }
262 
264  {
265  // are there Footnotes or ContentFlyFrames in text?
266  m_nSetPos = pHistory->Count();
267  sal_uLong nTmp = rPam.GetMark()->nNode.GetIndex();
268  DelContentIndex(*rPam.GetMark(), *rPam.GetPoint(),
270  m_nNodeDiff += nTmp - rPam.GetMark()->nNode.GetIndex();
271  if( *rPam.GetPoint() != *rPam.GetMark() )
272  {
273  m_pUndoNodeIndex.reset(
274  new SwNodeIndex(rDoc.GetNodes().GetEndOfContent()));
275  MoveToUndoNds(rPam, m_pUndoNodeIndex.get());
276 
277  if( !m_bStartWasTextNode )
279  }
280  }
281 
282  SwNodeIndex& rIdx = rPam.GetPoint()->nNode;
283  SwTextNode* pTextNode = rIdx.GetNode().GetTextNode();
284  if( pTextNode )
285  {
286  if( !m_pTextFormatColl ) // if 0 than it's no TextNode -> delete
287  {
288  SwNodeIndex aDelIdx( rIdx );
289  ++rIdx;
290  SwContentNode* pCNd = rIdx.GetNode().GetContentNode();
291  rPam.GetPoint()->nContent.Assign( pCNd, pCNd ? pCNd->Len() : 0 );
292  rPam.SetMark();
293  rPam.DeleteMark();
294 
295  RemoveIdxRel(aDelIdx.GetIndex(), *rPam.GetPoint());
296 
297  rDoc.GetNodes().Delete( aDelIdx );
298  }
299  else
300  {
301  if( bJoinNext && pTextNode->CanJoinNext())
302  {
303  {
304  RemoveIdxRel( rIdx.GetIndex()+1, SwPosition( rIdx,
305  SwIndex( pTextNode, pTextNode->GetText().getLength() )));
306  }
307  pTextNode->JoinNext();
308  }
309  // reset all text attributes in the paragraph!
310  pTextNode->RstTextAttr( SwIndex(pTextNode, 0), pTextNode->Len(), 0, nullptr, true );
311 
312  pTextNode->ResetAllAttr();
313 
315  m_pTextFormatColl = static_cast<SwTextFormatColl*>(pTextNode->ChgFormatColl( m_pTextFormatColl )) ;
316 
317  pHistory->SetTmpEnd( m_nSetPos );
318  pHistory->TmpRollback(&rDoc, 0, false);
319  }
320  }
321 }
322 
323 // See SwUndoInserts::UndoImpl comments
324 // All actions here should be done in reverse order to what is done in SwUndoInserts::UndoImpl!
325 
327 {
328  // position cursor onto REDO section
329  SwPaM& rPam(rContext.GetCursorSupplier().CreateNewShellCursor());
330  SwDoc* pDoc = rPam.GetDoc();
331  rPam.DeleteMark();
332  rPam.GetPoint()->nNode = m_nSttNode - m_nNodeDiff;
333  SwContentNode* pCNd = rPam.GetContentNode();
334  rPam.GetPoint()->nContent.Assign( pCNd, m_nSttContent );
335 
336  SwTextFormatColl* pSavTextFormatColl = m_pTextFormatColl;
337  if( m_pTextFormatColl && pCNd && pCNd->IsTextNode() )
338  pSavTextFormatColl = static_cast<SwTextNode*>(pCNd)->GetTextColl();
339 
340  pHistory->SetTmpEnd( m_nSetPos );
341 
342  // retrieve start position for rollback
344  {
345  auto const pFlysAtInsPos(sw::GetFlysAnchoredAt(*pDoc,
346  rPam.GetPoint()->nNode.GetIndex()));
347 
348  const bool bMvBkwrd = MovePtBackward(rPam);
349 
350  // re-insert content again (first detach m_pUndoNodeIndex!)
351  sal_uLong const nMvNd = m_pUndoNodeIndex->GetIndex();
352  m_pUndoNodeIndex.reset();
353  MoveFromUndoNds(*pDoc, nMvNd, *rPam.GetMark());
354  if( m_bStartWasTextNode )
355  MovePtForward(rPam, bMvBkwrd);
356  rPam.Exchange();
357 
358  // at-char anchors post SplitNode are on index 0 of 2nd node and will
359  // remain there - move them back to the start (end would also work?)
360  if (pFlysAtInsPos)
361  {
362  for (SwFrameFormat * pFly : *pFlysAtInsPos)
363  {
364  SwFormatAnchor const*const pAnchor = &pFly->GetAnchor();
365  if (pAnchor->GetAnchorId() == RndStdIds::FLY_AT_CHAR)
366  {
367  SwFormatAnchor anchor(*pAnchor);
368  anchor.SetAnchor( rPam.GetMark() );
369  pFly->SetFormatAttr(anchor);
370  }
371  }
372  }
373  }
374 
375  if (pDoc->GetTextFormatColls()->IsAlive(m_pTextFormatColl))
376  {
377  SwTextNode* pTextNd = rPam.GetMark()->nNode.GetNode().GetTextNode();
378  if( pTextNd )
379  pTextNd->ChgFormatColl( m_pTextFormatColl );
380  }
381  m_pTextFormatColl = pSavTextFormatColl;
382 
383  if (m_pLastNodeColl && pDoc->GetTextFormatColls()->IsAlive(m_pLastNodeColl)
384  && rPam.GetPoint()->nNode != rPam.GetMark()->nNode)
385  {
386  SwTextNode* pTextNd = rPam.GetPoint()->nNode.GetNode().GetTextNode();
387  if( pTextNd )
388  pTextNd->ChgFormatColl( m_pLastNodeColl );
389  }
390 
391  // tdf#108124 the SwHistoryChangeFlyAnchor/SwHistoryFlyCnt must run before
392  // m_FlyUndos as they were created by DelContentIndex()
393  pHistory->Rollback( pDoc, m_nSetPos );
394 
395  // tdf#108124 (10/25/2017)
396  // During UNDO we call SwUndoInsLayFormat::UndoImpl in reverse order,
397  // firstly for m_FlyUndos[ m_FlyUndos.size()-1 ], etc.
398  // As absolute node index of fly stored in SwUndoFlyBase::nNdPgPos we
399  // should recover from Undo in direct order (last should be recovered first)
400  // During REDO we should recover Flys (Images) in direct order,
401  // firstly m_FlyUndos[0], then with m_FlyUndos[1] index, etc.
402 
403  for (size_t n = 0; m_FlyUndos.size() > n; ++n)
404  {
405  m_FlyUndos[n]->RedoImpl(rContext);
406  }
407 
409  {
410  RedlineFlags eOld = pDoc->getIDocumentRedlineAccess().GetRedlineFlags();
411  pDoc->getIDocumentRedlineAccess().SetRedlineFlags_intern( eOld & ~RedlineFlags::Ignore );
412  pDoc->getIDocumentRedlineAccess().AppendRedline( new SwRangeRedline( *m_pRedlineData, rPam ), true);
413  pDoc->getIDocumentRedlineAccess().SetRedlineFlags_intern( eOld );
414  }
415  else if( !( RedlineFlags::Ignore & GetRedlineFlags() ) &&
416  !pDoc->getIDocumentRedlineAccess().GetRedlineTable().empty() )
417  pDoc->getIDocumentRedlineAccess().SplitRedline(rPam);
418 }
419 
421 {
422  SwPaM aPam( rContext.GetDoc().GetNodes().GetEndOfContent() );
423  SetPaM( aPam );
424  SwPaM & rRepeatPaM( rContext.GetRepeatPaM() );
425  aPam.GetDoc()->getIDocumentContentOperations().CopyRange( aPam, *rRepeatPaM.GetPoint(), /*bCopyAll=*/false, /*bCheckPos=*/true );
426 }
427 
430 {
431 }
432 
434  : SwUndoInserts( SwUndoId::COPY, rPam )
435 {
436 }
437 
438 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::vector< std::shared_ptr< SwUndoInsLayFormat > > m_FlyUndos
Definition: undobj.hxx:244
SwPaM & AddUndoRedoPaM(::sw::UndoRedoContext &, bool const bCorrToContent=false) const
Definition: undobj.cxx:106
virtual sal_Int32 Len() const
Definition: node.cxx:1181
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:901
std::unique_ptr< SwHistory > pHistory
Definition: undobj.hxx:156
Represents the style of a paragraph.
Definition: fmtcol.hxx:55
Marks a position in the document model.
Definition: pam.hxx:35
std::unique_ptr< SwRedlineData > m_pRedlineData
Definition: undobj.hxx:245
virtual ~SwUndoInserts() override
Definition: untblk.cxx:181
const OUString & GetText() const
Definition: ndtxt.hxx:211
SwUndoId
Definition: swundo.hxx:29
virtual sal_uInt16 ResetAllAttr() override
Definition: ndtxt.cxx:5149
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:284
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:218
Definition: doc.hxx:185
void SetRedlineFlags(RedlineFlags eMode)
Definition: undobj.hxx:119
SwNode & GetNode() const
Definition: ndindex.hxx:118
Dialog to specify the properties of date form field.
Definition: accfrmobj.cxx:38
std::unique_ptr< std::vector< SwFrameFormat * > > m_pFrameFormats
Definition: undobj.hxx:243
IDocumentContentOperations const & getIDocumentContentOperations() const
Definition: doc.cxx:347
bool CanJoinNext(SwNodeIndex *pIdx=nullptr) const
Is it possible to join two nodes? In pIdx the second position can be returned.
Definition: node.cxx:1789
virtual SwContentNode * JoinNext() override
Definition: ndtxt.cxx:949
const SwFrameFormats * GetSpzFrameFormats() const
Definition: doc.hxx:737
IShellCursorSupplier & GetCursorSupplier()
Definition: UndoCore.hxx:96
SwUndoInserts(SwUndoId nUndoId, const SwPaM &)
Definition: untblk.cxx:63
void Delete(const SwNodeIndex &rPos, sal_uLong nNodes=1)
delete nodes
Definition: nodes.cxx:1063
SwIndex nContent
Definition: pam.hxx:38
static bool IsRedlineOn(const RedlineFlags eM)
SwDoc & GetDoc() const
Definition: UndoCore.hxx:126
sal_uLong GetIndex() const
Definition: ndindex.hxx:151
static void MoveToUndoNds(SwPaM &rPam, SwNodeIndex *pNodeIdx, sal_uLong *pEndNdIdx=nullptr)
Definition: undobj.cxx:709
SwDoc & GetDoc() const
Definition: UndoCore.hxx:94
static void RemoveIdxFromRange(SwPaM &rPam, bool bMoveNext)
Definition: undobj.cxx:124
virtual void UndoImpl(::sw::UndoRedoContext &) override
Definition: untblk.cxx:216
RedlineFlags GetRedlineFlags() const
Definition: undobj.hxx:118
SwUndoCpyDoc(const SwPaM &)
Definition: untblk.cxx:433
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:144
SwNode & GetEndOfContent() const
Regular ContentSection (i.e. the BodyText).
Definition: ndarr.hxx:164
virtual std::size_t GetRedlineAuthor()=0
SwUndoInsDoc(const SwPaM &)
Definition: untblk.cxx:428
static void MovePtForward(SwPaM &rPam, bool bMvBkwrd)
Definition: undobj.cxx:821
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:136
const SwAttrSet * GetpSwAttrSet() const
Definition: node.hxx:443
bool Move(SwMoveFnCollection const &fnMove=fnMoveForward, SwGoInDoc fnGo=GoInContent)
Movement of cursor.
Definition: pam.cxx:481
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:366
Style of a layout element.
Definition: frmfmt.hxx:57
const SwFormatAnchor & GetAnchor(bool=true) const
Definition: fmtanchr.hxx:81
const SwPosition * GetPoint() const
Definition: pam.hxx:207
void DelContentIndex(const SwPosition &pMark, const SwPosition &pPoint, DelContentType nDelContentType=DelContentType::AllMask)
Definition: undobj.cxx:846
SwIndex & Assign(SwIndexReg *, sal_Int32)
Definition: index.cxx:198
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:219
SwDoc * GetDoc() const
Definition: pam.hxx:243
Marks a character position inside a document model node.
Definition: index.hxx:37
virtual SwFormatColl * ChgFormatColl(SwFormatColl *) override
Definition: ndtxt.cxx:3928
Marks a node in the document model.
Definition: ndindex.hxx:31
static bool MovePtBackward(SwPaM &rPam)
Definition: undobj.cxx:808
bool HasSwAttrSet() const
Definition: node.hxx:444
sal_uLong m_nNodeDiff
Definition: undobj.hxx:248
sal_uLong m_nSttNode
Definition: undobj.hxx:218
SwTextFormatColl * m_pLastNodeColl
Definition: undobj.hxx:242
ignore Redlines
void SetInsertRange(const SwPaM &, bool bScanFlys=true, bool bSttWasTextNd=true)
Definition: untblk.cxx:106
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:79
virtual void RedoImpl(::sw::UndoRedoContext &) override
Definition: untblk.cxx:326
IDocumentRedlineAccess const & getIDocumentRedlineAccess() const
Definition: doc.cxx:367
void SetPaM(SwPaM &, bool bCorrToContent=false) const
Definition: undobj.cxx:78
static void MoveFromUndoNds(SwDoc &rDoc, sal_uLong nNodeIdx, SwPosition &rInsPos, const sal_uLong *pEndNdIdx=nullptr, bool bForceCreateFrames=false)
Definition: undobj.cxx:746
const SwTextFormatColls * GetTextFormatColls() const
Definition: doc.hxx:774
sal_Int32 GetIndex() const
Definition: index.hxx:95
SwTextFormatColl * m_pTextFormatColl
Definition: undobj.hxx:242
virtual bool IsRedlineOn() const =0
Query if redlining is on.
SwNodes & GetNodes()
Definition: doc.hxx:402
const SwPosition * End() const
Definition: pam.hxx:217
static void RemoveIdxRel(sal_uLong, const SwPosition &)
Definition: undobj.cxx:151
SwMoveFnCollection const & fnMoveBackward
Definition: paminit.cxx:58
std::unique_ptr< std::vector< SwFrameFormat * > > GetFlysAnchoredAt(SwDoc &rDoc, sal_uLong const nSttNode)
Definition: untblk.cxx:38
const short COPY
bool m_bStartWasTextNode
Definition: undobj.hxx:246
virtual RedlineFlags GetRedlineFlags() const =0
Query the currently set redline mode.
size_t size() const
Definition: docary.hxx:225
virtual void SetMark()
Unless this is called, the getter method of Mark will return Point.
Definition: pam.cxx:455
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:166
SwNode & GetEndOfExtras() const
This is the last EndNode of a special section.
Definition: ndarr.hxx:162
bool IsTextNode() const
Definition: node.hxx:636
sal_uInt16 m_nSetPos
Definition: undobj.hxx:251
virtual void RepeatImpl(::sw::RepeatContext &) override
Definition: untblk.cxx:420
sal_Int32 m_nSttContent
Definition: undobj.hxx:219
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
Definition: ndtxt.hxx:843
void SetAnchor(const SwPosition *pPos)
Definition: atrfrm.cxx:1486
std::unique_ptr< SwNodeIndex > m_pUndoNodeIndex
start of Content in UndoNodes for Redo
Definition: undobj.hxx:250
SwTextFormatColl * GetTextColl() const
Definition: ndtxt.hxx:837
virtual bool CopyRange(SwPaM &rPam, SwPosition &rPos, const bool bCopyAll, bool bCheckPos) const =0
Copy a selected content range to a position.