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