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