LibreOffice Module sw (master) 1
unattr.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 <sal/config.h>
21
22#include <utility>
23
24#include <UndoAttribute.hxx>
25#include <svl/itemiter.hxx>
26#include <editeng/tstpitem.hxx>
27#include <svx/svdobj.hxx>
28#include <osl/diagnose.h>
29#include <hintids.hxx>
30#include <fmtflcnt.hxx>
31#include <txtftn.hxx>
32#include <fmtanchr.hxx>
33#include <fmtfsize.hxx>
34#include <frmfmt.hxx>
35#include <fmtcntnt.hxx>
36#include <ftnidx.hxx>
37#include <doc.hxx>
41#include <docary.hxx>
42#include <swcrsr.hxx>
43#include <swundo.hxx>
44#include <pam.hxx>
45#include <ndtxt.hxx>
46#include <swtable.hxx>
47#include <swtblfmt.hxx>
48#include <UndoCore.hxx>
49#include <hints.hxx>
50#include <rolbck.hxx>
51#include <ndnotxt.hxx>
52#include <ftninfo.hxx>
53#include <redline.hxx>
54#include <section.hxx>
55#include <charfmt.hxx>
56#include <calbck.hxx>
57#include <frameformats.hxx>
58
60 : SwClient(&rFormat)
61 , m_rFormat(rFormat)
62 , m_bSaveDrawPt(bSvDrwPt)
63{
64}
65
67{
68 if (rHint.GetId() != SfxHintId::SwLegacyModify)
69 return;
70 auto pLegacy = static_cast<const sw::LegacyModifyHint*>(&rHint);
71 if(!pLegacy->m_pOld)
72 return;
73 assert(pLegacy->m_pOld->Which() != RES_OBJECTDYING);
74 if(!pLegacy->m_pNew)
75 return;
76 const SwDoc& rDoc = *m_rFormat.GetDoc();
77 auto pOld = pLegacy->m_pOld;
78 if(POOLATTR_END >= pLegacy->m_pOld->Which()) {
79 if(!GetUndo())
81 else
82 m_pUndo->PutAttr(*pOld, rDoc);
83 } else if(RES_ATTRSET_CHG == pOld->Which()) {
84 auto& rChgSet = *static_cast<const SwAttrSetChg*>(pOld)->GetChgSet();
85 if(!GetUndo())
87 else {
88 SfxItemIter aIter(rChgSet);
89 for(auto pItem = aIter.GetCurItem(); pItem; pItem = aIter.NextItem())
90 m_pUndo->PutAttr(*pItem, rDoc);
91 }
92 }
93}
94
96 SwFormat& rChgFormat,
97 bool bSaveDrawPt )
98 : SwUndo( SwUndoId::INSFMTATTR, rChgFormat.GetDoc() )
99 , m_sFormatName ( rChgFormat.GetName() )
100 // #i56253#
101 , m_oOldSet( std::move( rOldSet ) )
102 , m_nNodeIndex( 0 )
103 , m_nFormatWhich( rChgFormat.Which() )
104 , m_bSaveDrawPt( bSaveDrawPt )
105{
106 assert(m_sFormatName.getLength());
107
108 Init( rChgFormat );
109}
110
112 bool bSaveDrawPt )
113 : SwUndo( SwUndoId::INSFMTATTR, rChgFormat.GetDoc() )
114 , m_sFormatName(rChgFormat.GetName())
115 , m_oOldSet( rChgFormat.GetAttrSet().CloneAsValue( false ) )
116 , m_nNodeIndex( 0 )
117 , m_nFormatWhich( rChgFormat.Which() )
118 , m_bSaveDrawPt( bSaveDrawPt )
119{
120 assert(m_sFormatName.getLength());
121
122 m_oOldSet->Put( rItem );
123 Init( rChgFormat );
124}
125
126void SwUndoFormatAttr::Init( const SwFormat & rFormat )
127{
128 // tdf#126017 never save SwNodeIndex, it will go stale
129 m_oOldSet->ClearItem(RES_CNTNT);
130 // treat change of anchor specially
131 if ( SfxItemState::SET == m_oOldSet->GetItemState( RES_ANCHOR, false )) {
132 SaveFlyAnchor( &rFormat, m_bSaveDrawPt );
133 } else if ( RES_FRMFMT == m_nFormatWhich ) {
134 const SwDoc* pDoc = rFormat.GetDoc();
135 if (pDoc->GetTableFrameFormats()->ContainsFormat(dynamic_cast<const SwFrameFormat&>(rFormat)))
136 {
137 // Table Format: save table position, table formats are volatile!
138 SwTable * pTable = SwIterator<SwTable,SwFormat>( rFormat ).First();
139 if ( pTable ) {
140 m_nNodeIndex = pTable->GetTabSortBoxes()[ 0 ]->GetSttNd()
141 ->FindTableNode()->GetIndex();
142 }
143 } else if (dynamic_cast<const SwSectionFormat*>(&rFormat)) {
145 } else if(auto pBoxFormat = dynamic_cast<const SwTableBoxFormat*>(&rFormat))
146 {
147 auto pTableBox = pBoxFormat->GetTableBox();
148 if(pTableBox)
149 m_nNodeIndex = pTableBox->GetSttIdx();
150 }
151 }
152}
153
155{
156}
157
159{
160 // OD 2004-10-26 #i35443#
161 // Important note: <Undo(..)> also called by <ReDo(..)>
162
163 if (!m_oOldSet)
164 return;
165
166 SwFormat * pFormat = GetFormat(rContext.GetDoc());
167 if (!pFormat)
168 return;
169
170 // #i35443# - If anchor attribute has been successful
171 // restored, all other attributes are also restored.
172 // Thus, keep track of its restoration
173 bool bAnchorAttrRestored( false );
174 if ( SfxItemState::SET == m_oOldSet->GetItemState( RES_ANCHOR, false )) {
175 bAnchorAttrRestored = RestoreFlyAnchor(rContext);
176 if ( bAnchorAttrRestored ) {
177 // Anchor attribute successful restored.
178 // Thus, keep anchor position for redo
179 SaveFlyAnchor(pFormat);
180 } else {
181 // Anchor attribute not restored due to invalid anchor position.
182 // Thus, delete anchor attribute.
183 m_oOldSet->ClearItem( RES_ANCHOR );
184 }
185 }
186
187 if ( bAnchorAttrRestored ) return;
188
189 SwUndoFormatAttrHelper aTmp( *pFormat, m_bSaveDrawPt );
190 pFormat->SetFormatAttr( *m_oOldSet );
191 if ( aTmp.GetUndo() ) {
192 // transfer ownership of helper object's old set
193 if (aTmp.GetUndo()->m_oOldSet)
194 m_oOldSet.emplace(std::move(*aTmp.GetUndo()->m_oOldSet));
195 else
196 m_oOldSet.reset();
197 } else {
198 m_oOldSet->ClearItem();
199 }
200
202 rContext.SetSelections(static_cast<SwFrameFormat*>(pFormat), nullptr);
203 }
204}
205
206// Check if it is still in Doc
208{
209 switch (m_nFormatWhich)
210 {
211 case RES_TXTFMTCOLL:
214
215 case RES_GRFFMTCOLL:
217
218 case RES_CHRFMT:
220
221 case RES_FRMFMT:
222 if (m_nNodeIndex && (m_nNodeIndex < rDoc.GetNodes().Count()))
223 {
224 SwNode* pNd = rDoc.GetNodes()[m_nNodeIndex];
225 if (pNd->IsTableNode())
226 {
227 return static_cast<SwTableNode*>(pNd)->GetTable().GetFrameFormat();
228 }
229 else if (pNd->IsSectionNode())
230 {
231 return static_cast<SwSectionNode*>(pNd)->GetSection().GetFormat();
232 }
233 else if (pNd->IsStartNode() && (SwTableBoxStartNode ==
234 static_cast<SwStartNode*>(pNd)->GetStartNodeType()))
235 {
236 SwTableNode* pTableNode = pNd->FindTableNode();
237 if (pTableNode)
238 {
239 SwTableBox* pBox = pTableNode->GetTable().GetTableBox(m_nNodeIndex);
240 if (pBox)
241 {
242 return pBox->GetFrameFormat();
243 }
244 }
245 }
246 }
247 [[fallthrough]];
248 case RES_DRAWFRMFMT:
249 case RES_FLYFRMFMT:
250 {
252 if (pFormat)
253 return pFormat;
255 if (pFormat)
256 return pFormat;
257 }
258 break;
259 }
260
261 return nullptr;
262}
263
265{
266 // #i35443# - Because the undo stores the attributes for
267 // redo, the same code as for <Undo(..)> can be applied for <Redo(..)>
268 UndoImpl(rContext);
269}
270
272{
273 if (!m_oOldSet)
274 return;
275
276 SwDoc & rDoc(rContext.GetDoc());
277
278 SwFormat * pFormat = GetFormat(rDoc);
279 if (!pFormat)
280 return;
281
282 switch ( m_nFormatWhich ) {
283 case RES_GRFFMTCOLL: {
284 SwNoTextNode *const pNd =
286 if( pNd ) {
287 rDoc.SetAttr( pFormat->GetAttrSet(), *pNd->GetFormatColl() );
288 }
289 }
290 break;
291
292 case RES_TXTFMTCOLL:
294 {
295 SwTextNode *const pNd =
297 if( pNd ) {
298 rDoc.SetAttr( pFormat->GetAttrSet(), *pNd->GetFormatColl() );
299 }
300 }
301 break;
302
303 case RES_FLYFRMFMT: {
304 // Check if the cursor is in a flying frame
305 // Steps: search in all FlyFrameFormats for the FlyContent attribute
306 // and validate if the cursor is in the respective section
307 SwFrameFormat *const pFly =
309 if( pFly ) {
310 // Bug 43672: do not set all attributes!
311 if (SfxItemState::SET ==
312 pFormat->GetAttrSet().GetItemState( RES_CNTNT )) {
313 SfxItemSet aTmpSet( pFormat->GetAttrSet() );
314 aTmpSet.ClearItem( RES_CNTNT );
315 if( aTmpSet.Count() ) {
316 rDoc.SetAttr( aTmpSet, *pFly );
317 }
318 } else {
319 rDoc.SetAttr( pFormat->GetAttrSet(), *pFly );
320 }
321 }
322 break;
323 }
324 }
325}
326
328{
329 SwRewriter aRewriter;
330
331 aRewriter.AddRule(UndoArg1, m_sFormatName);
332
333 return aRewriter;
334}
335
336void SwUndoFormatAttr::PutAttr( const SfxPoolItem& rItem, const SwDoc& rDoc )
337{
338 if (RES_CNTNT == rItem.Which())
339 {
340 return; // tdf#126017 never save SwNodeIndex, it will go stale
341 }
342 m_oOldSet->Put( rItem );
343 if ( RES_ANCHOR == rItem.Which() )
344 {
345 SwFormat * pFormat = GetFormat( rDoc );
346 SaveFlyAnchor( pFormat, m_bSaveDrawPt );
347 }
348}
349
350void SwUndoFormatAttr::SaveFlyAnchor( const SwFormat * pFormat, bool bSvDrwPt )
351{
352 // Format is valid, otherwise you would not reach this point here
353 if( bSvDrwPt ) {
354 if ( RES_DRAWFRMFMT == pFormat->Which() ) {
355 Point aPt( static_cast<const SwFrameFormat*>(pFormat)->FindSdrObject()
356 ->GetRelativePos() );
357 // store old value as attribute, to keep SwUndoFormatAttr small
358 m_oOldSet->Put( SwFormatFrameSize( SwFrameSize::Variable, aPt.X(), aPt.Y() ) );
359 }
360 }
361
362 const SwFormatAnchor& rAnchor =
363 m_oOldSet->Get( RES_ANCHOR, false );
364 if( !rAnchor.GetContentAnchor() )
365 return;
366
367 sal_Int32 nContent = 0;
368 switch( rAnchor.GetAnchorId() ) {
369 case RndStdIds::FLY_AS_CHAR:
370 case RndStdIds::FLY_AT_CHAR:
371 nContent = rAnchor.GetContentAnchor()->GetContentIndex();
372 [[fallthrough]];
373 case RndStdIds::FLY_AT_PARA:
374 case RndStdIds::FLY_AT_FLY:
376 break;
377 default:
378 return;
379 }
380
381 SwFormatAnchor aAnchor( rAnchor.GetAnchorId(), nContent );
382 m_oOldSet->Put( aAnchor );
383}
384
385// #i35443# - Add return value, type <bool>.
386// Return value indicates, if anchor attribute is restored.
387// Note: If anchor attribute is restored, all other existing attributes
388// are also restored.
390{
391 SwDoc *const pDoc = & rContext.GetDoc();
392 SwFrameFormat* pFrameFormat = static_cast<SwFrameFormat*>( GetFormat( *pDoc ) );
393 const SwFormatAnchor& rAnchor =
394 m_oOldSet->Get( RES_ANCHOR, false );
395
396 SwFormatAnchor aNewAnchor( rAnchor.GetAnchorId() );
397 if (RndStdIds::FLY_AT_PAGE != rAnchor.GetAnchorId()) {
398 SwNode* pNd = pDoc->GetNodes()[ m_nNodeIndex ];
399
400 if ( (RndStdIds::FLY_AT_FLY == rAnchor.GetAnchorId())
401 ? ( !pNd->IsStartNode() || (SwFlyStartNode !=
402 static_cast<SwStartNode*>(pNd)->GetStartNodeType()) )
403 : !pNd->IsTextNode() ) {
404 // #i35443# - invalid position.
405 // Thus, anchor attribute not restored
406 return false;
407 }
408
409 SwPosition aPos( *pNd );
410 if ((RndStdIds::FLY_AS_CHAR == rAnchor.GetAnchorId()) ||
411 (RndStdIds::FLY_AT_CHAR == rAnchor.GetAnchorId())) {
412 aPos.nContent.Assign( static_cast<SwTextNode*>(pNd), rAnchor.GetPageNum() );
413 if ( aPos.GetContentIndex() > pNd->GetTextNode()->GetText().getLength()) {
414 // #i35443# - invalid position.
415 // Thus, anchor attribute not restored
416 return false;
417 }
418 }
419 aNewAnchor.SetAnchor( &aPos );
420 } else
421 aNewAnchor.SetPageNum( rAnchor.GetPageNum() );
422
423 Point aDrawSavePt, aDrawOldPt;
425 if( RES_DRAWFRMFMT == pFrameFormat->Which() ) {
426 // get the old cached value
427 const SwFormatFrameSize& rOldSize = m_oOldSet->Get( RES_FRM_SIZE );
428 aDrawSavePt.setX( rOldSize.GetWidth() );
429 aDrawSavePt.setY( rOldSize.GetHeight() );
430 m_oOldSet->ClearItem( RES_FRM_SIZE );
431
432 // write the current value into cache
433 aDrawOldPt = pFrameFormat->FindSdrObject()->GetRelativePos();
434 } else {
435 pFrameFormat->DelFrames(); // delete Frames
436 }
437 }
438
439 const SwFormatAnchor &rOldAnch = pFrameFormat->GetAnchor();
440 // #i54336#
441 // Consider case, that as-character anchored object has moved its anchor position.
442 if (RndStdIds::FLY_AS_CHAR == rOldAnch.GetAnchorId()) {
443 // With InContents it's tricky: the text attribute needs to be deleted.
444 // Unfortunately, this not only destroys the Frames but also the format.
445 // To prevent that, first detach the connection between attribute and
446 // format.
447 const SwPosition *pPos = rOldAnch.GetContentAnchor();
448 SwTextNode *pTextNode = static_cast<SwTextNode*>(&pPos->GetNode());
449 OSL_ENSURE( pTextNode->HasHints(), "Missing FlyInCnt-Hint." );
450 const sal_Int32 nIdx = pPos->GetContentIndex();
451 SwTextAttr * const pHint =
452 pTextNode->GetTextAttrForCharAt( nIdx, RES_TXTATR_FLYCNT );
453 assert(pHint && "Missing Hint.");
454 OSL_ENSURE( pHint->Which() == RES_TXTATR_FLYCNT,
455 "Missing FlyInCnt-Hint." );
456 OSL_ENSURE( pHint->GetFlyCnt().GetFrameFormat() == pFrameFormat,
457 "Wrong TextFlyCnt-Hint." );
458 const_cast<SwFormatFlyCnt&>(pHint->GetFlyCnt()).SetFlyFormat();
459
460 // Connection is now detached, therefore the attribute can be deleted
461 pTextNode->DeleteAttributes( RES_TXTATR_FLYCNT, nIdx, nIdx );
462 }
463
464 {
465 m_oOldSet->Put( aNewAnchor );
466 SwUndoFormatAttrHelper aTmp( *pFrameFormat, m_bSaveDrawPt );
467 pFrameFormat->SetFormatAttr( *m_oOldSet );
468 if ( aTmp.GetUndo() ) {
470 // transfer ownership of helper object's old set
471 if (aTmp.GetUndo()->m_oOldSet)
472 m_oOldSet.emplace(std::move(*aTmp.GetUndo()->m_oOldSet));
473 else
474 m_oOldSet.reset();
475 } else {
476 m_oOldSet->ClearItem();
477 }
478 }
479
480 if ( RES_DRAWFRMFMT == pFrameFormat->Which() )
481 {
482 // The Draw model also prepared an Undo object for its right positioning
483 // which unfortunately is relative. Therefore block here a position
484 // change of the Contact object by setting the anchor.
485 pFrameFormat->CallSwClientNotify(sw::RestoreFlyAnchorHint(aDrawSavePt));
486 // cache the old value again
487 m_oOldSet->Put(SwFormatFrameSize(SwFrameSize::Variable, aDrawOldPt.X(), aDrawOldPt.Y()));
488 }
489
490 if (RndStdIds::FLY_AS_CHAR == aNewAnchor.GetAnchorId()) {
491 const SwPosition* pPos = aNewAnchor.GetContentAnchor();
492 SwTextNode* pTextNd = pPos->GetNode().GetTextNode();
493 OSL_ENSURE( pTextNd, "no Text Node at position." );
494 SwFormatFlyCnt aFormat( pFrameFormat );
495 pTextNd->InsertItem( aFormat, pPos->GetContentIndex(), 0 );
496 }
497
498 if (RES_DRAWFRMFMT != pFrameFormat->Which())
499 pFrameFormat->MakeFrames();
500 else
501 {
503 }
504
505 rContext.SetSelections(pFrameFormat, nullptr);
506
507 // #i35443# - anchor attribute restored.
508 return true;
509}
510
512 const sal_uInt16 nWhichId )
513 : SwUndo( SwUndoId::RESETATTR, rChangedFormat.GetDoc() )
514 , m_pChangedFormat( &rChangedFormat )
515 , m_nWhichId( nWhichId )
516{
517 const SfxPoolItem* pItem = nullptr;
518 if (rChangedFormat.GetItemState(nWhichId, false, &pItem ) == SfxItemState::SET && pItem) {
519 m_pOldItem.reset( pItem->Clone() );
520 }
521}
522
524{
525}
526
528{
529 if (m_pOldItem)
530 {
532 }
533}
534
536{
537 if (m_pOldItem)
538 {
540 }
541}
542
543SwUndoResetAttr::SwUndoResetAttr( const SwPaM& rRange, sal_uInt16 nFormatId )
544 : SwUndo( SwUndoId::RESETATTR, &rRange.GetDoc() ), SwUndRng( rRange )
545 , m_pHistory( new SwHistory )
546 , m_nFormatId( nFormatId )
547{
548}
549
550SwUndoResetAttr::SwUndoResetAttr( const SwPosition& rPos, sal_uInt16 nFormatId )
551 : SwUndo( SwUndoId::RESETATTR, &rPos.GetDoc() )
552 , m_pHistory( new SwHistory )
553 , m_nFormatId( nFormatId )
554{
557}
558
560{
561}
562
564{
565 // reset old values
566 SwDoc & rDoc = rContext.GetDoc();
567 m_pHistory->TmpRollback( &rDoc, 0 );
568 m_pHistory->SetTmpEnd( m_pHistory->Count() );
569
572 SwTextNode* pTNd = rDoc.GetNodes()[ m_nSttNode ]->GetTextNode();
573 if( pTNd )
574 pTNd->DontExpandFormat( m_nSttContent, false );
575 }
576
577 AddUndoRedoPaM(rContext);
578}
579
581{
582 SwDoc & rDoc = rContext.GetDoc();
583 SwPaM & rPam = AddUndoRedoPaM(rContext);
584
585 switch ( m_nFormatId ) {
586 case RES_CHRFMT:
587 rDoc.RstTextAttrs(rPam);
588 break;
589 case RES_TXTFMTCOLL:
590 rDoc.ResetAttrs(rPam, false, m_Ids );
591 break;
593 rDoc.ResetAttrs(rPam, true, m_Ids );
594
595 break;
597 // special treatment for TOXMarks
598 {
600 SwNodeIndex aIdx( rDoc.GetNodes(), m_nSttNode );
601 SwPosition aPos( aIdx, aIdx.GetNode().GetContentNode(), m_nSttContent );
602
603 sal_uInt16 nCnt = SwDoc::GetCurTOXMark( aPos, aArr );
604 if( nCnt ) {
605 if( 1 < nCnt ) {
606 // search for the right one
607 SwHistoryHint* pHHint = (GetHistory())[ 0 ];
608 if( pHHint && HSTRY_SETTOXMARKHNT == pHHint->Which() ) {
609 while( nCnt ) {
610 if ( static_cast<SwHistorySetTOXMark*>(pHHint)
611 ->IsEqual( *aArr[ --nCnt ] ) ) {
612 ++nCnt;
613 break;
614 }
615 }
616 } else
617 nCnt = 0;
618 }
619 // found one, thus delete it
620 if( nCnt-- ) {
621 rDoc.DeleteTOXMark( aArr[ nCnt ] );
622 }
623 }
624 }
625 break;
626 }
627}
628
630{
632 return;
633 }
634
635 switch ( m_nFormatId ) {
636 case RES_CHRFMT:
637 rContext.GetDoc().RstTextAttrs(rContext.GetRepeatPaM());
638 break;
639 case RES_TXTFMTCOLL:
640 rContext.GetDoc().ResetAttrs(rContext.GetRepeatPaM(), false, m_Ids);
641 break;
643 rContext.GetDoc().ResetAttrs(rContext.GetRepeatPaM(), true, m_Ids);
644 break;
645 }
646}
647
649{
650 m_Ids = std::move(rAttrs);
651}
652
653SwUndoAttr::SwUndoAttr( const SwPaM& rRange, const SfxPoolItem& rAttr,
654 const SetAttrMode nFlags )
655 : SwUndo( SwUndoId::INSATTR, &rRange.GetDoc() ), SwUndRng( rRange )
656 , m_AttrSet( rRange.GetDoc().GetAttrPool(), rAttr.Which(), rAttr.Which() )
657 , m_pHistory( new SwHistory )
658 , m_nNodeIndex( NODE_OFFSET_MAX )
659 , m_nInsertFlags( nFlags )
660{
661 m_AttrSet.Put( rAttr );
662
663 // Save character style as a style name, not as a reference
665 if (pItem)
666 {
667 uno::Any aValue;
668 pItem->QueryValue(aValue, RES_TXTATR_CHARFMT);
669 aValue >>= m_aChrFormatName;
670 }
671}
672
674 const SetAttrMode nFlags )
675 : SwUndo( SwUndoId::INSATTR, &rRange.GetDoc() ), SwUndRng( rRange )
676 , m_AttrSet(std::move( aSet ))
677 , m_pHistory( new SwHistory )
678 , m_nNodeIndex( NODE_OFFSET_MAX )
679 , m_nInsertFlags( nFlags )
680{
681 // Save character style as a style name, not as a reference
683 if (pItem)
684 {
685 uno::Any aValue;
686 pItem->QueryValue(aValue, RES_TXTATR_CHARFMT);
687 aValue >>= m_aChrFormatName;
688 }
689}
690
692{
693}
694
695void SwUndoAttr::SaveRedlineData( const SwPaM& rPam, bool bIsContent )
696{
697 SwDoc& rDoc = rPam.GetDoc();
698 if ( rDoc.getIDocumentRedlineAccess().IsRedlineOn() ) {
699 m_pRedlineData.reset( new SwRedlineData( bIsContent
700 ? RedlineType::Insert
701 : RedlineType::Format,
703 }
704
707 m_pRedlineSaveData.reset();
708
710 if ( bIsContent ) {
712 }
713}
714
716{
717 SwDoc *const pDoc = & rContext.GetDoc();
718
719 RemoveIdx( *pDoc );
720
722 SwPaM aPam(pDoc->GetNodes().GetEndOfContent());
723 if ( NODE_OFFSET_MAX != m_nNodeIndex ) {
724 aPam.DeleteMark();
726 aPam.SetMark();
727 ++aPam.GetPoint()->nContent;
728 pDoc->getIDocumentRedlineAccess().DeleteRedline(aPam, false, RedlineType::Any);
729 } else {
730 // remove all format redlines, will be recreated if needed
731 SetPaM(aPam);
732 pDoc->getIDocumentRedlineAccess().DeleteRedline(aPam, false, RedlineType::Format);
734 {
736 }
737 }
738 }
739
740 const bool bToLast = (1 == m_AttrSet.Count())
741 && (RES_TXTATR_FIELD <= m_AttrSet.GetRanges()[0].first)
742 && (m_AttrSet.GetRanges()[0].first <= RES_TXTATR_ANNOTATION);
743
744 // restore old values
745 m_pHistory->TmpRollback( pDoc, 0, !bToLast );
746 m_pHistory->SetTmpEnd( m_pHistory->Count() );
747
748 // set cursor onto Undo area
749 AddUndoRedoPaM(rContext);
750}
751
753{
754 // RefMarks are not repeat capable
755 if ( SfxItemState::SET != m_AttrSet.GetItemState( RES_TXTATR_REFMARK, false ) ) {
758 } else if ( 1 < m_AttrSet.Count() ) {
759 SfxItemSet aTmpSet( m_AttrSet );
760 aTmpSet.ClearItem( RES_TXTATR_REFMARK );
762 aTmpSet, m_nInsertFlags );
763 }
764}
765
767{
768 SwDoc & rDoc = rContext.GetDoc();
769 SwPaM & rPam = AddUndoRedoPaM(rContext);
770
771 // Restore pointer to char format from name
772 if (!m_aChrFormatName.isEmpty())
773 {
775 if (pCharFormat)
776 {
777 SwFormatCharFormat aFormat(pCharFormat);
778 m_AttrSet.Put(aFormat);
779 }
780 }
781
782 if ( m_pRedlineData &&
787
788 if ( NODE_OFFSET_MAX != m_nNodeIndex ) {
789 rPam.SetMark();
790 if ( rPam.Move( fnMoveBackward ) ) {
792 true);
793 }
794 rPam.DeleteMark();
795 } else {
797 }
798
800 } else {
802 }
803}
804
806{
807 if ( SfxItemState::SET != m_AttrSet.GetItemState( RES_TXTATR_FTN, false ))
808 return ;
809
810 SwNodes& rNds = rDoc.GetNodes();
811 for ( sal_uInt16 n = 0; n < m_pHistory->Count(); ++n ) {
812 sal_Int32 nContent = 0;
813 SwNodeOffset nNode(0);
814 SwHistoryHint* pHstHint = (*m_pHistory)[ n ];
815 switch ( pHstHint->Which() ) {
816 case HSTRY_RESETTXTHNT: {
817 SwHistoryResetText * pHistoryHint
818 = static_cast<SwHistoryResetText*>(pHstHint);
819 if ( RES_TXTATR_FTN == pHistoryHint->GetWhich() ) {
820 nNode = pHistoryHint->GetNode();
821 nContent = pHistoryHint->GetContent();
822 }
823 }
824 break;
825
826 default:
827 break;
828 }
829
830 if( nNode ) {
831 SwTextNode* pTextNd = rNds[ nNode ]->GetTextNode();
832 if( pTextNd ) {
833 SwTextAttr *const pTextHt =
834 pTextNd->GetTextAttrForCharAt(nContent, RES_TXTATR_FTN);
835 if( pTextHt ) {
836 // ok, so get values
837 SwTextFootnote* pFootnote = static_cast<SwTextFootnote*>(pTextHt);
838 RemoveIdxFromSection( rDoc, pFootnote->GetStartNode()->GetIndex() );
839 return ;
840 }
841 }
842 }
843 }
844}
845
847 : SwUndo( SwUndoId::SETDEFTATTR, &rDoc )
848{
849 const SvxTabStopItem* pItem = rSet.GetItemIfSet( RES_PARATR_TABSTOP, false );
850 if( pItem )
851 {
852 // store separately, because it may change!
853 m_pTabStop.reset(pItem->Clone());
854 if ( 1 != rSet.Count() ) { // are there more attributes?
855 m_oOldSet.emplace( rSet );
856 }
857 } else {
858 m_oOldSet.emplace( rSet );
859 }
860}
861
863{
864}
865
867{
868 SwDoc & rDoc = rContext.GetDoc();
869 if (m_oOldSet)
870 {
872 *rDoc.GetDfltTextFormatColl() );
873 rDoc.SetDefault( *m_oOldSet );
874 m_oOldSet.reset();
875 if ( aTmp.GetUndo() ) {
876 // transfer ownership of helper object's old set
877 if (aTmp.GetUndo()->m_oOldSet)
878 m_oOldSet.emplace(std::move(*aTmp.GetUndo()->m_oOldSet));
879 }
880 }
881 if (m_pTabStop)
882 {
883 std::unique_ptr<SvxTabStopItem> pOld(rDoc.GetDefault(RES_PARATR_TABSTOP).Clone());
884 rDoc.SetDefault( *m_pTabStop );
885 m_pTabStop = std::move( pOld );
886 }
887}
888
890{
891 UndoImpl(rContext);
892}
893
895 const SwPaM& rPam, bool bFlag, bool bMod )
896 : SwUndo( bFlag ? SwUndoId::INC_LEFTMARGIN : SwUndoId::DEC_LEFTMARGIN, &rPam.GetDoc() )
897 , SwUndRng( rPam )
898 , m_pHistory( new SwHistory )
899 , m_bModulus( bMod )
900{
901}
902
904{
905}
906
908{
909 SwDoc & rDoc = rContext.GetDoc();
910
911 // restore old values
912 m_pHistory->TmpRollback( & rDoc, 0 );
913 m_pHistory->SetTmpEnd( m_pHistory->Count() );
914
915 AddUndoRedoPaM(rContext);
916}
917
919{
920 SwDoc & rDoc = rContext.GetDoc();
921 SwPaM & rPam = AddUndoRedoPaM(rContext);
922
923 rDoc.MoveLeftMargin( rPam,
926}
927
929{
930 SwDoc & rDoc = rContext.GetDoc();
933}
934
936 const SwPaM& rRange, OUString aText,
937 bool const bIsEndNote)
938 : SwUndo( SwUndoId::CHGFTN, &rRange.GetDoc() ), SwUndRng( rRange )
939 , m_pHistory( new SwHistory() )
940 , m_Text(std::move( aText ))
941 , m_bEndNote( bIsEndNote )
942{
943}
944
946{
947}
948
950{
951 SwDoc & rDoc = rContext.GetDoc();
952
953 m_pHistory->TmpRollback( &rDoc, 0 );
954 m_pHistory->SetTmpEnd( m_pHistory->Count() );
955
957
958 AddUndoRedoPaM(rContext);
959}
960
962{
963 SwDoc & rDoc( rContext.GetDoc() );
964 SwPaM & rPaM = AddUndoRedoPaM(rContext);
965 rDoc.SetCurFootnote(rPaM, m_Text, m_bEndNote);
966 SetPaM(rPaM);
967}
968
970{
971 SwDoc & rDoc = rContext.GetDoc();
972 rDoc.SetCurFootnote(rContext.GetRepeatPaM(), m_Text, m_bEndNote);
973}
974
976 : SwUndo( SwUndoId::FTNINFO, &rDoc )
977 , m_pFootNoteInfo( new SwFootnoteInfo( rInfo ) )
978{
979}
980
982{
983}
984
986{
987 SwDoc & rDoc = rContext.GetDoc();
988 SwFootnoteInfo *pInf = new SwFootnoteInfo( rDoc.GetFootnoteInfo() );
990 m_pFootNoteInfo.reset( pInf );
991}
992
994{
995 SwDoc & rDoc = rContext.GetDoc();
996 SwFootnoteInfo *pInf = new SwFootnoteInfo( rDoc.GetFootnoteInfo() );
998 m_pFootNoteInfo.reset( pInf );
999}
1000
1002 : SwUndo( SwUndoId::FTNINFO, &rDoc )
1003 , m_pEndNoteInfo( new SwEndNoteInfo( rInfo ) )
1004{
1005}
1006
1008{
1009}
1010
1012{
1013 SwDoc & rDoc = rContext.GetDoc();
1014 SwEndNoteInfo *pInf = new SwEndNoteInfo( rDoc.GetEndNoteInfo() );
1016 m_pEndNoteInfo.reset( pInf );
1017}
1018
1020{
1021 SwDoc & rDoc = rContext.GetDoc();
1022 SwEndNoteInfo *pInf = new SwEndNoteInfo( rDoc.GetEndNoteInfo() );
1024 m_pEndNoteInfo.reset( pInf );
1025}
1026
1028 : SwUndo( SwUndoId::DONTEXPAND, &rPos.GetDoc() )
1029 , m_nNodeIndex( rPos.GetNodeIndex() )
1030 , m_nContentIndex( rPos.GetContentIndex() )
1031{
1032}
1033
1035{
1036 SwCursor *const pPam(& rContext.GetCursorSupplier().CreateNewShellCursor());
1037 SwDoc *const pDoc = & rContext.GetDoc();
1038
1039 SwPosition& rPos = *pPam->GetPoint();
1041 pDoc->DontExpandFormat( rPos, false );
1042}
1043
1045{
1046 SwPaM *const pPam(& rContext.GetCursorSupplier().CreateNewShellCursor());
1047 SwDoc *const pDoc = & rContext.GetDoc();
1048
1049 SwPosition& rPos = *pPam->GetPoint();
1051 pDoc->DontExpandFormat( rPos );
1052}
1053
1055{
1056 SwPaM & rPam = rContext.GetRepeatPaM();
1057 SwDoc & rDoc = rContext.GetDoc();
1058 rDoc.DontExpandFormat( *rPam.GetPoint() );
1059}
1060
1061/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
OUString m_Text
@ Ignore
ignore Redlines
@ UndoArg1
Definition: SwRewriter.hxx:29
virtual void InsertItemSet(const SwPaM &rRg, const SfxItemSet &, const SetAttrMode nFlags=SetAttrMode::DEFAULT, SwRootFrame const *pLayout=nullptr)=0
virtual const SwRootFrame * GetCurrentLayout() const =0
virtual const SwViewShell * GetCurrentViewShell() const =0
Returns the layout set at the document.
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 void SetRedlineFlags_intern(RedlineFlags eMode)=0
Set a new redline mode.
virtual AppendResult AppendRedline(SwRangeRedline *pNewRedl, bool bCallDelete)=0
Append a new redline.
virtual RedlineFlags GetRedlineFlags() const =0
Query the currently set redline mode.
virtual Point GetRelativePos() const
SfxHintId GetId() const
const SfxPoolItem * GetCurItem() const
const SfxPoolItem * NextItem()
const WhichRangesContainer & GetRanges() const
sal_uInt16 Count() const
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
sal_uInt16 ClearItem(sal_uInt16 nWhich=0)
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem * GetItem(sal_uInt16 nWhich, bool bSearchInParent=true) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const
sal_uInt16 Which() const
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const=0
tools::Long GetHeight() const
tools::Long GetWidth() const
virtual SvxTabStopItem * Clone(SfxItemPool *pPool=nullptr) const override
Represents the style of a text portion.
Definition: charfmt.hxx:27
SwContentIndex & Assign(const SwContentNode *, sal_Int32)
Definition: index.cxx:206
SwFormatColl * GetFormatColl() const
Definition: node.hxx:476
Definition: doc.hxx:192
void RstTextAttrs(const SwPaM &rRg, bool bInclRefToxMark=false, bool bExactRange=false, SwRootFrame const *pLayout=nullptr)
Definition: docfmt.cxx:221
const SwFootnoteInfo & GetFootnoteInfo() const
Definition: doc.hxx:634
static sal_uInt16 GetCurTOXMark(const SwPosition &rPos, SwTOXMarks &)
Get current table of contents Mark.
Definition: doctxm.cxx:117
void SetAttr(const SfxPoolItem &, SwFormat &)
Set attribute in given format.1y If Undo is enabled, the old values is added to the Undo history.
Definition: docfmt.cxx:451
void SetDefault(const SfxPoolItem &)
Set attribute as new default attribute in current document.
Definition: docfmt.cxx:539
SwCharFormat * FindCharFormatByName(const OUString &rName) const
Definition: doc.hxx:775
void SetFootnoteInfo(const SwFootnoteInfo &rInfo)
Definition: docftn.cxx:294
IDocumentContentOperations const & getIDocumentContentOperations() const
Definition: doc.cxx:316
SwNodes & GetNodes()
Definition: doc.hxx:413
bool SetCurFootnote(const SwPaM &rPam, const OUString &rNumStr, bool bIsEndNote)
change footnotes in range
Definition: docftn.cxx:432
IDocumentRedlineAccess const & getIDocumentRedlineAccess() const
Definition: doc.cxx:336
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
Definition: doc.cxx:406
SwFootnoteIdxs & GetFootnoteIdxs()
Definition: doc.hxx:638
const SfxPoolItem & GetDefault(sal_uInt16 nFormatHint) const
Get the default attribute in this document.
Definition: docfmt.cxx:663
const SwEndNoteInfo & GetEndNoteInfo() const
Definition: doc.hxx:636
void ResetAttrs(const SwPaM &rRg, bool bTextAttr=true, const o3tl::sorted_vector< sal_uInt16 > &rAttrs=o3tl::sorted_vector< sal_uInt16 >(), const bool bSendDataChangedEvents=true, SwRootFrame const *pLayout=nullptr)
Reset attributes.
Definition: docfmt.cxx:242
const SwTextFormatColl * GetDfltTextFormatColl() const
Definition: doc.hxx:780
const SwFrameFormats * GetFrameFormats() const
Definition: doc.hxx:742
void SetEndNoteInfo(const SwEndNoteInfo &rInfo)
Definition: docftn.cxx:365
bool DontExpandFormat(const SwPosition &rPos, bool bFlag=true)
Definition: docfmt.cxx:1699
SwTextFormatColl * FindTextFormatCollByName(const OUString &rName) const
Definition: doc.hxx:803
void DeleteTOXMark(const SwTOXMark *pTOXMark)
Delete table of contents Mark.
Definition: doctxm.cxx:155
const SwGrfFormatColls * GetGrfFormatColls() const
Definition: doc.hxx:810
const SwFrameFormats * GetSpzFrameFormats() const
Definition: doc.hxx:748
const SwFrameFormats * GetTableFrameFormats() const
Definition: doc.hxx:815
void MoveLeftMargin(const SwPaM &rPam, bool bRight, bool bModulus, SwRootFrame const *pLayout=nullptr)
Adjust left margin via object bar (similar to adjustment of numerations).
Definition: docfmt.cxx:1635
void UpdateAllFootnote()
Definition: ftnidx.cxx:266
FlyAnchors.
Definition: fmtanchr.hxx:37
sal_uInt16 GetPageNum() const
Definition: fmtanchr.hxx:68
void SetPageNum(sal_uInt16 nNew)
Definition: fmtanchr.hxx:74
void SetAnchor(const SwPosition *pPos)
Definition: atrfrm.cxx:1586
RndStdIds GetAnchorId() const
Definition: fmtanchr.hxx:67
const SwPosition * GetContentAnchor() const
Definition: fmtanchr.hxx:69
const SwNodeIndex * GetContentIdx() const
Definition: fmtcntnt.hxx:46
Format of a fly content.
Definition: fmtflcnt.hxx:33
SwFrameFormat * GetFrameFormat() const
Definition: fmtflcnt.hxx:45
Base class for various Writer styles.
Definition: format.hxx:47
const SwDoc * GetDoc() const
The document is set in SwAttrPool now, therefore you always can access it.
Definition: format.hxx:139
virtual bool ResetFormatAttr(sal_uInt16 nWhich1, sal_uInt16 nWhich2=0)
Definition: format.cxx:620
sal_uInt16 Which() const
for Querying of Writer-functions.
Definition: format.hxx:82
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
Definition: format.cxx:387
const SwFormatAnchor & GetAnchor(bool=true) const
Definition: fmtanchr.hxx:83
const SwAttrSet & GetAttrSet() const
For querying the attribute array.
Definition: format.hxx:136
virtual bool SetFormatAttr(const SfxPoolItem &rAttr)
Definition: format.cxx:449
const SwFormatContent & GetContent(bool=true) const
Definition: fmtcntnt.hxx:55
virtual Value FindFormatByName(const OUString &rName) const override
Definition: docary.hxx:165
Style of a layout element.
Definition: frmfmt.hxx:62
virtual void DelFrames()
Destroys all Frames in aDepend (Frames are identified via dynamic_cast).
Definition: atrfrm.cxx:2702
virtual void MakeFrames()
Creates the views.
Definition: atrfrm.cxx:2713
SdrObject * FindSdrObject()
Definition: frmfmt.hxx:141
virtual SwFrameFormat * FindFormatByName(const OUString &rName) const override
Definition: docfmt.cxx:2094
bool ContainsFormat(SwFrameFormat const &rFormat) const
fast check if given format is contained here @precond pFormat must not have been deleted
Definition: docfmt.cxx:2147
HISTORY_HINT Which() const
Definition: rolbck.hxx:86
sal_uInt16 GetWhich() const
Definition: rolbck.hxx:194
sal_Int32 GetContent() const
Definition: rolbck.hxx:196
SwNodeOffset GetNode() const
Definition: rolbck.hxx:195
bool IsEqual(const SwTOXMark &rCmp) const
Definition: rolbck.cxx:418
TElementType * First()
Definition: calbck.hxx:356
Layout frame for SwNoTextNode, i.e. graphics and OLE nodes (including charts).
Definition: ndnotxt.hxx:30
Marks a node in the document model.
Definition: ndindex.hxx:31
SwNode & GetNode() const
Definition: ndindex.hxx:136
SwNodeOffset GetIndex() const
Definition: ndindex.hxx:171
Base class of the Writer document model elements.
Definition: node.hxx:84
SwFrameFormat * GetFlyFormat() const
If node is in a fly return the respective format.
Definition: node.cxx:731
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
Definition: ndtxt.hxx:876
bool IsStartNode() const
Definition: node.hxx:652
bool IsSectionNode() const
Definition: node.hxx:672
bool IsTableNode() const
Definition: node.hxx:668
bool IsTextNode() const
Definition: node.hxx:664
SwTableNode * FindTableNode()
Search table node, in which it is.
Definition: node.cxx:370
SwContentNode * GetContentNode()
Definition: node.hxx:643
SwNoTextNode * GetNoTextNode()
Definition: ndnotxt.hxx:95
SwNode & GetEndOfContent() const
Regular ContentSection (i.e. the BodyText).
Definition: ndarr.hxx:165
SwNodeOffset Count() const
Definition: ndarr.hxx:142
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:187
SwNode & GetPointNode() const
Definition: pam.hxx:283
virtual void SetMark()
Unless this is called, the getter method of Mark will return Point.
Definition: pam.cxx:612
bool Move(SwMoveFnCollection const &fnMove=fnMoveForward, SwGoInDoc fnGo=GoInContent)
Movement of cursor.
Definition: pam.cxx:638
SwDoc & GetDoc() const
Definition: pam.hxx:299
void DeleteMark()
Definition: pam.hxx:231
const SwPosition * GetPoint() const
Definition: pam.hxx:261
void AddRule(SwUndoArg eWhat, const OUString &rWith)
Definition: SwRewriter.cxx:25
Starts a section of nodes in the document model.
Definition: node.hxx:325
SwStartNodeType GetStartNodeType() const
Definition: node.hxx:341
SwTableBox is one table cell in the document model.
Definition: swtable.hxx:419
SwFrameFormat * GetFrameFormat()
Definition: swtable.hxx:457
const SwTable & GetTable() const
Definition: node.hxx:521
SwTable is one table in the document model, containing rows (which contain cells).
Definition: swtable.hxx:113
const SwTableBox * GetTableBox(const OUString &rName, const bool bPerformValidCheck=false) const
Definition: swtable.cxx:1340
SwTableSortBoxes & GetTabSortBoxes()
Definition: swtable.hxx:262
A wrapper around SfxPoolItem to store the start position of (usually) a text portion,...
Definition: txatbase.hxx:44
const SwFormatFlyCnt & GetFlyCnt() const
Definition: txatbase.hxx:226
sal_uInt16 Which() const
Definition: txatbase.hxx:116
const SwNodeIndex * GetStartNode() const
Definition: txtftn.hxx:41
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:86
void DeleteAttributes(const sal_uInt16 nWhich, const sal_Int32 nStart, const sal_Int32 nEnd=0)
delete all attributes of type nWhich at nStart (opt. end nEnd)
Definition: thints.cxx:1802
SwTextAttr * InsertItem(SfxPoolItem &rAttr, const sal_Int32 nStart, const sal_Int32 nEnd, const SetAttrMode nMode=SetAttrMode::DEFAULT)
create new text attribute from rAttr and insert it
Definition: thints.cxx:1305
bool HasHints() const
Definition: ndtxt.hxx:232
const OUString & GetText() const
Definition: ndtxt.hxx:222
SwTextAttr * GetTextAttrForCharAt(const sal_Int32 nIndex, const sal_uInt16 nWhich=RES_TXTATR_END) const
get the text attribute at position nIndex which owns the dummy character CH_TXTATR_* at that position...
Definition: ndtxt.cxx:3105
bool DontExpandFormat(sal_Int32 nContentIdx, bool bFlag=true, bool bFormatToTextAttributes=true)
When appropriate set DontExpand-flag at INet or character styles respectively.
Definition: ndtxt.cxx:1643
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
SfxItemSet m_AttrSet
SwNodeOffset m_nNodeIndex
void RemoveIdx(SwDoc &rDoc)
Definition: unattr.cxx:805
const std::unique_ptr< SwHistory > m_pHistory
virtual void RedoImpl(::sw::UndoRedoContext &) override
Definition: unattr.cxx:766
virtual void UndoImpl(::sw::UndoRedoContext &) override
Definition: unattr.cxx:715
SwUndoAttr(const SwPaM &, SfxItemSet, const SetAttrMode nFlags)
Definition: unattr.cxx:673
void SaveRedlineData(const SwPaM &rPam, bool bInsContent)
Definition: unattr.cxx:695
virtual void RepeatImpl(::sw::RepeatContext &) override
Definition: unattr.cxx:752
OUString m_aChrFormatName
std::unique_ptr< SwRedlineSaveDatas > m_pRedlineSaveData
virtual ~SwUndoAttr() override
Definition: unattr.cxx:691
std::unique_ptr< SwRedlineData > m_pRedlineData
const SetAttrMode m_nInsertFlags
virtual void UndoImpl(::sw::UndoRedoContext &) override
Definition: unattr.cxx:949
const std::unique_ptr< SwHistory > m_pHistory
SwUndoChangeFootNote(const SwPaM &rRange, OUString aText, bool bIsEndNote)
Definition: unattr.cxx:935
virtual void RedoImpl(::sw::UndoRedoContext &) override
Definition: unattr.cxx:961
virtual ~SwUndoChangeFootNote() override
Definition: unattr.cxx:945
virtual void RepeatImpl(::sw::RepeatContext &) override
Definition: unattr.cxx:969
const OUString m_Text
std::optional< SfxItemSet > m_oOldSet
SwUndoDefaultAttr(const SfxItemSet &rOldSet, const SwDoc &rDoc)
Definition: unattr.cxx:846
virtual ~SwUndoDefaultAttr() override
Definition: unattr.cxx:862
virtual void RedoImpl(::sw::UndoRedoContext &) override
Definition: unattr.cxx:889
std::unique_ptr< SvxTabStopItem > m_pTabStop
virtual void UndoImpl(::sw::UndoRedoContext &) override
Definition: unattr.cxx:866
const sal_Int32 m_nContentIndex
const SwNodeOffset m_nNodeIndex
virtual void RedoImpl(::sw::UndoRedoContext &) override
Definition: unattr.cxx:1044
virtual void UndoImpl(::sw::UndoRedoContext &) override
Definition: unattr.cxx:1034
SwUndoDontExpandFormat(const SwPosition &rPos)
Definition: unattr.cxx:1027
virtual void RepeatImpl(::sw::RepeatContext &) override
Definition: unattr.cxx:1054
std::unique_ptr< SwEndNoteInfo > m_pEndNoteInfo
SwUndoEndNoteInfo(const SwEndNoteInfo &rInfo, const SwDoc &rDoc)
Definition: unattr.cxx:1001
virtual ~SwUndoEndNoteInfo() override
Definition: unattr.cxx:1007
virtual void UndoImpl(::sw::UndoRedoContext &) override
Definition: unattr.cxx:1011
virtual void RedoImpl(::sw::UndoRedoContext &) override
Definition: unattr.cxx:1019
std::unique_ptr< SwFootnoteInfo > m_pFootNoteInfo
virtual void RedoImpl(::sw::UndoRedoContext &) override
Definition: unattr.cxx:993
virtual void UndoImpl(::sw::UndoRedoContext &) override
Definition: unattr.cxx:985
virtual ~SwUndoFootNoteInfo() override
Definition: unattr.cxx:981
SwUndoFootNoteInfo(const SwFootnoteInfo &rInfo, const SwDoc &rDoc)
Definition: unattr.cxx:975
std::unique_ptr< SwUndoFormatAttr > m_pUndo
SwUndoFormatAttr * GetUndo() const
virtual void SwClientNotify(const SwModify &, const SfxHint &) override
Definition: unattr.cxx:66
SwUndoFormatAttrHelper(SwFormat &rFormat, bool bSaveDrawPt=true)
Definition: unattr.cxx:59
virtual void RedoImpl(::sw::UndoRedoContext &) override
Definition: unattr.cxx:264
const sal_uInt16 m_nFormatWhich
SwUndoFormatAttr(SfxItemSet &&rOldSet, SwFormat &rFormat, bool bSaveDrawPt)
Definition: unattr.cxx:95
bool RestoreFlyAnchor(::sw::UndoRedoContext &rContext)
Definition: unattr.cxx:389
void SaveFlyAnchor(const SwFormat *pFormat, bool bSaveDrawPt=false)
Definition: unattr.cxx:350
void Init(const SwFormat &rFormat)
Definition: unattr.cxx:126
virtual void RepeatImpl(::sw::RepeatContext &) override
Definition: unattr.cxx:271
virtual SwRewriter GetRewriter() const override
Returns the rewriter for this object.
Definition: unattr.cxx:327
SwFormat * GetFormat(const SwDoc &rDoc)
Definition: unattr.cxx:207
SwNodeOffset m_nNodeIndex
virtual void UndoImpl(::sw::UndoRedoContext &) override
Definition: unattr.cxx:158
OUString m_sFormatName
std::optional< SfxItemSet > m_oOldSet
virtual ~SwUndoFormatAttr() override
Definition: unattr.cxx:154
const bool m_bSaveDrawPt
void PutAttr(const SfxPoolItem &rItem, const SwDoc &rDoc)
Definition: unattr.cxx:336
SwUndoFormatResetAttr(SwFormat &rChangedFormat, const sal_uInt16 nWhichId)
Definition: unattr.cxx:511
std::unique_ptr< SfxPoolItem > m_pOldItem
virtual ~SwUndoFormatResetAttr() override
Definition: unattr.cxx:523
virtual void UndoImpl(::sw::UndoRedoContext &) override
Definition: unattr.cxx:527
virtual void RedoImpl(::sw::UndoRedoContext &) override
Definition: unattr.cxx:535
SwFormat *const m_pChangedFormat
const sal_uInt16 m_nWhichId
virtual ~SwUndoMoveLeftMargin() override
Definition: unattr.cxx:903
virtual void UndoImpl(::sw::UndoRedoContext &) override
Definition: unattr.cxx:907
const std::unique_ptr< SwHistory > m_pHistory
SwUndoMoveLeftMargin(const SwPaM &, bool bRight, bool bModulus)
Definition: unattr.cxx:894
virtual void RepeatImpl(::sw::RepeatContext &) override
Definition: unattr.cxx:928
virtual void RedoImpl(::sw::UndoRedoContext &) override
Definition: unattr.cxx:918
void SetAttrs(o3tl::sorted_vector< sal_uInt16 > &&rAttrs)
Definition: unattr.cxx:648
virtual void UndoImpl(::sw::UndoRedoContext &) override
Definition: unattr.cxx:563
const std::unique_ptr< SwHistory > m_pHistory
SwUndoResetAttr(const SwPaM &, sal_uInt16 nFormatId)
Definition: unattr.cxx:543
virtual void RepeatImpl(::sw::RepeatContext &) override
Definition: unattr.cxx:629
SwHistory & GetHistory()
virtual void RedoImpl(::sw::UndoRedoContext &) override
Definition: unattr.cxx:580
virtual ~SwUndoResetAttr() override
Definition: unattr.cxx:559
o3tl::sorted_vector< sal_uInt16 > m_Ids
const sal_uInt16 m_nFormatId
void SetRedlineFlags(RedlineFlags eMode)
Definition: undobj.hxx:121
RedlineFlags GetRedlineFlags() const
Definition: undobj.hxx:120
static void SetSaveData(SwDoc &rDoc, SwRedlineSaveDatas &rSData)
Definition: undobj.cxx:1478
SwUndoId GetId() const
Definition: undobj.hxx:102
static bool FillSaveDataForFormat(const SwPaM &, SwRedlineSaveDatas &)
Definition: undobj.cxx:1448
static void RemoveIdxFromSection(SwDoc &, SwNodeOffset nSttIdx, const SwNodeOffset *pEndIdx=nullptr)
Definition: undobj.cxx:108
virtual void CallSwClientNotify(const SfxHint &rHint) const override
Definition: calbck.cxx:325
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 SetSelections(SwFrameFormat *const pSelFormat, SdrMarkList *const pMarkList)
Definition: UndoCore.hxx:99
virtual OUString GetName() const override
@ Variable
Frame is variable in Var-direction.
constexpr TypedWhichId< SwGrfFormatColl > RES_GRFFMTCOLL(158)
constexpr TypedWhichId< SwFormatFootnote > RES_TXTATR_FTN(59)
constexpr TypedWhichId< SwFlyFrameFormat > RES_FLYFRMFMT(156)
constexpr TypedWhichId< SwFormatFrameSize > RES_FRM_SIZE(89)
constexpr TypedWhichId< SwFrameFormat > RES_FRMFMT(155)
constexpr TypedWhichId< SwFormatAnchor > RES_ANCHOR(104)
constexpr TypedWhichId< SvxTabStopItem > RES_PARATR_TABSTOP(68)
constexpr TypedWhichId< SwPtrMsgPoolItem > RES_OBJECTDYING(RES_MSG_BEGIN)
constexpr TypedWhichId< SwFormatField > RES_TXTATR_ANNOTATION(60)
constexpr TypedWhichId< SwFormatContent > RES_CNTNT(95)
constexpr TypedWhichId< SwDrawFrameFormat > RES_DRAWFRMFMT(159)
constexpr TypedWhichId< SwCharFormat > RES_CHRFMT(RES_FMT_BEGIN)
constexpr TypedWhichId< SwFormatField > RES_TXTATR_FIELD(RES_TXTATR_NOEND_BEGIN)
constexpr TypedWhichId< SwFormatCharFormat > RES_TXTATR_CHARFMT(52)
constexpr TypedWhichId< SwAttrSetChg > RES_ATTRSET_CHG(163)
constexpr TypedWhichId< SwTextFormatColl > RES_TXTFMTCOLL(157)
constexpr TypedWhichId< SwFormatFlyCnt > RES_TXTATR_FLYCNT(58)
constexpr TypedWhichId< SwFormatRefMark > RES_TXTATR_REFMARK(RES_TXTATR_WITHEND_BEGIN)
constexpr TypedWhichId< SwConditionTextFormatColl > RES_CONDTXTFMTCOLL(160)
constexpr TypedWhichId< SwTOXMark > RES_TXTATR_TOXMARK(47)
constexpr sal_uInt16 RES_FMT_BEGIN(RES_UNKNOWNATR_END)
constexpr sal_uInt16 POOLATTR_END(RES_UNKNOWNATR_END)
sal_Int64 n
const SvxPageUsage aArr[]
@ SwFlyStartNode
Definition: ndtyp.hxx:54
@ SwTableBoxStartNode
Definition: ndtyp.hxx:53
constexpr SwNodeOffset NODE_OFFSET_MAX(SAL_MAX_INT32)
SwMoveFnCollection const & fnMoveBackward
Definition: paminit.cxx:58
@ HSTRY_SETTOXMARKHNT
Definition: rolbck.hxx:64
@ HSTRY_RESETTXTHNT
Definition: rolbck.hxx:65
static SfxItemSet & rSet
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
SwContentIndex nContent
Definition: pam.hxx:39
SetAttrMode
Definition: swtypes.hxx:133
SwUndoId
Definition: swundo.hxx:30
@ INC_LEFTMARGIN
@ DEC_LEFTMARGIN
std::vector< SwTOXMark * > SwTOXMarks
Definition: tox.hxx:46